Skip to main content
ClaudeWave
Skill422 repo starsupdated yesterday

python-env

# ClaudeWave Editor The python-env skill provides rapid virtual environment creation and package management using uv, a significantly faster alternative to pip. Use this skill when setting up Python projects, installing dependencies, managing multiple packages, or configuring development environments with pyproject.toml files. The skill includes commands for creating virtual environments, installing packages with version constraints, and troubleshooting common Python environment issues across Windows and Unix systems.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/aiskillstore/marketplace /tmp/python-env && cp -r /tmp/python-env/skills/0xdarkmatter/python-env ~/.claude/skills/python-env
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Python Environment

Fast Python environment management with uv. Prefer the uv **project** workflow
(`uv add` / `uv sync` / `uv run`) over the `uv pip` compatibility layer — it
manages `pyproject.toml` + a lockfile for you and is reproducible.

## Quick Commands

| Task | Command |
|------|---------|
| Start a project | `uv init <name>` (app) · `uv init --package <name>` (installable, `src/` layout) |
| Add dependency | `uv add httpx` |
| Add dev dependency | `uv add --dev pytest ruff` |
| Remove dependency | `uv remove httpx` |
| Sync env from lockfile | `uv sync` |
| Run in project env | `uv run pytest` |
| Update lockfile | `uv lock` |
| Install a CLI tool | `uv tool install ruff` · one-shot: `uvx ruff` |
| Install a Python | `uv python install 3.12` |

## Start a Project

```bash
# Application (flat layout, no package build)
uv init myapp

# Installable package (src/ layout — separate tests/ that import by name)
uv init --package wordtools
# → src/wordtools/__init__.py, pyproject.toml with build-system
```

`uv init` creates `pyproject.toml`, pins a Python version, and prepares the
project for `uv add` / `uv sync`. The `--package` (src) layout is preferred for
anything with a test suite or that you intend to ship.

## Manage Dependencies

```bash
# Add runtime deps (writes to [project.dependencies] + updates the lockfile)
uv add "httpx>=0.25" pydantic

# Add dev-only deps (writes to the dev dependency-group)
uv add --dev pytest ruff mypy

# Add with extras
uv add "fastapi[standard]"

# Remove
uv remove httpx

# Install everything from pyproject + uv.lock into .venv (reproducible)
uv sync

# Refresh the lockfile (e.g. after manual pyproject edits)
uv lock
```

`uv` creates and manages `.venv` automatically — you rarely activate it; just
prefix commands with `uv run`.

## Run Code

```bash
uv run python script.py     # run a script in the project env
uv run pytest               # run a tool from the dev group
uv run -- ruff check .      # `--` ends uv flag parsing
```

Never call bare `python` / `pytest` / `ruff` in a uv project — they may resolve
to a different interpreter. Always `uv run`.

## CLI Tools (global, not project deps)

```bash
uv tool install ruff        # persistent, isolated, on PATH
uv tool upgrade ruff
uvx ruff check .            # ephemeral one-shot run, nothing installed
```

Use `uv tool` / `uvx` for developer CLIs (ruff, pre-commit, httpie). Use
`uv add` only for things your code imports.

## Python Versions

```bash
uv python install 3.12      # download a managed interpreter
uv python list              # show available + installed
uv init --python 3.12 app   # pin a project to a version
```

Check python.org for the current stable (3.14 as of 2026-07; recent releases add
opt-in free-threading and a JIT). 3.11+ is a sensible floor for new projects
(TaskGroup, `Self`, faster interpreter).

## Minimal pyproject.toml

```toml
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
    "httpx>=0.25",
    "pydantic>=2.0",
]

# Dev deps live here; `uv add --dev <pkg>` manages this group.
[dependency-groups]
dev = [
    "pytest>=8.0",
    "ruff>=0.4",
    "mypy>=1.10",
]
```

## Compatibility Layer (`uv pip`) — last resort

`uv pip` mirrors pip's interface for environments uv doesn't manage (a hand-made
venv, a legacy `requirements.txt`, CI that isn't uv-native). It does **not**
update `pyproject.toml` or the lockfile — prefer `uv add` / `uv sync` whenever
you control the project.

```bash
uv venv                              # bare venv (no project)
uv pip install -r requirements.txt   # legacy requirements file
uv pip install -e .                  # editable install into an unmanaged venv
uv pip compile requirements.in -o requirements.txt   # pin a requirements.txt
```

## Troubleshooting

| Issue | Solution |
|-------|----------|
| "No Python found" | `uv python install 3.12` |
| Pin project Python | `uv init --python 3.12` or edit `requires-python` |
| Lock/resolve conflict | `uv lock --resolution=lowest-direct` to probe, then loosen bounds |
| Stale env after pull | `uv sync` |
| Cache issues | `uv cache clean` |

## When to Use

- **Always** use uv over pip — 10-100x faster
- `uv add` / `uv remove` / `uv sync` for project dependencies (not `uv pip install`)
- `uv run` to execute anything inside the project env
- `uv tool install` / `uvx` for standalone developer CLIs
- `uv pip` only for environments uv doesn't manage

## Additional Resources

For detailed patterns, load:
- `./references/pyproject-patterns.md` - Full pyproject.toml examples, tool configs
- `./references/dependency-management.md` - Lock files, workspaces, private packages
- `./references/publishing.md` - PyPI publishing, versioning, CI/CD

---

## See Also

This is a **foundation skill** with no prerequisites.

**Build on this skill:**
- `python-typing-ops` - Type hints for projects
- `python-pytest-ops` - Testing infrastructure
- `python-fastapi-ops` - Web API development
jira-safeSkill

Implement SAFe methodology in Jira. Use when creating Epics, Features, Stories with proper hierarchy, acceptance criteria, and parent-child linking.

jira-workflowSkill

Orchestrate Jira workflows end-to-end. Use when building stories with approvals, transitioning items through lifecycle states, or syncing task completion with Jira.

chinese-learning-assistantSkill

HSK4級レベルから流暢さを目指す学習者向け。中国語表現の使用場面・自然さを分析し、作文を「ネイティブらしい流暢な表現」に改善。bilibili等のコンテンツ理解とネイティブとの会話をサポート。実際の用例をWeb検索で提示

frontend-dev-guidelinesSkill

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

skill-developerSkill

Claude Code 스킬, 훅, 에이전트, 명령어를 생성하고 관리하기 위한 메타 스킬. 새 스킬 생성, 스킬 트리거 설정, 훅 설정, Claude Code 인프라 관리 시 사용.

sitemapkitSkill

Discover and extract sitemaps from any website using SitemapKit. Use this skill whenever the user wants to find pages on a website, get a list of URLs from a domain, audit a site's structure, crawl a sitemap, check what pages exist on a site, or do anything involving sitemaps or site URL discovery — even if they don't explicitly say "sitemap". Requires the sitemapkit MCP server configured with a valid SITEMAPKIT_API_KEY.

create-prSkill

GitHubのプルリクエスト(PR)を作成する際に使用します。変更のコミット、プッシュ、PR作成を含む完全なワークフローを日本語で実行します。「PRを作って」「プルリクエストを作成」「pull requestを作成」などのリクエストで自動的に起動します。

create-svg-from-promptSkill

Generate an SVG of a user-requested image or scene