Skip to content

Move the package metadata to pyproject.toml - #70

Merged
stefankoegl merged 1 commit into
claude/vibrant-dijkstra-6s8trl-pypi-readmefrom
claude/vibrant-dijkstra-6s8trl-pyproject
Nov 11, 2026
Merged

stefankoegl merged 1 commit into
claude/vibrant-dijkstra-6s8trl-pypi-readmefrom
claude/vibrant-dijkstra-6s8trl-pyproject

Conversation

@stefankoegl

Copy link
Copy Markdown
Owner

Builds on #69. Both PRs change the package metadata, so this one uses #69's branch as its base and shows only its own diff. When #69 is merged and its branch is deleted, GitHub retargets this PR to master.

Changes

  • pyproject.toml (new): holds all metadata.

    • The version is still defined only in kdtree.py. setuptools reads it statically via attr, instead of setup.py parsing kdtree.py with regular expressions.
    • The readme is the long description, as in Use the readme as long description on PyPI #69.
    • The license is now the SPDX expression ISC (PEP 639), replacing the License :: OSI Approved :: ISC License (ISCL) classifier. setuptools deprecated that classifier and printed a warning box on every build. This needs setuptools ≥ 77 at build time, declared in [build-system].
    • Adds project URLs for the docs, repository and issues.
  • setup.py: only the build_py command that installs kdtree.pyi and kdtree-stubs/__init__.pyi remains. setuptools has no declarative way to do this for a single-file module.

  • setup.cfg: removed. The coverage settings moved to [tool.coverage.*] in pyproject.toml.

  • test_typing.py: no longer runs the deprecated setup.py build_py. It builds an sdist and a wheel with python -m build --no-isolation, as a release does, then checks:

    • the module and both stub copies are in the wheel
    • Version matches kdtree.__version__
    • License-Expression is ISC

    The CI typing job already installs build and setuptools.

Testing

  • Full suite passes, with 100% coverage. Coverage reads its config, including fail_under = 100, from pyproject.toml.
  • With the stub command disabled, the new packaging test fails.
  • python -m build builds without the license deprecation warning, and twine check passes.
  • I installed the wheel into a fresh venv and ran mypy --strict and pyright on typing_sample.py against it, as the CI typing job does: no issues. The installed metadata reports 0.17 and ISC.

Note

setuptools still warns standard file not found: should have one of README, ..., README.md because the file is called readme.md in lowercase. It is included and used anyway. Renaming it would silence the warning, but it would touch every PR that edits the readme, so I left it.


Generated by Claude Code

- pyproject.toml holds all metadata. The version is still defined only
  in kdtree.py and read statically by setuptools (attr), instead of
  setup.py parsing kdtree.py with regular expressions.
- The license is given as SPDX expression ("ISC", PEP 639) instead of
  the license classifier, which setuptools deprecates and warns about.
  This requires setuptools >= 77 at build time.
- Project URLs for the docs, repository and issues are added.
- setup.py only remains for the build_py command that installs the
  type stubs, which setuptools can't express declaratively.
- The coverage configuration moves from setup.cfg (removed) to
  pyproject.toml.
- test_typing.py no longer runs the deprecated "setup.py build_py". It
  builds an sdist and a wheel with "python -m build --no-isolation", as
  a release does, and checks the stubs, version and license in the
  wheel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pewzpiih3qbqQ1YhUbhbvk
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 100.0% — claude/vibrant-dijkstra-6s8trl-pyproject into claude/vibrant-dijkstra-6s8trl-pypi-readme. No base build found for claude/vibrant-dijkstra-6s8trl-pypi-readme.

@stefankoegl
stefankoegl merged commit 5ef566d into claude/vibrant-dijkstra-6s8trl-pypi-readme Nov 11, 2026
16 checks passed
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.

3 participants