-
Notifications
You must be signed in to change notification settings - Fork 20
project: migrate from setup.cfg to pyproject.toml #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
project: migrate from setup.cfg to pyproject.toml #270
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the project's packaging infrastructure by migrating from the legacy setup.cfg format to the standardized pyproject.toml format. It also streamlines the development workflow by eliminating custom scripts in favor of standard Python packaging tools.
Key changes:
- Consolidated all packaging metadata into
pyproject.tomland removedsetup.cfg - Replaced the custom
bin/stack-configscript with a proper[project.scripts]entry point - Introduced a
[dependency-groups]section for development dependencies and removed the customtest_stackinator.pytest runner
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Added complete project metadata including dependencies, scripts, and pytest configuration |
setup.cfg |
Removed legacy configuration file |
bin/stack-config |
Removed custom script wrapper in favor of setuptools entry point |
test_stackinator.py |
Removed custom test runner in favor of direct pytest usage |
.gitignore |
Added Python packaging artifacts to ignore list |
.github/workflows/main.yaml |
Updated CI workflow to use uv sync and pytest directly |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # TODO is it needed to cleanup site folder? | ||
| - run: rm -rf site |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-reminder: can it be removed or is it somehow cached across runs?
| # TODO is it needed to cleanup site folder? | |
| - run: rm -rf site |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it is cached ... I can't remember why it was added.
But it was probably added for a reason, and it doesn't hurt to rm -rf the path.
| run: uv publish | ||
| env: | ||
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the guide on how to install stack-config using pip a while back, because we don't tag releases very often. If somebody is using a pip-installed stackinator, they are almost certainly using an old version.
For better or worse, stackinator has a more relaxed "use the most recent commit in your release branch" model.
| - run: pip install --upgrade pip | ||
| - run: | | ||
| pip install -r requirements-docs.txt | ||
| python-version: 3.12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might become a github variable so that we share it across all workflows (if that's what we want)
| uses: astral-sh/setup-uv@v6 | ||
| - name: Install Dependencies | ||
| run: uv sync --group docs | ||
| # TODO is it needed to cleanup site folder? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question for reviewers
it was not possible to use uv run --script because we need to know where stackinator root is, to add it to the venv using --with
|
As discussed offline with @bcumming, I added back I added it back, in a slightly different configuration, so that the project has a single source of truth in In addition to that, this also means that the CI depending on this tool don't need any change, since it should still work as before (e.g. without having to do |
| # TODO is it needed to cleanup site folder? | ||
| - run: rm -rf site |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it is cached ... I can't remember why it was added.
But it was probably added for a reason, and it doesn't hurt to rm -rf the path.
| run: uv publish | ||
| env: | ||
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the guide on how to install stack-config using pip a while back, because we don't tag releases very often. If somebody is using a pip-installed stackinator, they are almost certainly using an old version.
For better or worse, stackinator has a more relaxed "use the most recent commit in your release branch" model.
DISCLAIMER: I'm not an expert, I'm just taking the chance to learn about packaging by working on this migration. If you feel like it is not something desired, feel free to discard this PR. I just started it because it felt like the right move to do but no-one had the time to do dedicate.
bin/stack-configin favour of[project.scripts]pyprojects.toml)devgroup of dependencies for developmenttest_stackinatorcustom scriptpytest, but we can add other stuff, e.g. static checking, ...docsgroup of dependenciesuvlicense-filereferencerequirements*.txtfiles (migrated to dependency-groups).gitignoreWith
uv tool install .you get it installed as an editable package and thestack-configcommand is available without doing anything (no manual PATH update required).TODO: