Skip to content

feat: use uv for deps and builds#10

Merged
weiliddat merged 5 commits intomainfrom
migrate-uv-20260103
Jan 3, 2026
Merged

feat: use uv for deps and builds#10
weiliddat merged 5 commits intomainfrom
migrate-uv-20260103

Conversation

@weiliddat
Copy link
Owner

@weiliddat weiliddat commented Jan 3, 2026

Summary by CodeRabbit

  • Chores

    • Switched build and CI tooling to a unified UV-based workflow for installs and testing.
    • Updated project metadata with an explicit package version, description, Python requirement, and moved dev dependencies into the project manifest.
    • Removed the legacy dev requirements file.
    • Updated CI test invocation to run under the UV tool and refined coverage upload settings.
  • Refactor

    • Removed the module-level public version attribute and top-level module docstring.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 3, 2026

📝 Walkthrough

Walkthrough

CI and packaging moved from Flit/pip to UV: pyproject now uses uv_build with static version/description and dev deps in [dependency-groups]; requirements-dev.txt emptied; GitHub Actions replaced Python setup with astral-sh/setup-uv and runs tests via uv run pytest; __version__ removed from package init.

Changes

Cohort / File(s) Change Summary
Build system & metadata
pyproject.toml
Build backend changed from flit_coreuv_build; added static version = "0.8.0" and description; removed dynamic; set requires-python = ">=3.10"; dependencies = []; added [dependency-groups] dev group with pymongo, pytest, pytest-benchmark, pytest-cov.
Dev requirements file
requirements-dev.txt
All entries removed (file emptied); dev/test dependencies migrated into pyproject.toml.
CI workflow
.github/workflows/test.yaml
Replaced actions/setup-python with astral-sh/setup-uv; added Install uv step and runs uv sync --locked --dev (previously pip install); test step changed from pytestuv run pytest; Codecov upload now passes files: ./coverage.xml and token: ${{ secrets.CODECOV_TOKEN }}; push/pull_request triggers adjusted.
Package runtime
src/mgqpy/__init__.py
Removed module docstring and the exported __version__ variable (version now sourced from pyproject.toml).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I swapped my flit-forage for a shiny UV beam,
Hopped through CI gardens where the tests now gleam.
Version burrowed into pyproject’s den,
Emptyed old lists and sprinted tests again.
A rabbit’s shuffle — light, quick, and keen.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: use uv for deps and builds' directly and concisely describes the primary change in the pull request: migrating from Python-specific tooling to UV for dependency management and builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0305878 and 0f6cf80.

📒 Files selected for processing (2)
  • .github/workflows/test.yaml
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/test.yaml
  • pyproject.toml

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8e24be9) to head (0f6cf80).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #10   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          559       558    -1     
=========================================
- Hits           559       558    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/test.yaml (1)

18-22: Consider pinning the Python version explicitly.

While uv can infer the Python version from requires-python in pyproject.toml, explicitly setting it in the workflow can improve reproducibility and clarity. Consider adding a Python version specification before the uv installation step or using uv's --python flag.

Optional: Add explicit Python version
       - name: Checkout
         uses: actions/checkout@v4
 
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.10'
+
       - name: Install uv
         uses: astral-sh/setup-uv@v7
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e24be9 and 74854d9.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • .github/workflows/test.yaml
  • pyproject.toml
  • requirements-dev.txt
  • src/mgqpy/__init__.py
  • src/mgqpy/operators/all.py
  • src/mgqpy/operators/and_or_nor.py
  • src/mgqpy/operators/elem_match.py
  • src/mgqpy/operators/eq_ne_not.py
  • src/mgqpy/operators/gt.py
  • src/mgqpy/operators/gte.py
  • src/mgqpy/operators/in_nin.py
  • src/mgqpy/operators/lt.py
  • src/mgqpy/operators/lte.py
  • src/mgqpy/operators/mod.py
  • src/mgqpy/operators/regex.py
  • src/mgqpy/operators/size.py
  • src/mgqpy/utils.py
💤 Files with no reviewable changes (2)
  • src/mgqpy/init.py
  • requirements-dev.txt
🔇 Additional comments (4)
pyproject.toml (4)

7-8: Approved: Static version and description.

Moving the version and description from dynamic to static configuration is appropriate for the new build setup. This makes the package metadata more explicit and easier to manage.


28-34: Approved: Modern dependency groups configuration.

The [dependency-groups] section is the correct way to specify development dependencies with uv. The dependency versions look reasonable and align with the migration strategy.


13-14: No action needed. The empty dependencies list is correct by design.

mgqpy is a lightweight library that converts MongoDB-style queries to Python predicates, and does not require pymongo as a runtime dependency. It is designed to work independently of pymongo. The pymongo package is listed in the development dependencies for testing purposes only (to validate query behavior against actual MongoDB operations), not as a runtime requirement.

Likely an incorrect or invalid review comment.


2-3: No action needed. The uv_build backend is a valid PEP 517 build backend provided by Astral, officially declared stable as of July 2025. The configuration in pyproject.toml follows the official documentation and is appropriate for pure-Python projects. The version constraint uv_build>=0.9.21,<0.10.0 is suitable for stable releases.

Likely an incorrect or invalid review comment.

@weiliddat weiliddat merged commit 395be3f into main Jan 3, 2026
4 checks passed
@weiliddat weiliddat deleted the migrate-uv-20260103 branch January 3, 2026 12:55
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.

1 participant