dev-swarm-python
Install and configure Python and uv. Use when setting up a Python environment.
When & Why to Use This Skill
The dev-swarm-python skill automates the installation and configuration of Python environments using uv, a high-performance Python package and project manager. It streamlines the development workflow by managing Python versions, initializing projects with virtual environments, and ensuring consistent dependency management, making it an essential tool for DevOps engineers and Python developers seeking a fast, reliable setup.
Use Cases
- Automated Environment Setup: Quickly install and configure the uv package manager and Python on macOS, Linux, or Windows systems with a single command.
- Project Initialization: Seamlessly initialize new Python projects with standardized structures, including virtual environments and pyproject.toml files.
- Version Management: Automatically manage and pin specific Python versions (e.g., Python 3.12) to ensure environment consistency across different development stages.
- Preference Persistence: Save and document user preferences for package management to automate and standardize future environment configurations.
| name | dev-swarm-python |
|---|---|
| description | Install and configure Python and uv. Use when setting up a Python environment. |
Python Environment Setup (uv)
This skill assists in installing and configuring the Python environment using uv for fast package and project management.
When to Use This Skill
- User needs to set up Python development environment
- User wants to install or configure uv package manager
- User asks to initialize Python project
Prerequisites
curl(macOS/Linux) or PowerShell (Windows).
Your Roles in This Skill
- DevOps Engineer: Install and configure Python environment using uv. Initialize Python projects with virtual environments. Manage Python versions and dependencies. Verify installations and troubleshoot setup issues. Update project documentation to reflect environment setup.
Role Communication
As an expert in your assigned roles, you must announce your actions before performing them using the following format:
As a {Role} [and {Role}, ...], I will {action description}
This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
Instructions
1. Check Existing Installation
Before installing, check if uv is already installed.
uv --version
If installed, ask the user for confirmation before reinstalling or updating.
2. Install uv
macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
3. Initialize Project with uv
To initialize a new project or set up the current directory:
uv init
This will set up a virtual environment and pyproject.toml.
4. Python Version
uv manages Python versions automatically. The default targeted version is typically the latest stable or system default (e.g., Python 3.12).
To pin a specific version:
uv python pin 3.12
5. Save User Preferences
After successful installation, save the Python package manager preference to dev-swarm/user_preferences.md so future sessions remember to use uv.
Example:
Create or update dev-swarm/user_preferences.md with:
## Python Package Manager
- Use **uv** for all Python package operations
- Python version: 3.12+