Skip to content

Conversation

@hagenw
Copy link
Member

@hagenw hagenw commented Jul 31, 2025

Use uv to manage the package development.

Changes include:

  • Replacing tests/requirements.txt and docs/requirements.txt by a dev dependency group in pyproject.toml (which is automatically installed by uv)
  • Removing requirements.txt
  • Update CONTRIBUTING.rst to use uv run for testing and building docs
  • Use uv build instead of python -m build inside the Github Action to publish the package

Summary by Sourcery

Replace direct pip and Python commands with uv for dependency management, development tasks, and CI workflows.

Enhancements:

  • Consolidate test and documentation dependencies into a 'dev' group in pyproject.toml managed by uv
  • Remove standalone requirements.txt files in favor of uv sync

Build:

  • Use uv build instead of python -m build for wheel and source distribution creation

CI:

  • Add uv setup steps and replace pip install commands with uv sync across all GitHub Actions workflows
  • Replace direct command invocations with uv run for tasks like building, testing, and linting

Documentation:

  • Update CONTRIBUTING.rst to use uv run for testing and building documentation

Tests:

  • Use uv sync to install dependencies and uv run pytest in test workflows

Chores:

  • Delete requirements.txt, docs/requirements.txt, and tests/requirements.txt

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jul 31, 2025

Reviewer's Guide

This PR replaces the existing pip-based development setup with uv by consolidating requirements into a dev group in pyproject.toml, removing standalone requirements files, updating CONTRIBUTING instructions, and refactoring all CI workflows to install and invoke tasks via uv.

Class diagram for dependency management configuration changes

classDiagram
    class requirements_txt {
        - test dependencies
        - doc dependencies
    }
    class tests_requirements_txt {
        - test dependencies
    }
    class docs_requirements_txt {
        - doc dependencies
    }
    class pyproject_toml {
        + dependency-groups: dev
    }
    requirements_txt <.. pyproject_toml : migrated
    tests_requirements_txt <.. pyproject_toml : migrated
    docs_requirements_txt <.. pyproject_toml : migrated
    requirements_txt : removed
    tests_requirements_txt : removed
    docs_requirements_txt : removed
    pyproject_toml : dev group added
    pyproject_toml : manages all dev dependencies
Loading

File-Level Changes

Change Details Files
Migrate dependency management to uv
  • Delete requirements.txt, docs/requirements.txt, and tests/requirements.txt
  • Add a [dependency-groups.dev] section in pyproject.toml listing test and doc dependencies
pyproject.toml
requirements.txt
docs/requirements.txt
tests/requirements.txt
Refactor CI workflows to use uv
  • Insert astral-sh/setup-uv@v4 steps to initialize uv
  • Replace pip install blocks with uv sync
  • Swap python build commands for uv build variants
  • Use uv run sphinx-build for documentation
  • Invoke pre-commit via uvx instead of pip
.github/workflows/publish.yml
.github/workflows/doc.yml
.github/workflows/test.yml
.github/workflows/linter.yml
Update contributing guide for uv usage
  • Replace instructions to run tests and build docs with uv run commands in CONTRIBUTING.rst
CONTRIBUTING.rst

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on 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 issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on 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 dismiss on 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 review to 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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @hagenw - I've reviewed your changes - here's some feedback:

  • You need to add pre-commit to your dev dependency group in pyproject.toml so that uvx pre-commit commands actually work.
  • Consider specifying which dependency groups to sync in your CI (e.g. uv sync --group dev) to avoid installing unnecessary deps in production or publish workflows.
  • You might speed up your CI by caching the virtualenv or pip cache between runs instead of re-syncing all dependencies every job.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You need to add pre-commit to your dev dependency group in pyproject.toml so that `uvx pre-commit` commands actually work.
- Consider specifying which dependency groups to sync in your CI (e.g. `uv sync --group dev`) to avoid installing unnecessary deps in production or publish workflows.
- You might speed up your CI by caching the virtualenv or pip cache between runs instead of re-syncing all dependencies every job.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@hagenw hagenw merged commit 6058383 into main Jul 31, 2025
19 checks passed
@hagenw hagenw deleted the uv branch July 31, 2025 08:45
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.

2 participants