Skip to content

Conversation

@alexandrehassan
Copy link
Contributor

@alexandrehassan alexandrehassan commented Nov 14, 2025

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 to requirements in setup.py)
  • [project.optional-dependencies] (standard) this contains radish's extras (equivalent to extra_requirements in setup.py)
    • group_name = [group_members,]
  • [dependency-groups] (uv specific) Local dependencies for development.
    • dev is the main group that gets installed, it currently just includes all the other groups (installing dev installs, test, lint, and docs)
    • This allows for all them to be added at once, and for specific tasks to install only what's needed (e.g. don't need to install ruff to run the tests)
    • dependency specification docs
[project]
name = "radish_bdd"
dependencies = [
    "importlib_metadata>=6.0.0; python_version < '3.8'",
    # ...
]
[project.optional-dependencies]
bddxml = ["lxml>=5.3.0"]
# ...

[dependency-groups]
dev = [
    {include-group = "lint"},
    {include-group = "test"},
    {include-group = "docs"},
]
lint = [
    "ruff~=0.9.7",
]
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 version to set the version before you build.
So that creating a release will always release the right version. Steps then become something like:

uv version $CI_COMMIT_TAG
uv build
uv publish

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.52%. Comparing base (9d31a7d) to head (c465186).

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              
Flag Coverage Δ
unittests 87.52% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Modernize project configuration

1 participant