-
Notifications
You must be signed in to change notification settings - Fork 27
Migrate dependency management to pyproject.toml with uv #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
matrixise
wants to merge
6
commits into
master
Choose a base branch
from
feature/migrate-to-uv-171
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update all documentation and scripts to use `uv` instead of `pip` for installing dependencies. This provides significant performance improvements and better dependency resolution. Changes: - Update CLAUDE.md local development setup instructions - Update README.md installation steps - Update DEVELOPMENT.md dependency installation - Update CONTRIBUTING.md setup instructions - Update vagrant/provision.sh to use uv - Add uv 0.9.18 to .tool-versions Note: Dockerfile and GitHub Actions workflows already use uv. Refs #171
…ect.toml Complete migration from pip-tools workflow to modern uv-based dependency management: - Replace requirements/main.in, dev.in, production.in with pyproject.toml - Use PEP 735 dependency-groups for dev and production dependencies - Generate uv.lock as universal lock file (102 packages) - Auto-generate requirements.txt for Heroku compatibility - Centralize tool configurations (ruff, coverage, isort) in pyproject.toml - Use Hatchling as build backend - Update all tooling (Taskfile, toast.yml, Dockerfile, CI/CD) - Update documentation (CLAUDE.md, README.md, DEVELOPMENT.md, CONTRIBUTING.md) New workflow: - `uv lock` - Update lock file - `uv sync` - Install dependencies - `task dependencies:export` - Generate requirements.txt Benefits: - Single source of truth (pyproject.toml) - Faster dependency resolution with uv - Modern Python packaging standards (PEP 621, PEP 735) - Simplified dependency management commands Fixes #171
The tests were failing because uv sync creates a virtual environment but the test command was using the system Python. Using 'uv run' ensures the tests run in the correct virtual environment with all dependencies installed.
Django 6.0 was inadvertently installed due to missing version constraints in pyproject.toml. This pins Django to 5.2.x series (latest: 5.2.9) and Wagtail to 7.2.x for compatibility. Changes: - pyproject.toml: Add Django>=5.2.0,<5.3 constraint - pyproject.toml: Add wagtail>=7.2.0,<7.3 constraint - uv.lock: Regenerated with Django 5.2.9 - requirements.txt: Regenerated with Django 5.2.9 - requirements-dev.txt: Regenerated with Django 5.2.9 All 33 tests pass with Django 5.2.9.
…ibility - Create requirements/main.txt with base dependencies (no dev, no production groups) - Create requirements/production.txt with production-specific dependencies (psycopg) - Update requirements.txt to reference both files (-r requirements/main.txt -r requirements/production.txt) This maintains Heroku compatibility while using the modern pyproject.toml + uv workflow. The requirements files are auto-generated from uv.lock using: - uv export --no-dev --no-group production -o requirements/main.txt - uv export --only-group production -o requirements/production.txt 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add README.md to COPY command (required by Hatchling build backend) - Add --no-install-project flag to uv sync to install only dependencies without installing the pythonie package itself at this stage This fixes the Docker build errors: - "OSError: Readme file does not exist: README.md" - "ValueError: Unable to determine which files to ship inside the wheel" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
567a21b to
7ff27a6
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Complete migration from the legacy pip-tools workflow using
requirements/*.infiles to a modern Python packaging approach usingpyproject.tomlwithuvfor dependency management.This migration consolidates all dependency declarations into a single source of truth (
pyproject.toml) following PEP 621 (project metadata) and PEP 735 (dependency groups) standards.Type of Change
Key Changes
Structure
requirements/main.in,requirements/dev.in,requirements/production.in→pyproject.tomluv.lockas universal lock file (102 packages resolved)requirements.txtfor Heroku deployment compatibilitypyproject.tomlNew Workflow
Files Modified
pyproject.toml- New single source of truthuv.lock- Universal lock fileTaskfile.yaml- Updated dependency management taskstoast.yml- Updated Docker-based dependency tasksDockerfile- Useuv syncinstead of pip install.github/workflows/test.yml- Updated CI to use uvCLAUDE.md,README.md,DEVELOPMENT.md,CONTRIBUTING.md- Updated documentationFiles Removed
requirements/main.in,requirements/dev.in,requirements/production.inrequirements/main.txt,requirements/dev.txt,requirements/production.txtrequirements/directory (now empty)pythonie/setup.py(replaced by pyproject.toml)Benefits
pyproject.tomlHow to Test
Local Setup
Docker Setup
Expected Results
Testing Performed
Checklist
Migration Impact
Developers
CI/CD
Deployment (Heroku)
References
Note: This is a significant infrastructure change, but maintains full backward compatibility for deployment while modernizing the development workflow.