From 35c3d5f526c21e0c2f0a550414bf2d045079ac45 Mon Sep 17 00:00:00 2001 From: "emdee@spm.plastiras.org" Date: Sat, 13 Jan 2024 23:02:48 +0000 Subject: [PATCH] src --- .gitignore | 1 + LICENSE.md | 1 + exclude_badExits.bash | 2 +- exclude_badExits.txt => exclude_badExits.hlp | 0 pyproject.toml | 42 +++++++++++++++++ setup.py | 47 +++++++++++++++++++ src/exclude_badExits/__init__.py | 2 + .../exclude_badExits/exclude_badExits.py | 0 .../exclude_badExits/support_onions.py | 0 .../exclude_badExits/trustor_poc.py | 0 10 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 LICENSE.md rename exclude_badExits.txt => exclude_badExits.hlp (100%) create mode 100644 pyproject.toml create mode 100644 setup.py create mode 100644 src/exclude_badExits/__init__.py rename exclude_badExits.py => src/exclude_badExits/exclude_badExits.py (100%) rename support_onions.py => src/exclude_badExits/support_onions.py (100%) rename trustor_poc.py => src/exclude_badExits/trustor_poc.py (100%) diff --git a/.gitignore b/.gitignore index 5d381cc..7e8ec1f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *.py[cod] *$py.class +*.junk # C extensions *.so diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1 @@ + diff --git a/exclude_badExits.bash b/exclude_badExits.bash index e08ba05..4d6ae74 100644 --- a/exclude_badExits.bash +++ b/exclude_badExits.bash @@ -8,7 +8,7 @@ CAFILE=/etc/ssl/certs/ca-certificates.crt # you may have a special python for installed packages EXE=`which python3.bash` -$EXE exclude_badExits.py --help > exclude_badExits.txt & +$EXE exclude_badExits.py --help > exclude_badExits.hlp & $EXE -c 'from exclude_badExits import __doc__; print(__doc__)' >exclude_badExits.md # an example of running exclude_badExits with full debugging # expected to 20 minutes or so diff --git a/exclude_badExits.txt b/exclude_badExits.hlp similarity index 100% rename from exclude_badExits.txt rename to exclude_badExits.hlp diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fa83935 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "exclude_badExits" +description = "A Python3 ctypes wrapping of c-toxcore into Python." +authors = [{ name = "emdee", email = "emdee@spm.plastiras.org" } ] +requires-python = ">=3.6" +keywords = ["tox", "python3", "bad exits"] +classifiers = [ + "License :: OSI Approved", + "Operating System :: POSIX :: BSD :: FreeBSD", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + ] +dynamic = ["version", "readme", ] # cannot be dynamic ['license'] +scripts = { exclude_badExits = "exclude_badExits.exclude_badExits:iMain" } + +# ... +[tool.setuptools.dynamic] +version = {attr = "exclude_badExits.__version__"} +readme = {file = ["README.md"]} + +[project.license] +file = "LICENSE.md" + +[project.urls] +repository = "https://git.plastiras.org/emdee/exclude_badExits" + +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = ["exclude_badExits"] + +#[tool.setuptools.packages.find] +#where = "src" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fd17f6c --- /dev/null +++ b/setup.py @@ -0,0 +1,47 @@ +# -*-mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -* + +import re +from setuptools import setup, find_packages + +with open("qasync/__init__.py") as f: + version = re.search(r'__version__\s+=\s+"(.*)"', f.read()).group(1) + +long_description = "\n\n".join([ + open("README.md").read(), + ]) + +if __name__ == '__main__': + setup( + name="exclude_badExits", + version=__version__, + description="""A program to exclude bad exits on the Tor network""", + long_description=long_description, + author="Nusenu (originally)", + author_email='', + license="1clause BSD", + packages = find_packages(exclude=['test*']), + # url="", + # download_url="https://", + keywords=['exit nodes', 'Tor', 'tor onion controller'], + # maybe less - nothing fancy + python_requires="~=3.6", + # probably works on PyQt6 and PySide2 but untested + # https://github.com/CabbageDevelopment/qasync/ + install_requires=['cryptography', + 'rsa', + 'stem', + 'urllib3', + 'yaml'], + entry_points={ + 'console_scripts': ['exclude_badExits = exclude_badExits.__main__:iMain', ]}, + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3', + 'Topic :: Security', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + ) diff --git a/src/exclude_badExits/__init__.py b/src/exclude_badExits/__init__.py new file mode 100644 index 0000000..2bcf11b --- /dev/null +++ b/src/exclude_badExits/__init__.py @@ -0,0 +1,2 @@ + +__version__ = "1.0.0" diff --git a/exclude_badExits.py b/src/exclude_badExits/exclude_badExits.py similarity index 100% rename from exclude_badExits.py rename to src/exclude_badExits/exclude_badExits.py diff --git a/support_onions.py b/src/exclude_badExits/support_onions.py similarity index 100% rename from support_onions.py rename to src/exclude_badExits/support_onions.py diff --git a/trustor_poc.py b/src/exclude_badExits/trustor_poc.py similarity index 100% rename from trustor_poc.py rename to src/exclude_badExits/trustor_poc.py