diff --git a/.gitignore b/.gitignore index 7f93ebf..84d0cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -venv __pycache__ +dist +nftables_api.egg-info +venv diff --git a/nftables_api/__init__.py b/nftables_api/__init__.py index 104f172..dc89877 100644 --- a/nftables_api/__init__.py +++ b/nftables_api/__init__.py @@ -7,3 +7,5 @@ You may not use this work except in compliance with the Licence. An English copy of the Licence is shipped in a file called LICENSE along with this applications source code. You may obtain copies of the Licence in any of the official languages at https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12. """ + +from .__version__ import __version__ as __version__ diff --git a/nftables_api/__version__.py b/nftables_api/__version__.py new file mode 100644 index 0000000..ea24acb --- /dev/null +++ b/nftables_api/__version__.py @@ -0,0 +1,11 @@ +""" +A RESTful HTTP API for nftables +Copyright 2024, Georg Pfuetzenreuter + +Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence"). +You may not use this work except in compliance with the Licence. +An English copy of the Licence is shipped in a file called LICENSE along with this applications source code. +You may obtain copies of the Licence in any of the official languages at https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12. +""" + +__version__ = '0.0.1' diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..165dba8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,51 @@ +[build-system] +requires = ['setuptools', 'wheel'] +build-backend = 'setuptools.build_meta' + + +[project] +name = 'nftables_api' +description = 'RESTful HTTP API for nftables' +dynamic = ['license', 'readme', 'version'] +authors = [ + { name='Georg Pfuetzenreuter', email='georg+python@lysergic.dev' }, +] +classifiers = [ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)', + 'Programming Language :: Python :: 3', + '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 :: 3.12', + 'Topic :: Software Development', + 'Typing :: Typed', + 'Operating System :: POSIX :: Linux', +] +requires-python = '>=3.6' + +dependencies = [ + 'PyYAML', +# 'nftables', # cannot by managed by pip +] + +[project.optional-dependencies] +dev = [ + 'pytest', + 'ruff', +] + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.dynamic] +version = {attr = 'nftables_api.__version__'} +readme = {file = ['README.md']} + +[tool.setuptools.packages.find] +where = ['.'] +exclude = ['scripts.*', 'tests', 'tests.*', 'ruff.toml'] diff --git a/ruff.toml b/ruff.toml index 8c6f8a1..b6b6cf4 100644 --- a/ruff.toml +++ b/ruff.toml @@ -37,6 +37,7 @@ preview = true explicit-preview-rules = true [lint.per-file-ignores] +"nftables_api/__init__.py" = ["PLC0414"] # allow explicit re-exports / avoid conflict with F401 "tests/*.py" = [ "INP001", # tests do not need to be part of a package "S101", # allow "assert" in test suites diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..8d66965 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,21 @@ +[metadata] +name = nftables_api +version = attr: nftables_api.__version__ +author = Georg Pfuetzenreuter +author_email = georg+python@lysergic.dev +description = RESTful HTTP API for nftables +license = EUPL-1.2 +long_description = file: README.md, LICENSE + +[options] +package_dir= + =. +packages=find: +python_requires = >=3.6 + +[options.packages.find] +exclude= + scripts* + tests* + *.toml +where=.