migrate-to-uv
Migrate Python projects from Poetry, pipx, or pip/requirements.txt to uv. Converts pyproject.toml from Poetry format to PEP 621 standard, handles dependency groups, scripts, extras, build backends, and generates uv.lock. Use when user asks to: (1) migrate/convert from Poetry to uv, (2) replace pipx with uv tool, (3) modernize Python project packaging, (4) convert requirements.txt to uv, (5) switch to uv, or mentions "poetry to uv" or "migrate to uv".
What this skill does
# Migrate to uv Convert Python projects from Poetry/pipx/pip to uv. ## Pre-Migration Assessment **IMPORTANT: Before starting any migration, assess the project for blockers.** Read `pyproject.toml`, `setup.py` (if present), and the build configuration to check for the following. Report findings to the user before proceeding. ### Check 1: C/C++/Rust Extensions Look for signs of compiled extensions: - `setup.py` with `ext_modules`, `cffi`, `cython`, or `Extension()` calls - Build dependencies like `setuptools`, `cffi`, `cython`, `pybind11`, `maturin`, `scikit-build-core` - `.c`, `.cpp`, `.pyx`, or `.rs` source files referenced in the build **If found:** `uv_build` does NOT support compiling C/C++/Rust extensions. The project must use a compatible build backend (`setuptools`, `scikit-build-core`, `maturin`, or `hatchling` with extension plugins). This is a non-trivial change — warn the user that the build backend swap may require significant effort and testing, especially for projects with complex `setup.py` logic. ### Check 2: Private Package Indexes Look for `[[tool.poetry.source]]` sections or references to private PyPI mirrors. **If found:** uv handles authentication differently from Poetry. Poetry uses `poetry config http-basic.<name> <user> <pass>`, while uv uses environment variables: - `UV_INDEX_<NAME>_USERNAME` / `UV_INDEX_<NAME>_PASSWORD` - Or `UV_INDEX_URL` with credentials embedded - Or keyring integration The migration tool won't convert auth config. The user needs to set up credentials separately for CI and local dev. See the "Private indexes" section below for format conversion. ### Check 3: Monorepo / Multiple pyproject.toml Files Look for multiple `pyproject.toml` files, path dependencies between packages, or Poetry monorepo plugins (`poetry-plugin-monorepo`, `monoranger`). **If found:** This is actually a good candidate for migration — uv workspaces handle monorepos much better than Poetry. But the migration is more involved than a single-package project. See the "Monorepo / Workspace Migration" section below. ### Check 4: Tox Configuration Look for `tox.ini` or `[tool.tox]` sections. **If found:** `tox` creates its own virtualenvs using pip by default. While tox can be configured to use uv, consider whether `uv run --python 3.X pytest` can replace tox environments entirely. This is a separate concern from the Poetry migration — tox can coexist with uv. ## Quick Start: Automated Migration For most Poetry projects, use the `migrate-to-uv` tool: ```bash uvx migrate-to-uv ``` **What it does:** - Parses `[tool.poetry]` sections and converts to PEP 621 `[project]` format - Converts Poetry version specifiers (`^`, `~`) to PEP 440 format (`>=`, `<`) - Moves `[tool.poetry.group.*.dependencies]` to `[dependency-groups]` - Converts `[tool.poetry.scripts]` to `[project.scripts]` - Converts `[tool.poetry.extras]` to `[project.optional-dependencies]` - Handles git/path/url dependencies → `[tool.uv.sources]` - Preserves exact versions from `poetry.lock` when generating `uv.lock` - Deletes `poetry.lock` after successful conversion **After running, verify and test:** ```bash rm -rf .venv uv sync uv run pytest ``` **Note:** The tool does NOT change the build backend. You may need to manually update `[build-system]` from `poetry-core` to `hatchling` (see step 6 below). ## Manual Migration Steps Use manual migration for complex projects or when automated tool fails. ### 1. Convert Metadata **Poetry → PEP 621:** ```toml # BEFORE: [tool.poetry] [tool.poetry] name = "myapp" version = "1.0.0" description = "My app" authors = ["John Doe <[email protected]>"] license = "MIT" readme = "README.md" # AFTER: [project] [project] name = "myapp" version = "1.0.0" description = "My app" authors = [{name = "John Doe", email = "[email protected]"}] license = {text = "MIT"} readme = "README.md" ``` ### 2. Convert Dependencies **Version specifier conversions:** - `^1.2.3` → `>=1.2.3,<2.0.0` (caret = compatible) - `~1.2.3` → `>=1.2.3,<1.3.0` (tilde = patch only) - `python = "^3.10"` → `requires-python = ">=3.10,<4.0"` ```toml # BEFORE [tool.poetry.dependencies] python = "^3.10" requests = "^2.26.0" pandas = {version = "^2.0", extras = ["excel"]} # AFTER [project] requires-python = ">=3.10,<4.0" dependencies = [ "requests>=2.26.0,<3.0.0", "pandas[excel]>=2.0,<3.0", ] ``` ### 3. Convert Dev Dependencies Poetry groups → `[dependency-groups]` (PEP 735): ```toml # BEFORE [tool.poetry.group.dev.dependencies] pytest = "^7.0" ruff = "^0.1.0" [tool.poetry.group.docs.dependencies] sphinx = "^7.0" # AFTER [dependency-groups] dev = [ "pytest>=7.0,<8.0", "ruff>=0.1.0,<1.0", ] docs = ["sphinx>=7.0,<8.0"] ``` ### 4. Convert Scripts ```toml # BEFORE [tool.poetry.scripts] myapp = "myapp.cli:main" # AFTER [project.scripts] myapp = "myapp.cli:main" ``` ### 5. Convert Extras (Optional Dependencies) ```toml # BEFORE [tool.poetry.dependencies] psycopg2 = {version = "^2.9", optional = true} [tool.poetry.extras] postgresql = ["psycopg2"] # AFTER [project.optional-dependencies] postgresql = ["psycopg2>=2.9,<3.0"] ``` ### 6. Set Build Backend Choose based on project type: ```toml # Option 1: hatchling (recommended for most projects) [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["src/myapp"] # if using src layout # Option 2: uv_build (fastest, pure Python only — NO C/C++/Rust extensions) [build-system] requires = ["uv_build>=0.6,<0.7"] build-backend = "uv_build" [tool.uv.build-backend] module-name = "myapp" # use a plain string, NOT a list — list syntax breaks on older uv module-root = "" # "" for flat layout, "src" for src layout # Option 3: setuptools (required for C extensions with ext_modules) [build-system] requires = ["setuptools>=61", "cffi"] # add extension build deps build-backend = "setuptools.build_meta" # Option 4: scikit-build-core (for CMake-based C++ extensions) [build-system] requires = ["scikit-build-core"] build-backend = "scikit_build_core.build" # Option 5: maturin (for Rust extensions via PyO3) [build-system] requires = ["maturin>=1.0,<2.0"] build-backend = "maturin" ``` **WARNING:** `uv_build` does NOT support compiling C/C++/Rust extensions. If the project has compiled extensions, you MUST use `setuptools`, `scikit-build-core`, or `maturin` as the build backend. **Do NOT use setuptools** with `license = {text = "MIT"}` — it has a known bug. Use `license = "MIT"` string form instead when using setuptools. ### 7. Convert Special Dependencies **Git dependencies:** ```toml # BEFORE [tool.poetry.dependencies] httpx = {git = "https://github.com/encode/httpx.git", tag = "0.27.0"} # AFTER [project] dependencies = ["httpx"] [tool.uv.sources] httpx = {git = "https://github.com/encode/httpx", tag = "0.27.0"} ``` **Path dependencies:** ```toml # BEFORE [tool.poetry.dependencies] mylib = {path = "../mylib", develop = true} # AFTER [project] dependencies = ["mylib"] [tool.uv.sources] mylib = {path = "../mylib", editable = true} ``` **Private indexes:** ```toml # BEFORE [[tool.poetry.source]] name = "private" url = "https://pypi.company.com/simple" # AFTER [[tool.uv.index]] name = "private" url = "https://pypi.company.com/simple" ``` **Private index authentication** (Poetry uses `poetry config http-basic`, uv uses env vars): ```bash # Option 1: Environment variables (recommended for CI) export UV_INDEX_PRIVATE_USERNAME="user" export UV_INDEX_PRIVATE_PASSWORD="token" # Option 2: Credentials in URL (use with caution) # [[tool.uv.index]] # url = "https://user:[email protected]/simple" # Option 3: keyring integration uv --keyring-provider subprocess ... ``` ### 8. Add uv Configuration ```toml [tool.uv] package = true # if this is an installable package ``` ### 9. Generate Lock and Test ```bash rm poetry.lock rm -rf .venv uv lock uv sync --all-extras --dev uv run pytest ``` ## Monorepo / Workspace Migration If the p
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.