Change from setup.py to pyproject.toml based project definition #495
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements the changes mentioned in closes #491.
I tried to change as little as possible while doing the major changes.
All the pipelines except the publish part of the publish pipeline have been run multiple time with the full array of supported versions (I did not change the supported python versions, I'll let you do that).
Use pyproject.toml to define as much of the project as possible
Dependencies
Centralize all the dependency specification under the pyproject.toml, this is in a couple of sections (relevant uv docs)[https://docs.astral.sh/uv/concepts/projects/dependencies/#managing-dependencies]
[project].dependencies(standard) this contains radish's main dependencies (equivalent torequirementsin setup.py)[project.optional-dependencies](standard) this contains radish's extras (equivalent toextra_requirementsin setup.py)group_name = [group_members,][dependency-groups](uv specific) Local dependencies for development.devis the main group that gets installed, it currently just includes all the other groups (installingdevinstalls,test,lint, anddocs)Tool configuration
Most tools now allow configuration to be stored in the pyproject.toml (ruff, setuptools, pytest, coverage), moved what was obvious into there.
For coverage it makes a pretty nice difference since the commands in the pipeline are (slightly) shorter and the .coverage file can be completely removed.
Remove duplication between setup.py, pyproject and init.py
Name, maintainers, version and so on are defined in a single spot.
init.py uses standard tooling to read its own version.
Usage
I have updated the Contributing.md file with hopefully enough information.
Publish
I migrated the old publish pipeline to build and publish with uv (as well as add a very simple smoke-test since).
One thing I didn't include is that you can use
uv versionto set the version before you build.So that creating a release will always release the right version. Steps then become something like: