diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bef70d9f..6f1f8cea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: python-version: 3.12 - name: Lint with flake8 run: | - pip install flake8 + pip install flake8 flake8-pyproject flake8 src scripts conftest.py tox: diff --git a/pyproject.toml b/pyproject.toml index 8fd8d67e..a0679c27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,76 @@ +[project] +name = "nsupdate" +dynamic = ["version"] +authors = [{name="The nsupdate.info Team (see AUTHORS)", email="info@nsupdate.info"}, ] +description = "A dynamic DNS update service" +readme = "README.rst" +keywords = ["dyndns", "ddns", "dynamic dns", "django"] +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Web Environment', + 'Framework :: Django', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Topic :: Internet :: Name Service (DNS)', +] +license = {text="BSD"} +requires-python = ">=3.8, <3.13" +dependencies = [ + 'dnspython', + 'netaddr', + 'django >=4.2.0, <4.3.0', + 'django-bootstrap-form', + 'django-referrer-policy', + 'django-registration-redux', + 'django-extensions', + 'social-auth-app-django', + 'requests', # for our ddns_client +] + +[project.urls] +Homepage = "https://github.com/nsupdate-info/nsupdate.info/" + [build-system] -requires = ["setuptools", "setuptools-scm"] +requires = ["setuptools", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +# make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052 +# https://github.com/borgbackup/borg/issues/6875 +write_to = "src/nsupdate/_version.py" +write_to_template = "__version__ = version = {version!r}\n" + +[tool.pytest.ini_options] +markers = ["requires_sequential"] +env = [ + "DJANGO_SETTINGS_MODULE = nsupdate.settings.dev", +] + +[tool.flake8] +ignore = [ + "E124", + "E125", + "E129", + "E402", + "E501", + "E722", + "E731", + "F401", + "F403", + "F405", + "F811", + "F841", + "W503", + "W504", +] +max_line_length = 120 +exclude = ['build', 'dist', '.git', '.idea', '.cache', '.mypy_cache', '.tox', 'docs', 'migrations'] + diff --git a/requirements.d/dev.txt b/requirements.d/dev.txt index a2f8921a..0f7f74ed 100644 --- a/requirements.d/dev.txt +++ b/requirements.d/dev.txt @@ -5,6 +5,7 @@ pytest pytest-django pytest-cov tox +build wheel pylint pylint-django diff --git a/setup.cfg b/setup.cfg index 19c53321..9b99664b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,18 +1,3 @@ -[egg_info] -tag_build = -tag_date = 0 -tag_svn_revision = 0 - -[bdist_rpm] -release=1 -doc_files= - README.rst - LICENSE - PKG-INFO - docs/ -requires=python -build_requires=python - [build_sphinx] source-dir = docs/ build-dir = docs/_build @@ -20,28 +5,3 @@ all_files = 1 [upload_sphinx] upload-dir = docs/_build/html - -[tool:pytest] -DJANGO_SETTINGS_MODULE = nsupdate.settings.dev -markers = - requires_sequential - -[flake8] -max_line_length = 120 -exclude = build,dist,.git,.idea,.cache,.tox,docs,migrations -ignore = - E124 - E125 - E129 - E402 - E501 - E722 - E731 - F401 - F403 - F405 - F811 - F841 - W503 - W504 - diff --git a/setup.py b/setup.py deleted file mode 100644 index 6e897c53..00000000 --- a/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -""" -setup for nsupdate package -""" - -from setuptools import setup, find_packages - - -with open('README.rst') as f: - readme_content = f.read() - -setup( - name='nsupdate', - use_scm_version={ - 'write_to': 'src/nsupdate/_version.py', - }, - url='http://github.com/nsupdate-info/nsupdate.info/', - license='BSD', - author='The nsupdate.info Team (see AUTHORS)', - author_email='info@nsupdate.info', - description='A dynamic DNS update service', - long_description=readme_content, - keywords="dyndns ddns dynamic dns django", - packages=find_packages('src', exclude=['_tests', ]), - package_dir={'': 'src'}, - # See also the MANIFEST.in file. - # We want to install all the files in the package directories: - include_package_data=True, - zip_safe=False, - platforms='any', - python_requires='>=3.8, <3.13', - setup_requires=['setuptools_scm'], - install_requires=[ - 'dnspython', - 'netaddr', - 'django>=4.2.0,<4.3.0', - 'django-bootstrap-form', - 'django-referrer-policy', - 'django-registration-redux', - 'django-extensions', - 'social-auth-app-django', - 'requests', # for our ddns_client - 'setuptools_scm', - ], - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Web Environment', - 'Framework :: Django', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Topic :: Internet :: Name Service (DNS)', - ], -) diff --git a/tox.ini b/tox.ini index 3961a412..4efff377 100644 --- a/tox.ini +++ b/tox.ini @@ -19,4 +19,5 @@ skip_install=true changedir = deps = flake8 + flake8-pyproject commands = flake8 src scripts conftest.py