chore: replace tox workflow with Makefile - #2690
Conversation
|
@tonyandrewmeyer This PR only adds the Makefile. If you'd prefer, I can remove the tox files in a follow-up commit. |
tonyandrewmeyer
left a comment
There was a problem hiding this comment.
Hi @PraaneshSelvaraj , thanks for this!
We definitely need to remove tox in the same PR, or they'll just drift, and we don't want two systems, just to move to make. That means removing tox, but also updating the workflows, documentation, and so on.
It's also important that what each command does stays the same, and that the same set of commands is provided, unless there are specific reasons, called out in the PR body, which that is not the case.
Please use "refs" not "closes" in the PR as there is still the follow-up work in the profiles and then example charms after this step.
Lastly, please do make sure you have tested things first.
| uv run --group lint --group unit pyright $(ARGS) | ||
|
|
||
| pebble: # Run real Pebble tests | ||
| umask 0; pebble run --http=':4000' --create-dirs >/dev/null 2>&1 & sleep 1 |
There was a problem hiding this comment.
The Pebble daemon starts without PEBBLE=/tmp/pebble; only the pytest line on 78 sets it. This means the two pebble will be using different folders.
This also means all the pebble tests fail. Please make sure you have tested the commands locally, other than the ones for releasing (for smoke and integration you can do this in a VM, like Multipass).
Also, the CI needs to change to usemake, which would also exercise this.
| PEBBLE=/tmp/pebble RUN_REAL_PEBBLE_TESTS=1 \ | ||
| uv run --group unit \ | ||
| pytest -v --tb native test/test_real_pebble.py $(ARGS) | ||
| killall -y 3m pebble |
There was a problem hiding this comment.
The kill is skipped when the pytest line fails, since Make aborts the recipe. We need to keep the behaviour where it's always stopped, or there's a dangling pebble left running.
| draft-release: # Create a draft GitHub release | ||
| uv run --group release python release.py $(ARGS) | ||
|
|
||
| fix: # Auto-fix lint issues |
There was a problem hiding this comment.
Let's keep this PR as a move, not add new commands.
| uv run --group lint ruff check --preview --fix | ||
| uv run --group lint ruff format --preview | ||
|
|
||
| format: # Format the Python code |
There was a problem hiding this comment.
This should also have the check fix, like in tox.
| -v --tb native \ | ||
| -W "ignore:Harness is deprecated:PendingDeprecationWarning" \ | ||
| $(ARGS) | ||
| mv tracing/.coverage .coverage-tracing |
There was a problem hiding this comment.
This has dropped the report step.
|
@PraaneshSelvaraj are you planning to continue work on this? Please let us know in the next day or two if so, otherwise we'll close this and let someone else pick it up. |
@tonyandrewmeyer Yes, I’m planning to continue with this. |
Replace the repository's
tox/tox-uvdeveloper workflow with a top-levelMakefilethat runs commands throughuv, following the same pattern used inhyrumandjubilant.Closes #2479.
What changed
Makefileas the primary developer entry point.toxcommand wrappers with equivalentuv runinvocations while preserving the underlying commands.help,all,format,fix,lint,unit,coverage,benchmark,integration,smoke,pebble,draft-release, andpost-release.docstarget that delegates to the existing Sphinx documentation build.ARGSforwarding so pytest filters and paths work naturally (e.g.make unit ARGS="-k test_name").Notes