core: Move to use UV as package manager (WIP)
Summary by Sourcery
Migrate core project to use UV as the package manager and restructure project dependencies
New Features:
- Add pyproject.toml configuration for core services and libraries
- Introduce UV package management configuration
Enhancements:
- Consolidate project dependencies across services
- Standardize Python version to 3.11+
Build:
- Add core-level pyproject.toml with workspace configuration
- Configure Python version and dependency sources
Chores:
- Remove existing setup.py files
- Standardize project structure with pyproject.toml
- Update dependency management
Reviewer's Guide
This pull request transitions the project to uv for Python package management. This was achieved by introducing pyproject.toml files for the workspace and individual packages (services/libraries), and standardizing on Python 3.11+. The Docker build process was updated to use uv for creating a virtual environment and installing dependencies from a uv.lock file. Legacy setup.py files and custom installation scripts were removed, and scripts for installing auxiliary Python tools were refactored for compatibility with the new uv-managed environment.
File-Level Changes
| Change | Details | Files |
|---|---|---|
Replaced setup.py files and custom installation scripts with uv and pyproject.toml for workspace-based package management. |
|
core/pyproject.tomlcore/uv.lockcore/.python-versioncore/libs/commonwealth/pyproject.tomlcore/libs/bridges/pyproject.tomlcore/services/ardupilot_manager/pyproject.tomlcore/services/versionchooser/pyproject.tomlcore/services/helper/pyproject.tomlcore/services/cable_guy/pyproject.tomlcore/services/kraken/pyproject.tomlcore/services/nmea_injector/pyproject.tomlcore/services/ping/pyproject.tomlcore/services/wifi/pyproject.tomlcore/services/bridget/pyproject.tomlcore/services/bag_of_holding/pyproject.tomlcore/services/commander/pyproject.tomlcore/services/beacon/pyproject.tomlcore/services/pardal/pyproject.tomlcore/services/log_zipper/pyproject.tomlcore/libs/bridges/setup.pycore/libs/commonwealth/setup.pycore/libs/install-libs.shcore/services/ardupilot_manager/setup.pycore/services/bag_of_holding/setup.pycore/services/beacon/setup.pycore/services/bridget/setup.pycore/services/cable_guy/setup.pycore/services/commander/setup.pycore/services/helper/setup.pycore/services/install-services.shcore/services/kraken/setup.pycore/services/log_zipper/setup.pycore/services/nmea_injector/setup.pycore/services/pardal/setup.pycore/services/ping/setup.pycore/services/versionchooser/setup.pycore/services/wifi/setup.py |
Updated the Docker build process to use uv for Python environment and dependency management. |
|
core/Dockerfile |
| Standardized the project to Python 3.11+. |
|
core/.python-versioncore/pyproject.tomlcore/libs/**/pyproject.tomlcore/services/**/pyproject.toml |
Refactored installation scripts for ArduPilot Python utilities to integrate with the new uv environment. |
|
core/tools/ardupilot_tools/bootstrap.shcore/tools/ardupilot_tools/setup-python-libs.shcore/tools/install-python-libs.shcore/Dockerfile |
Tips and commands
Interacting with Sourcery
-
Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
-
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. -
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. -
Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. -
Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. -
Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Nice, great work!
I just noticed two library upgrades, missing
licensefields in the poetry module declarations, and an extra space on the shebang lines.I've tested on a Pi5 going through all pages, checking both on the browser console and in the backend logs for any unusual behavior.
I've also run the pre-push hook locally, and it looks all good!
Thanks for the review. For information on this, as our license is not MIT, it was decided to remove the license field from each individual service and the shebang was mentioned on a previous conversation in more details. Library updates were needed for UV compatibility, I'll mention individually on each of the sub conversations.