MacHu-GWU/sqlalchemy_upsert_kit-project / .claude/skills/pywf-oss-base
pywf-oss-base
FlaggedShared conventions, references, and scripts of the pywf-oss skills for pywf open-source Python libraries: setup, layout, code style, tests, user docs and the agent skills that hold API and maintenance knowledge, CI and hosting, release, dependencies, and secrets. Load it before ad-hoc work on modules, tests, or docs in such a repo, for a question about these conventions, or when unsure which pywf-oss skill fits a job.
references/05-uv-dependencies.md
View on GitHub---
description: "Runtime dependencies and the dev, test, doc and mise extras in uv, the version constraint policy, the generated uv.lock and requirements*.txt, and running Python through .venv. Read when adding or removing a dependency, or writing a version constraint."
---
# uv and Dependencies
uv manages packages, and `.venv/` is the only environment. Never `pip install`. Run `.venv/bin/python` and `.venv/bin/pytest`.
---
## 1. Where dependencies are declared
All in `pyproject.toml`:
| Group | What goes in it |
| :--- | :--- |
| `dependencies` | Runtime dependencies of the library |
| extra `dev` | Local developer tools |
| extra `test` | `pytest`, `pytest-cov` |
| extra `doc` | Sphinx, the theme, the Sphinx extensions, and `ipykernel` (to execute the docs notebooks) |
| extra `mise` | Libraries used by the scripts in `.mise/tasks/` |
---
## 2. Constraint policy
| Kind | Form | Example |
| :--- | :--- | :--- |
| Normal dependency | `>=<tested floor>,<<next major>` | `"third_party_lib>=2.4.1,<3.0.0"` |
| Pre-1.0 package (a minor release may break) | `>=0.Y.Z,<1.0.0`, or `<0.(Y+1).0` when its minors do break | `"third_party_lib>=0.9.8,<1.0.0"` |
| Visual theme (any release changes the look) | exact pin | `"third_party_lib==2025.12.19"` |
| Needs a fix or a security patch | raise the floor to the fixed version | `"third_party_lib>=9.0.3"` |
- **The floor is a tested version,** normally the one in `uv.lock` after the last upgrade.
- **Every dependency, extras included, supports every Python in `requires-python`.** When a package's newest release drops a Python the repo still supports, cap below that release, and say why in the comment.
- Every line ends with a comment saying why the package is there: `"pytest>=9.1.1,<10.0.0", # Testing framework`.
---
## 3. Applying a change
1. Edit `pyproject.toml`.
2. `mise run inst` (`uv sync --all-extras`): updates `uv.lock` and `.venv`.
3. `mise run export`: regenerates `requirements*.txt` from `uv.lock`.
`uv.lock` and `requirements*.txt` are generated files. Never edit them by hand.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |