Skip to content

chore: migrate dependency management to uv#507

Open
rpocase wants to merge 3 commits into
canonical:mainfrom
rpocase:20260626-migrate-deps-to-pyproject
Open

chore: migrate dependency management to uv#507
rpocase wants to merge 3 commits into
canonical:mainfrom
rpocase:20260626-migrate-deps-to-pyproject

Conversation

@rpocase

@rpocase rpocase commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

PR Checklist

To ease the process of reviewing your PR, do make sure to complete the following checklist before submitting a pull
request.

  • I have added unit tests to cover the new behavior under ``tests/unit_tests/```
  • I have run tox -e format locally to automatically format my code before submitting
  • I have run tox locally ensuring that it passes before submitting
  • [-] (if applicable) I have added a reference to issues that this PR relates to in the PR message (Refs GH-1234, Fixes GH-1234)
  • My commits are atomic and follow the convetional commit message format (https://www.conventionalcommits.org/en/v1.0.0/)

Otherwise, please leave the PR as a draft to indicate that it is still a work in progress.

Description

this change migrates dependencies to be properly managed by uv instead of specified in requirements files,
upgrades mypy, and fixes newly found type hinting issues. this is in preparation for upgrading
openstack-sdk as netiface is orphaned and should be migrated to netiface2

Additional Context and Relevant Issues

this was triggered in part because running mypy was failing because of a missing typed-ast package.
at the same time, i've upgraded mypy and resolved all new type hinting issues.

Test Steps

N/A? i think integration tests should be run, but i don't have a proper setup to facilitate this

@rpocase rpocase requested a review from Copilot June 26, 2026 15:17
@rpocase rpocase force-pushed the 20260626-migrate-deps-to-pyproject branch from 4b68ff4 to 6850dfe Compare June 26, 2026 15:22
@rpocase rpocase changed the title chore: migrate to UV chore: migrate dependency management to uv Jun 26, 2026

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

Migrates the project from legacy requirements/setup.cfg packaging to a pyproject.toml-driven build (Hatchling) and dependency management aligned with uv, while updating type hints/signatures to satisfy a newer mypy.

Changes:

  • Replaced setup.py/setup.cfg + requirements*.txt with PEP 621 metadata and extras in pyproject.toml (Hatchling backend).
  • Updated tox, Read the Docs config, and a CI workflow step to install dependencies via extras/uv instead of requirements files.
  • Adjusted several cloud/instance method signatures to accept **kwargs and tightened example type annotations for mypy.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tox.ini Switches tox deps to install via project extras rather than requirements files; updates lint/typecheck targets.
test-requirements.txt Removes legacy test requirements list (moved into pyproject.toml extras).
setup.py Removes legacy setuptools entry point.
setup.cfg Removes legacy package metadata and dependency declarations.
requirements.txt Removes legacy “-e .” requirements indirection.
pyproject.toml Adds PEP 621 project metadata, dependencies, optional extras, and tool configs; switches build backend to Hatchling.
pycloudlib/openstack/instance.py Updates method signature to accept **kwargs for interface compatibility.
pycloudlib/oci/cloud.py Adds **kwargs to selected APIs for signature compatibility.
pycloudlib/lxd/instance.py Adds **kwargs to lifecycle methods; threads get_pty through _run_command.
pycloudlib/lxd/cloud.py Adds **kwargs to snapshot signature for interface compatibility.
pycloudlib/gce/instance.py Adds **kwargs to wait_for_delete signature for interface compatibility.
pycloudlib/ec2/cloud.py Adds **kwargs to snapshot signature for interface compatibility.
examples/oracle/oracle-cluster-demo.py Uses Optional[str] for nullable parameters to satisfy mypy.
examples/ibm_classic.py Uses Optional[str] for nullable parameters to satisfy mypy.
docs/requirements.txt Removes legacy docs requirements list (moved into pyproject.toml extras).
ci-requirements.txt Removes legacy CI requirements list.
.readthedocs.yaml Switches RTD install method to uv and uses the docs extra.
.github/workflows/version_check.yaml Installs uv and uses it to install packaging for version checking.

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

Comment thread pyproject.toml
Comment thread tox.ini
Comment thread .readthedocs.yaml
@rpocase rpocase force-pushed the 20260626-migrate-deps-to-pyproject branch 3 times, most recently from 5eaab84 to cef1487 Compare June 26, 2026 15:57
@rpocase

rpocase commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

@blackboxsw if you have a moment

@rpocase rpocase mentioned this pull request Jun 26, 2026
4 tasks
@rpocase rpocase enabled auto-merge (rebase) June 26, 2026 16:34

@holmanb holmanb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why uv rather than pip?

@rpocase rpocase disabled auto-merge June 26, 2026 17:29
rpocase added 3 commits June 26, 2026 12:58
the current setup is unexpected given the test runner is using uv.
this migrates the setup to uv. mypy and some typed dependencies
needed to be upgrade due to messaging around "typed-ast" not
being installed with seemingly no workaround.
- Add [tool.uv] python-preference = "only-system" to pyproject.toml
  so uv never downloads a managed Python and always uses the system
  interpreter
- Add tox-uv to tox requires so tox uses uv as its venv/install backend
- Replace apt tox installs with astral-sh/setup-uv in all workflows
- Collapse separate py310/py312 CI jobs into a single matrix job that
  selects the Ubuntu runner (22.04/24.04) based on the target Python
  version, making the Python→runner mapping explicit and easy to extend
- Simplify version_check workflow: drop actions/setup-python and pip
  installs in favour of uv run --with packaging
migrating to mypy 2.x resulted in a larger amount of type
failures being detected. this resolves all outstanding type hinting
failures
@rpocase rpocase force-pushed the 20260626-migrate-deps-to-pyproject branch from cef1487 to 5260eb3 Compare June 26, 2026 17:58
@rpocase

rpocase commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

Why uv rather than pip?

  1. i misread the repo and thought it was using uv to manage installation but wasn't using pyproject.toml for dependency management
  2. more modern tooling that is become increasingly pervasive
  3. we should look at integrating AGENTS.md and providing a sandboxing environment. i would go with workshops. the only supported path forward to easily bootstrap is with the uv plugin. it would have to be a lot more customized if we stuck with pip

@rpocase rpocase requested a review from blackboxsw June 26, 2026 21:42
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