From a8bac35f936953a6ca39580a1e549f7f92ba76f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20No=C3=A9?= Date: Tue, 28 Jul 2026 21:13:05 +0200 Subject: [PATCH] Pin the build backend so sdist filenames stay PEP 625 compliant Building 0.17.0 produced 'python-dwca-reader-0.17.0.tar.gz', which PyPI rejects: sdist filenames must use the normalised name with underscores. setuptools started emitting that form in 69.3, but 'python setup.py sdist' uses whatever setuptools is first on PATH, which on this machine was an older one. Declaring the build backend makes the build resolve its own requirements in an isolated environment instead. Verified by building from a virtualenv pinned to setuptools 68.0.0: the artifact is still named correctly, because isolation honours the floor declared here. Package metadata stays in setup.py; this only pins how the build happens. Also sets long_description_content_type explicitly. README.rst is reStructuredText and that is already the default, so this changes nothing beyond silencing the warning twine emits on every upload. --- pyproject.toml | 14 ++++++++++++++ setup.py | 1 + 2 files changed, 15 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..780dfcb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +# Declaring the build backend makes builds reproducible: `python -m build` resolves these +# requirements in an isolated environment instead of using whatever setuptools happens to be +# first on PATH. +# +# The version floor is not arbitrary. setuptools 69.3 is where sdist filenames became +# PEP 625 normalised ("python_dwca_reader-X.Y.Z.tar.gz" rather than "python-dwca-reader-..."), +# and PyPI now rejects the old form outright. Building 0.17.0 with an older setuptools +# produced an sdist the upload refused. +# +# Package metadata deliberately stays in setup.py for now; this file only pins how the build +# happens, not what is built. +[build-system] +requires = ["setuptools>=69.3", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index c44a4b5..2c48558 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ license="BSD licence, see LICENCE.txt", description="A simple Python package to read Darwin Core Archive (DwC-A) files.", long_description=open("README.rst").read(), + long_description_content_type="text/x-rst", python_requires=">=3.8", classifiers=[ "Programming Language :: Python :: 3",