Change from setup.py to pyproject.toml based project definition#495
Open
alexandrehassan wants to merge 3 commits intoradish-bdd:mainfrom
Open
Change from setup.py to pyproject.toml based project definition#495alexandrehassan wants to merge 3 commits intoradish-bdd:mainfrom
alexandrehassan wants to merge 3 commits intoradish-bdd:mainfrom
Conversation
25532e2 to
c465186
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #495 +/- ##
==========================================
- Coverage 87.53% 87.52% -0.02%
==========================================
Files 38 38
Lines 2335 2332 -3
==========================================
- Hits 2044 2041 -3
Misses 291 291
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: