.claude/skills/poetry-rye-dependency-management/SKILL.md
Python dependency management with Poetry and Rye -- lockfile-driven workflows, dependency groups, monorepo patterns, and migration paths. Covers pyproject.toml-centric packaging for projects not yet on uv.
npx skillsauth add oimiragieo/agent-studio poetry-rye-dependency-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Poetry and Rye are Python dependency managers that enforce lockfile-driven, deterministic builds. Both use pyproject.toml as the single configuration file. Poetry is the established standard (since 2018); Rye is a newer Astral tool that bridges to uv. For greenfield projects, consider modern-python skill (uv-native). This skill covers Poetry/Rye for existing codebases and teams already invested in these tools.
poetry.lock or requirements.lock) -- without it, builds are non-deterministic and CI/CD will resolve different versions than development.pip install in a Poetry/Rye-managed project -- it bypasses the resolver and creates ghost dependencies invisible to the lockfile.poetry add/rye add to add dependencies -- manual pyproject.toml edits without re-locking create stale lockfiles.| Anti-Pattern | Why It Fails | Correct Approach |
| ----------------------------------------------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Editing pyproject.toml deps without running poetry lock | Lockfile becomes stale; CI installs different versions than intended | Always run poetry lock or rye lock after any dependency change |
| Using poetry install without --no-root in CI | Installs the project in editable mode unnecessarily; slower CI builds | Use poetry install --no-root for library deps only, --only main for production |
| Committing .venv/ directory to version control | Bloats repo; virtualenvs are platform-specific and non-portable | Add .venv/ to .gitignore; recreate with poetry install or rye sync |
| Mixing pip and Poetry in the same project | Creates two dependency graphs; pip-installed packages invisible to Poetry | Use only poetry add/rye add for all dependency changes |
| Using * version constraints for all dependencies | No upper bound protection; major version bumps break silently | Use compatible release (^ in Poetry) or upper-bounded ranges |
# Initialize new project
poetry init --name my-project --python ">=3.12"
# Add dependencies by group
poetry add requests httpx
poetry add --group dev ruff pytest pytest-cov
poetry add --group docs sphinx
# Install all groups
poetry install
# Install production only
poetry install --only main
# Initialize new project
rye init my-project
cd my-project
# Add dependencies
rye add requests httpx
rye add --dev ruff pytest pytest-cov
# Sync (install) dependencies
rye sync
[tool.poetry]
name = "my-project"
version = "0.1.0"
description = "Project description"
authors = ["Team <[email protected]>"]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.12"
requests = "^2.31"
httpx = "^0.27"
[tool.poetry.group.dev.dependencies]
ruff = "^0.9"
pytest = "^8.0"
pytest-cov = "^6.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
run: pipx install poetry
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-$HASH_OF_LOCKFILE
- name: Install dependencies
run: poetry install --no-root
- name: Lint
run: poetry run ruff check .
- name: Test
run: poetry run pytest --cov
# Poetry: audit dependencies for known CVEs
poetry audit
# Rye: use pip-audit integration
rye run pip-audit
When ready to migrate from Poetry/Rye to uv:
# Export Poetry dependencies
poetry export -f requirements.txt --output requirements.txt
# Initialize uv project
uv init
uv add $(grep -v '^#' requirements.txt | grep -v '^\-' | cut -d'=' -f1)
# Verify
uv sync
uv run pytest
See modern-python skill for the complete uv workflow.
| Skill | Relationship |
| ---------------------------------------- | -------------------------------------------------------- |
| modern-python | uv-native workflow (recommended for greenfield projects) |
| python-backend-expert | Framework-specific patterns (Django, FastAPI, Flask) |
| tdd | Test-driven development methodology |
| comprehensive-unit-testing-with-pytest | Testing strategies and patterns |
Before starting:
Read .claude/context/memory/learnings.md for prior Python packaging decisions.
After completing: Record any migration issues, version constraints, or resolver conflicts to .claude/context/memory/learnings.md.
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
tools
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
tools
Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing network topologies. Applicable to social networks, biological networks, transportation systems, citation networks, and any domain involving pairwise relationships.
data-ai
Molecular featurization for ML (100+ featurizers). ECFP, MACCS, descriptors, pretrained models (ChemBERTa), convert SMILES to features, for QSAR and molecular ML.
development
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.