From 2e2c9323e27070840a5561391d67fc80582463eb Mon Sep 17 00:00:00 2001 From: Lukas Garberg Date: Wed, 14 Aug 2024 08:26:52 +0200 Subject: [PATCH] pynipap: Migrated to setuptools Migrated to a more modern build-chain. Includes some changes to the Debian packaging as well. --- pynipap/Makefile | 3 +-- pynipap/debian/compat | 1 - pynipap/debian/control | 12 ++++++++---- pynipap/pyproject.toml | 39 +++++++++++++++++++++++++++++++++++++++ pynipap/setup.py | 24 ++---------------------- 5 files changed, 50 insertions(+), 29 deletions(-) delete mode 100644 pynipap/debian/compat create mode 100644 pynipap/pyproject.toml diff --git a/pynipap/Makefile b/pynipap/Makefile index 5a936605f..3862c6fed 100644 --- a/pynipap/Makefile +++ b/pynipap/Makefile @@ -26,7 +26,7 @@ buildrpm: builddeb: # build the source package in the parent directory # then rename it to project_version.orig.tar.gz - $(PYTHON) setup.py sdist --dist-dir=../ + $(PYTHON) -m build --sdist --outdir ../ rename -f 's/$(PROJECT)-(\d.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../* # build the package debuild -us -uc @@ -40,7 +40,6 @@ upload: $(PYTHON) setup.py sdist upload clean: - $(PYTHON) setup.py clean rm -rf .pybuild/ MANIFEST dist/ debian/files debian/python-pynipap* \ debian/python3-pynipap* debian/$(PROJECT).substvars debian/.debhelper \ debian/debhelper-build-stamp diff --git a/pynipap/debian/compat b/pynipap/debian/compat deleted file mode 100644 index f599e28b8..000000000 --- a/pynipap/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pynipap/debian/control b/pynipap/debian/control index 565cdb4b0..cc42afe39 100644 --- a/pynipap/debian/control +++ b/pynipap/debian/control @@ -2,14 +2,18 @@ Source: pynipap Maintainer: Lukas Garberg Section: python Priority: optional -Build-Depends: debhelper (>= 10), dh-python, - python3 (>= 3.6) +Build-Depends: debhelper-compat (= 13), + dh-python, + python3-all, + python3-setuptools, + pybuild-plugin-pyproject X-Python3-Version: >= 3.6 -Standards-Version: 4.4.0 +Standards-Version: 4.6.1 +Homepage: https://spritelink.github.io/NIPAP/ Package: python3-pynipap Architecture: all -Depends: ${misc:Depends}, python3 (>= 3.6) +Depends: ${misc:Depends}, ${python3:Depends} Breaks: ${python3:Breaks} Description: Python 3 module for accessing NIPAP This package contains a client library for NIPAP. It's function is similar to diff --git a/pynipap/pyproject.toml b/pynipap/pyproject.toml new file mode 100644 index 000000000..f9ab31460 --- /dev/null +++ b/pynipap/pyproject.toml @@ -0,0 +1,39 @@ +[project] +name = "pynipap" +dynamic = ["version", "description"] +readme = "README.rst" +license = {text = "MIT"} +classifiers = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3' +] +keywords = ["nipap"] + +[project.optional-dependencies] +instrumentation = [ + "opentelemetry-api==1.29.0", + "opentelemetry-exporter-otlp==1.29.0", + "opentelemetry-exporter-otlp-proto-common==1.29.0", + "opentelemetry-exporter-otlp-proto-grpc==1.29.0", + "opentelemetry-exporter-otlp-proto-http==1.29.0", + "opentelemetry-proto==1.29.0", + "opentelemetry-sdk==1.29.0", + "opentelemetry-semantic-conventions==0.50b0", + "opentelemetry-util-http==0.50b0" +] + +[project.urls] +Homepage = "http://SpriteLink.github.io/NIPAP" + +[tool.setuptools.dynamic] +version = {attr = "pynipap.__version__"} + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + diff --git a/pynipap/setup.py b/pynipap/setup.py index 80240feab..90fb59758 100644 --- a/pynipap/setup.py +++ b/pynipap/setup.py @@ -1,31 +1,11 @@ #!/usr/bin/env python3 -from distutils.core import setup -import sys - -import pynipap +from setuptools import setup long_desc = open('README.rst').read() short_desc = long_desc.split('\n')[0].split(' - ')[1].strip() setup( - name = 'pynipap', - version = pynipap.__version__, description = short_desc, - long_description = long_desc, - author = pynipap.__author__, - author_email = pynipap.__author_email__, - license = pynipap.__license__, - url = pynipap.__url__, - packages = ['pynipap'], - keywords = ['nipap'], - classifiers = [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 3' - ] + long_description = long_desc )