Packaging

Add files for pyproject buliding, versioning and distribution.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2024-09-28 21:09:09 +02:00
parent a7e71bd0d1
commit 792149bae6
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57
6 changed files with 89 additions and 1 deletions

4
.gitignore vendored
View File

@ -1,2 +1,4 @@
venv
__pycache__
dist
nftables_api.egg-info
venv

View File

@ -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__

View File

@ -0,0 +1,11 @@
"""
A RESTful HTTP API for nftables
Copyright 2024, Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
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'

51
pyproject.toml Normal file
View File

@ -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']

View File

@ -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

21
setup.cfg Normal file
View File

@ -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=.