diff options
| author | Simeon Simeonov | 2022-03-31 07:21:33 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2022-03-31 07:21:33 +0200 |
| commit | 4ea3c077bd4111960af1b93195cb25bfb1d6edce (patch) | |
| tree | 9ed0b8fdb4398cf79a8ecc3ab39ade2d374eb65c | |
| parent | f19fde48c6b3f65c164c931286e72a0d254c1fb3 (diff) | |
Restructure the project in order to replace distutils with setuptoolsv1.1.0
| -rw-r--r-- | pyproject.toml | 14 | ||||
| -rw-r--r-- | setup.cfg | 42 | ||||
| -rw-r--r-- | setup.py | 50 | ||||
| -rw-r--r-- | sphinx_conf.py | 13 | ||||
| -rw-r--r-- | src/otp2289/__init__.py (renamed from otp2289/__init__.py) | 0 | ||||
| -rw-r--r-- | src/otp2289/__main__.py (renamed from otp2289/__main__.py) | 0 | ||||
| -rw-r--r-- | src/otp2289/generator.py (renamed from otp2289/generator.py) | 0 | ||||
| -rw-r--r-- | src/otp2289/server.py (renamed from otp2289/server.py) | 15 |
8 files changed, 74 insertions, 60 deletions
diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..21a01e2 --- /dev/null +++ b/pyproject.toml | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | [build-system] | ||
| 2 | requires = [ | ||
| 3 | "setuptools>=51", | ||
| 4 | "wheel" | ||
| 5 | ] | ||
| 6 | |||
| 7 | build-backend = "setuptools.build_meta" | ||
| 8 | |||
| 9 | |||
| 10 | [tool.pytest.ini_options] | ||
| 11 | minversion = "6.0" | ||
| 12 | testpaths = [ | ||
| 13 | "tests" | ||
| 14 | ] | ||
diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d6b2eb9 --- /dev/null +++ b/setup.cfg | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | [metadata] | ||
| 2 | name = pyotp2289 | ||
| 3 | version = attr: otp2289.__version__ | ||
| 4 | author = attr: otp2289.__author__ | ||
| 5 | author_email = sgs@pichove.org | ||
| 6 | description = A pure Python implementation of "A One-Time Password System" | ||
| 7 | long_description = file: README.md | ||
| 8 | long_description_content_type = text/markdown | ||
| 9 | url = https://github.com/blackm0re/pyotp2289 | ||
| 10 | |||
| 11 | classifiers = | ||
| 12 | Development Status :: 5 - Production/Stable | ||
| 13 | Intended Audience :: Developers | ||
| 14 | License :: OSI Approved :: BSD License | ||
| 15 | Programming Language :: Python :: 3 | ||
| 16 | Programming Language :: Python :: 3.6 | ||
| 17 | Programming Language :: Python :: 3.7 | ||
| 18 | Programming Language :: Python :: 3.8 | ||
| 19 | Programming Language :: Python :: 3.9 | ||
| 20 | Programming Language :: Python :: 3.10 | ||
| 21 | Programming Language :: Python :: 3.11 | ||
| 22 | Programming Language :: Python :: Implementation | ||
| 23 | Operating System :: OS Independent | ||
| 24 | Topic :: Security :: Cryptography | ||
| 25 | |||
| 26 | project_urls = | ||
| 27 | Bug Tracker = https://github.com/blackm0re/pyotp2289/issues | ||
| 28 | Source = https://github.com/blackm0re/pyotp2289 | ||
| 29 | API Documentation = https://gnulover.simeonov.no/docs/api/pyotp2289/latest/ | ||
| 30 | |||
| 31 | [options] | ||
| 32 | package_dir = | ||
| 33 | = src | ||
| 34 | packages = find: | ||
| 35 | python_requires = >=3.6 | ||
| 36 | |||
| 37 | [options.packages.find] | ||
| 38 | where = src | ||
| 39 | |||
| 40 | [options.entry_points] | ||
| 41 | console_scripts = | ||
| 42 | otp2289 = otp2289.__main__:main | ||
diff --git a/setup.py b/setup.py deleted file mode 100644 index 875d966..0000000 --- a/setup.py +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | |||
| 3 | import setuptools | ||
| 4 | |||
| 5 | import otp2289 | ||
| 6 | |||
| 7 | |||
| 8 | with open('README.md', 'r') as fh: | ||
| 9 | long_description = fh.read() | ||
| 10 | |||
| 11 | |||
| 12 | setuptools.setup( | ||
| 13 | name='pyotp2289', | ||
| 14 | version=otp2289.__version__, | ||
| 15 | author=otp2289.__author__, | ||
| 16 | author_email='sgs@pichove.org', | ||
| 17 | description='A pure Python implementation of "A One-Time Password System"', | ||
| 18 | license=otp2289.__license__, | ||
| 19 | long_description=long_description, | ||
| 20 | long_description_content_type='text/markdown', | ||
| 21 | url='https://github.com/blackm0re/pyotp2289', | ||
| 22 | packages=setuptools.find_packages(), | ||
| 23 | exclude_package_data={'': ['.gitignore']}, | ||
| 24 | entry_points={ | ||
| 25 | 'console_scripts': [ | ||
| 26 | 'otp2289=otp2289.__main__:main', | ||
| 27 | ], | ||
| 28 | }, | ||
| 29 | classifiers=[ | ||
| 30 | 'Development Status :: 5 - Production/Stable', | ||
| 31 | 'Intended Audience :: Developers', | ||
| 32 | 'License :: OSI Approved :: BSD License', | ||
| 33 | 'Programming Language :: Python :: 3 :: Only', | ||
| 34 | 'Programming Language :: Python :: 3.6', | ||
| 35 | 'Programming Language :: Python :: 3.7', | ||
| 36 | 'Programming Language :: Python :: 3.8', | ||
| 37 | 'Programming Language :: Python :: 3.9', | ||
| 38 | 'Programming Language :: Python :: Implementation', | ||
| 39 | 'Operating System :: OS Independent', | ||
| 40 | 'Topic :: Security :: Cryptography' | ||
| 41 | ], | ||
| 42 | keywords='2289 freebsd unix security cryptography otp password', | ||
| 43 | project_urls={ | ||
| 44 | 'Bug Reports': 'https://github.com/blackm0re/pyotp2289/issues', | ||
| 45 | 'Source': 'https://github.com/blackm0re/pyotp2289', | ||
| 46 | 'API Documentation': ( | ||
| 47 | 'http://gnulover.simeonov.no/docs/api/pyotp2289/latest/') | ||
| 48 | }, | ||
| 49 | python_requires='>=3.6', | ||
| 50 | ) | ||
diff --git a/sphinx_conf.py b/sphinx_conf.py index c7247ee..561db43 100644 --- a/sphinx_conf.py +++ b/sphinx_conf.py | |||
| @@ -12,20 +12,23 @@ | |||
| 12 | # | 12 | # |
| 13 | # import os | 13 | # import os |
| 14 | # import sys | 14 | # import sys |
| 15 | # sys.path.insert(0, '/home/sgs/development/gitprogs/python/pyotp2289/otp2289') | 15 | # sys.path.insert( |
| 16 | # 0, | ||
| 17 | # '/home/sgs/development/gitprogs/python/pyotp2289/src/otp2289', | ||
| 18 | # ) | ||
| 16 | 19 | ||
| 17 | 20 | ||
| 18 | # -- Project information ----------------------------------------------------- | 21 | # -- Project information ----------------------------------------------------- |
| 19 | 22 | ||
| 20 | project = 'pyotp2289' | 23 | project = 'pyotp2289' |
| 21 | copyright = '2020, Simeon Simeonov' | 24 | copyright = '2020-2022, Simeon Simeonov' |
| 22 | author = 'Simeon Simeonov' | 25 | author = 'Simeon Simeonov' |
| 23 | 26 | ||
| 24 | # The short X.Y version | 27 | # The short X.Y version |
| 25 | version = '1.0.0' | 28 | version = '1.1.0' |
| 26 | 29 | ||
| 27 | # The full version, including alpha/beta/rc tags | 30 | # The full version, including alpha/beta/rc tags |
| 28 | release = '1.0.0' | 31 | release = '1.1.0' |
| 29 | 32 | ||
| 30 | 33 | ||
| 31 | # -- General configuration --------------------------------------------------- | 34 | # -- General configuration --------------------------------------------------- |
| @@ -81,4 +84,4 @@ html_static_path = ['_static'] | |||
| 81 | todo_include_todos = True | 84 | todo_include_todos = True |
| 82 | 85 | ||
| 83 | # Generated by running: sphinx-apidoc with: | 86 | # Generated by running: sphinx-apidoc with: |
| 84 | # -P -F -o html -H pyotp2289 -A "Simeon Simeonov" -V "1.0.0" otp2289 | 87 | # -P -F -o html -H pyotp2289 -A "Simeon Simeonov" -V "1.1.0" otp2289 |
diff --git a/otp2289/__init__.py b/src/otp2289/__init__.py index 59694a7..59694a7 100644 --- a/otp2289/__init__.py +++ b/src/otp2289/__init__.py | |||
diff --git a/otp2289/__main__.py b/src/otp2289/__main__.py index 78e60e8..78e60e8 100644 --- a/otp2289/__main__.py +++ b/src/otp2289/__main__.py | |||
diff --git a/otp2289/generator.py b/src/otp2289/generator.py index 7b86e1b..7b86e1b 100644 --- a/otp2289/generator.py +++ b/src/otp2289/generator.py | |||
diff --git a/otp2289/server.py b/src/otp2289/server.py index 7f742cd..066cba2 100644 --- a/otp2289/server.py +++ b/src/otp2289/server.py | |||
| @@ -456,11 +456,16 @@ class OTPStore: | |||
| 456 | in a child class. | 456 | in a child class. |
| 457 | 457 | ||
| 458 | dict_obj has the following format: | 458 | dict_obj has the following format: |
| 459 | {'key': {'ot_hex': val1, | 459 | { |
| 460 | 'current_step': val2, | 460 | 'key': { |
| 461 | 'seed': val3, | 461 | 'ot_hex': val1, |
| 462 | 'hash_algo': val4}, | 462 | 'current_step': val2, |
| 463 | ...., ....} | 463 | 'seed': val3, |
| 464 | 'hash_algo': val4 | ||
| 465 | }, | ||
| 466 | ..., | ||
| 467 | ..., | ||
| 468 | } | ||
| 464 | 469 | ||
| 465 | :param dict_obj: The dict-object | 470 | :param dict_obj: The dict-object |
| 466 | :type dict_obj: dict | 471 | :type dict_obj: dict |
