Skip to content

Switch to uv#1

Merged
mdavidbennett merged 8 commits into
linode:mainfrom
mdavidbennett:switch-to-uv
Jun 11, 2026
Merged

Switch to uv#1
mdavidbennett merged 8 commits into
linode:mainfrom
mdavidbennett:switch-to-uv

Conversation

@mdavidbennett

@mdavidbennett mdavidbennett commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Switch to UV for project management.
Switch to ruff for linting and style checks and applied the changes introduced with this.
Consolidate tox and linter config to pyproject.toml.
Bump all python deps and tooling deps.
Update docs with changes.
Drop python 3.9.
Small update to tests due to some changes in click.
Capped python compatibility to 3.13 since I ran into some failing tests with the free-thread build of 3.14. Will tackle that in a follow up PR.

Switch to uv for project management.
Switch the build system to hatchling.
Switch tox to using uv and moved its config into pyproject.toml.
Split up deps into areas of concern.
@mdavidbennett
mdavidbennett force-pushed the switch-to-uv branch 6 times, most recently from d87362c to 8710731 Compare June 3, 2026 16:39
@mdavidbennett
mdavidbennett marked this pull request as ready for review June 3, 2026 16:45
@mdavidbennett
mdavidbennett requested a review from Copilot June 4, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown

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 migrates the project to uv-based dependency management and consolidates tooling configuration into pyproject.toml, while modernizing the codebase for Python >=3.10 and switching linting/formatting to Ruff. It also updates CI workflows and developer documentation to match the new workflow.

Changes:

  • Migrate packaging/build config to Hatch (hatchling + hatch-vcs) and remove legacy setup.py/tox.ini/.flake8.
  • Adopt Ruff (via pre-commit) and apply Python 3.10+ typing/modernization changes across the codebase.
  • Rework GitHub Actions to run tox via uv, and update docs to reflect the new developer workflow.

Reviewed changes

Copilot reviewed 38 out of 40 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tox.ini Removed legacy tox configuration (migrated into pyproject.toml).
setup.py Removed legacy setuptools shim (migrated to Hatch).
pyproject.toml Centralizes build metadata, dependency groups, ruff/mypy/pytest/coverage/tox config.
.flake8 Removed flake8 config (superseded by Ruff).
.pre-commit-config.yaml Switches hooks from black/isort/flake8 to Ruff + updates pinned revisions.
.vscode/settings.json Updates Python formatter to Ruff.
.gitignore Adds common caches and uv/ruff venv/cache paths.
.github/workflows/tox.yml Removes old tox workflow.
.github/workflows/tests.yml Adds new tox-via-uv test workflow matrix.
.github/workflows/pre-commit.yml Adds CI job to run style checks via tox/pre-commit using uv.
.github/workflows/build-docs.yml Updates docs build workflow to use uv+tox and newer action pins.
.github/workflows/deploy-docs.yml Pins deploy-pages action to a specific revision.
docs/source/index.md Adds new development docs page to the docs TOC.
docs/source/development/testing.md Updates test/style instructions to use uv run tox / uv run pre-commit.
docs/source/development/getting_started.md Updates dev setup instructions for uv workflow and project layout.
docs/source/development/docs.md Adds instructions for building docs via tox (uv).
docs/source/_ext/linkcode_res.py Simplifies linespec construction.
docs/Makefile Removed Make-based docs build entrypoint.
docs/make.bat Removed Windows batch docs build entrypoint.
tests/test_shell.py Updates CLI invocation expectation due to click behavior change.
tests/test_controllers.py Makes property access explicit to satisfy newer linters.
tests/stores/test_vault.py Reformats long assertion for style/formatter compliance.
tests/stores/test_local.py Aligns error type expectations with code’s OSError handling.
tests/state_managers/test_local.py Updates mocked open() expectations and error types to match implementation.
src/certwrangler/utils.py Updates typing to modern unions and simplifies open() usage.
src/certwrangler/types.py Moves to stdlib typing.Annotated and modern type syntax.
src/certwrangler/stores/vault.py Modernizes typing (PEP 604 / builtins generics) and open() usage.
src/certwrangler/stores/local.py Simplifies exception handling and modernizes typing / open() usage.
src/certwrangler/state_managers/local.py Refactors helpers, modernizes typing, simplifies open() usage.
src/certwrangler/state_managers/dummy.py Modernizes typing in the dummy state manager API.
src/certwrangler/solvers/lexicon.py Modernizes typing for provider options/config builder.
src/certwrangler/solvers/edgedns.py Modernizes typing for HTTP helpers and payload/response shapes.
src/certwrangler/shell.py Modernizes typing for click callbacks and arguments; improves exception chaining.
src/certwrangler/schema_migrations.py Uses collections.abc.Callable and modern generic syntax.
src/certwrangler/models.py Modernizes typing broadly; adds exception chaining for clearer tracebacks.
src/certwrangler/metrics.py Modernizes typing and simplifies dict iteration patterns.
src/certwrangler/dns.py Simplifies TXT/CNAME checks and removes now-unneeded helper/type import.
src/certwrangler/daemon.py Modernizes typing for thread init and signal handlers.
src/certwrangler/controllers.py Modernizes typing and simplifies tuple construction; updates optional/union syntax.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/certwrangler/daemon.py Outdated
Comment thread .github/workflows/tests.yml
Comment thread docs/source/development/docs.md Outdated
Comment thread docs/source/development/getting_started.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Bump starlette to v1.0.1 for CVE-2026-48710
Bump click to 8.2 and update tests for change in exit code when running
without args.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 35 changed files in this pull request and generated 3 comments.

Comment thread tests/test_shell.py
Comment on lines 15 to +17
outcome = CliRunner().invoke(cli)
assert outcome.exit_code == 0
# Running without args exits 2 after click 8.2
assert outcome.exit_code == 2
Comment thread pyproject.toml
"F", # pyflakes
"I", # isort
"SIM", # flake8-simplify
# TODO: enable after dropping python 3.9 in a new PR.

## Bumping Dependencies

Github actions, pre-commit, and uv dependencies can be bumped by running the following:

@jfrederi-akamai jfrederi-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks for all the work on this 🙂

@mdavidbennett
mdavidbennett merged commit ecc40c7 into linode:main Jun 11, 2026
9 checks passed
@mdavidbennett
mdavidbennett deleted the switch-to-uv branch June 11, 2026 14:46
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.

3 participants