From 37987796707d3a3b3dbddd93caf61d179b5e85e0 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Fri, 1 Nov 2019 13:01:22 -0700 Subject: [PATCH] Turn this into a proper python module using setup.py... Use requirements in setup.py for dev via requirements.txt... --- Makefile | 4 ++-- ntunnel.py => ntunnel/__init__.py | 0 requirements.txt | 6 +++-- setup.py | 37 +++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 4 deletions(-) rename ntunnel.py => ntunnel/__init__.py (100%) create mode 100644 setup.py diff --git a/Makefile b/Makefile index 21a09e7..68dd63c 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ VIRTUALENV ?= virtualenv VRITUALENVARGS = -MODULES=ntunnel.py +FILES=ntunnel/__init__.py test: - (echo $(MODULES) | entr sh -c 'python -m coverage run -m unittest $(basename $(MODULES)) && coverage report --omit=p/\* -m -i') + (echo $(FILES) | entr sh -c 'python -m coverage run -m unittest ntunnel && coverage report --omit=p/\* -m -i') env: ($(VIRTUALENV) $(VIRTUALENVARGS) p && . ./p/bin/activate && pip install -r requirements.txt) diff --git a/ntunnel.py b/ntunnel/__init__.py similarity index 100% rename from ntunnel.py rename to ntunnel/__init__.py diff --git a/requirements.txt b/requirements.txt index fbf6982..c518e6b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ -coverage --e git+https://github.com/jmgurney/noiseprotocol.git@f1c048242c807328724c8119505293975fe7c614#egg=noiseprotocol +# use setup.py for dependancy info +-e . + +-e .[dev] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..27aff48 --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +from setuptools import setup + +# Install requirements for git: +# https://stackoverflow.com/questions/18026980/python-setuptools-how-can-i-list-a-private-repository-under-install-requires + +setup(name='ntunnel', + version='0.1.0', + description='A socket tunning tool using the Noise Protocol', + author='John-Mark Gurney', + author_email='jmg@funkthat.com', + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Console', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: BSD License', + 'Topic :: Security', + 'Topic :: System :: Networking', + 'Topic :: Utilities', + ], + url='https://www.funkthat.com/gitea/jmg/ntunnel', + packages=[ 'ntunnel', ], + python_requires='~=3.7', + install_requires=[ + 'noiseprotocol @ git+https://github.com/jmgurney/noiseprotocol.git@f1c048242c807328724c8119505293975fe7c614' + ], + extras_require = { + 'dev': [ 'coverage' ], + }, + entry_poitns={ + 'console_scripts': { + 'ntunnel': 'ntunnel:main', + } + } +)