-
-
Notifications
You must be signed in to change notification settings - Fork 82
Enhance Python tooling infrastructure #439
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
Conversation
- Ruff now prefers standard 'project.requires-python' over 'ruff.target-version'
- fix type hint for internal `_media_type` function to account for `None` return
e38e37e to
2eb03e3
Compare
- include `pytest` in `dependency-groups` standard of `pyproject.toml` - test, build and publish via `uv` in workflow - remove install commands - eliminate `twine` dependency
6defef8 to
b2bd681
Compare
- Remove legacy setuptools CONTRIBUTING reference
- include pre-commit linting in tox configuration
6a1f469 to
5277022
Compare
Great to see you're picking this up!
I'm not sure what you mean by using tox in CI. I can help with updating the Makefile. Currently there are two commands to run the acceptance tests. Make executes these with each file from the How would I replicate this command with uv? Including any pre-requisitves like |
Co-authored-by: M.P. Korstanje <mpkorstanje@users.noreply.github.com>
There's a sweet spot to be worked out between
There's a number of different ways to run Without any virtual environment created, running the below within the Python directory will create one, install an editable installation of the package along with its dependencies (afterwards, activate the virtual environment and run uv run scripts/generate_tokens.pyYou can also run via the installed Python (installed via uv run python -m scripts.generate_tokensWithin the GitHub Actions workflow, the I'm not sure how tricky this or how this will interact with the top-level Just an fyi as well that the uv build backend deprecates a legacy artefact in the package builds - compared to the older version of |
6264cf7 to
1a996cf
Compare
Pinned |
- all commands now running through uv which manages dependencies with having to manage environments https://docs.astral.sh/uv/guides/scripts/
Integrated and working. Python acceptance test scripts now run without requiring to install the package and its dependencies; provided uv is installed. |
|
@mpkorstanje I've resolved the outstanding items I mentioned to integrate I've identified a constraint within the |
mpkorstanje
left a comment
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.
Cheers. Please flag this for review when everything is ready.
Bump uv to v0.8.4 which corrects permissions on build metadata files to remove write and executable permissions and provide read permissions astral-sh/uv#14920
8b8bde9 to
49d8c3a
Compare
|
@mpkorstanje ready for review with resolution of our observed issue now released with uv v0.8.4. |
|
Cheers! I'm short on time this week. But should get around to it on the next. |
|
@kieran-ryan this all looks soooo nice, thank you. |
|
@kieran-ryan I had a thought about the whole cc: @mpkorstanje |
|
@kieran-ryan , TIL the github ubuntu runners come with Ansible pre-installed that means that we could run an Ansible playbook right out the gate without waiting for apt to do anything, and Ansible is wicked fast because it's smart about running tasks in parallel. |
|
Hi, blaisep summoned me :p
As long as ara is installed alongside wherever ansible-core is installed (which seems to be globally via pipx?) it should work to record playbooks. The main question is how you make the reporting data available. By default it records to a local sqlite database and it's possible to generate a static html report (ara-manage generate) but then you need to find out where to host that and make it available. If you can host an instance of ara somewhere, you could send the data from a github action a bit like this: https://github.com/ansible-community/antsibull-build/pull/339/files For ara's own CI jobs we send them to our live demo with labels after commit SHAs and pull requests, for example: https://demo.recordsansible.org/?label=ref:refs/pull/610/head 👋 |
|
Thank you , I will study this carefully https://gist.github.com/blaisep/1d4b954ba282a11d511f0a708689aa0a |
|
I haven't gotten around to looking at this yet - just catching up on comments while on the train.
The most important aspect to optimize for is the human. So the workflow we should be looking for should is whatever is the most common denominator for a given language. No new skills required. No new tools required. Ideally someone familiar with And to deploy follows that up with: And then everything just works. Then to ensure that this workflow stays working we do the exact same thing in CI. Externalizing build tools breaks this guarantee. Which means that eventually the build breaks for the human too - silently. |
On closer inspection, I'm also not convinced that this line of reasoning is correct. While dev dependencies are not transient dependencies of the artifact produced by the build process, they are very much dependencies of the build process. But this is going somewhat off-topic. |
🤔 What's changed?
uvsetuptools,build,twine,pypa/gh-action-pypi-publish,actions/setup-pythondependency-groupsstandard (PEP-735)pyproject.toml(locked touv.lock) rather thanrequirements.txt,tox.iniandpyproject.tomlruff- and enabled CI checksruff,pyupgrade,flake8,flake8-bugbearandflake8-pyprojectrufftov0.12.5fromv0.8.6tool.ruff.target-versionconfiguration - withproject.requires-pythonstandard preferred (PEP-751).egg-infometadata from distribution⚡️ What's your motivation?
pytestwith non-editable installsuvprovides capabilities beyondpoetry- we can rollout across the organisation🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
toxwithin the GitHub workflows for parity between local development and the pipeline. Retained pipeline (withouttox) for now for preservation of cleanest workflow implementation that matches the assumed typical development run methods; though with an understanding to reassess in future, and asuvandtoxdevelop further in this area. For awareness.📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.