Skip to content

chore(packaging): move package metadata to pyproject.toml - #467

Merged
ekalinin merged 1 commit into
masterfrom
chore/pyproject-metadata
Nov 1, 2026
Merged

ekalinin merged 1 commit into
masterfrom
chore/pyproject-metadata

Conversation

@ekalinin

@ekalinin ekalinin commented Nov 1, 2026

Copy link
Copy Markdown
Owner

See CONTRIBUTING.md for the rules behind this checklist.

#374 asks to finish the PEP 517 move and drop setup.py. #338 added the
[build-system] table, but the metadata stayed in setup.py, and the
release was still built by calling setup.py sdist bdist_wheel directly.
That made the sdist depend on the checkout: env-dev has no setuptools-scm,
so setup.py sdist took its file list from the
nodeenv.egg-info/SOURCES.txt left by pip install -e .. Without that
file the 1.12.0 sdist would have had 35 entries instead of 56, and no
tests/__init__.py, tests/nodeenv_test.py or tests/nodejs_index.json.

The metadata now lives in [project] in pyproject.toml, and setup.py
is removed. The backend is still setuptools.build_meta:

  • The version is still nodeenv_version in nodeenv.py, read with
    attr, so make deploy-github is unchanged. setuptools-scm stays for
    the sdist file list and does not touch the version, also on a commit
    after the tag.
  • The long description is still README.rst followed by CHANGES, now
    declared as text/x-rst, so twine check no longer warns about
    long_description_content_type.
  • The license is the SPDX expression BSD-3-Clause (PEP 639), which needs
    setuptools>=77. setuptools refuses a License :: classifier next to
    it, so the classifier is gone.
  • make deploy-pypi builds with python -m build, make env uses
    pip install ., and make update-pypi is removed, since PyPI turned
    register off long ago.
  • debian-upstream/rules builds the sdist with python -m build --sdist
    and unpacks dist/*.tar.gz. The Debian package itself still targets
    Python 2.7; that is left for a separate change.
  • flake8 no longer gets setup.py in tox, CI and CONTRIBUTING.md.

Compared with a build of master, the wheel has the same files,
dependencies, extras, Requires-Python and entry point. METADATA differs
only in the fields [project] writes differently: Project-URL: Homepage
instead of Home-page, a single Author-email, License-Expression
instead of License, Description-Content-Type, and no Platform or
Dynamic lines. The sdist has the same files except setup.py and
nodeenv.egg-info/not-zip-safe, with or without a leftover
nodeenv.egg-info/, and the unit tests pass from it.

Fixes #374

  • Tests cover the change (no code change; the builds above check the
    package)
  • tox passes: the tests and flake8
  • CHANGES has an entry under Version [unreleased], if nodeenv's
    behavior changes
  • README.rst is updated, if the change affects what it documents
  • The title has the form type(scope): subject

The metadata now lives in the [project] table of pyproject.toml and
setup.py is removed. The version is still read from nodeenv_version in
nodeenv.py, and the long description is still README.rst followed by
CHANGES, now declared as text/x-rst. The license is declared as the SPDX
expression BSD-3-Clause, which needs setuptools 77 or later.

make deploy-pypi builds with python -m build, so the sdist no longer
depends on a leftover nodeenv.egg-info/SOURCES.txt in the checkout.

Fixes #374

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Debian sdist command fails in a clean build environment because the build frontend is not declared as a Debian build dependency and the legacy /usr/bin/python interpreter cannot run the new setuptools backend.

1 open issue
What changed in this PR

This PR completes the PEP 517 packaging migration requested in #374 by moving metadata into pyproject.toml and removing setup.py, while retaining the setuptools backend.

Changes:

  • Declares project metadata, extras, entry point, dynamic version and readme, and an SPDX license in pyproject.toml.
  • Switches build and installation commands to standards-based frontends.
  • Removes obsolete setup.py references from tooling and documents the migration.
File Description
tox.ini Removes setup.py from lint targets.
setup.py Deletes the legacy packaging script.
requirements-dev.txt Adds the build frontend.
pyproject.toml Defines package metadata and requires setuptools 77 or later.
Makefile Uses modern build/install commands and removes PyPI registration.
debian-upstream/​rules Switches sdist creation to build and extracts gzip archives.
CONTRIBUTING.md Updates the documented lint command.
CHANGES Records the packaging migration and backend requirement.
.github/​workflows/​tests.yml Removes setup.py from CI lint targets.
.coveragerc Removes the obsolete coverage exclusion.

Review effort: Balanced

Comment thread debian-upstream/rules

build-arch:
/usr/bin/python setup.py sdist --formats tar
/usr/bin/python -m build --sdist

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Debian packaging is broken before this PR, at the build-dependency
check: neither python from Build-Depends nor python2.7-minimal from
Pre-Depends exists in Debian 12 or 13, so dpkg-buildpackage stops
before rules runs (dpkg-checkbuilddeps on debian:12-slim and
debian:stable-slim reports python as unmet on master).

Moving only the sdist step to Python 3 would not give a package that
builds: DH_VENV_ARGS still creates the virtualenv with /usr/bin/python,
and the package still pre-depends on Python 2.7. This PR only replaces the
setup.py call, so that rules no longer refers to a removed file.
Moving the Debian packaging to Python 3 is out of scope here.

@ekalinin
ekalinin merged commit b5df2d5 into master Nov 1, 2026
49 checks passed
@ekalinin
ekalinin deleted the chore/pyproject-metadata branch November 1, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFE: finish adopting pep-0517

3 participants