Version: 1.1.8
Language: English | 中文
A Python development environment configuration script that automatically sets up a complete coding environment with modern tooling.
- ⚙️ Automatic Ruff configuration (code formatting and linting)
- 📝 Automatic Pyright configuration (type checking)
- 💻 Automatic VS Code/Windsurf settings
- 🔄 Smart configuration updates (no duplicates)
- 🐍 Auto-detect Python version from project
- 🎯 One-click development environment setup
- 🔧 Compatible with any Python project structure
- 📜 Automatic
.gitignoreconfiguration with comprehensive Python development patterns
-Recommended: This script is designed to work seamlessly with uv, a modern Python package manager. While it supports any Python project structure, using uv provides the best experience for project initialization, dependency management, and virtual environment handling.
+Note: This script requires uv to be installed, as it uses uv venv to create virtual environments. uv is a modern Python package manager that provides excellent project management capabilities.
- Download the script:
curl -O https://raw.githubusercontent.com/cphotor/pye/main/pye- Make it executable:
chmod +x pye- Move to system path (optional):
mv pye ~/.local/bin/# Configure current directory
pye
# Configure specific project directory
pye /path/to/my-project
# Configure code line length (default: 88, PEP 8 standard)
# Recommended values:
# --pep8 : 88 characters (PEP 8 standard, default)
# --github : 100 characters (GitHub standard)
# --wide : 120 characters (wide screen mode)
pye --pep8
pye --github
pye --wide
# Combine options
pye --github /path/to/my-project
# Show help
pye -H
# Show version
pye -V# 1. Create a new project
uv init my-project
cd my-project
# 2. Configure development environment (auto-creates venv and installs toolchain)
pye
# 3. Start coding!Note:
- Use
uv run <script.py>to run Python scripts directly in the virtual environment - Use
uv add <package-name>to add third-party dependencies when needed (e.g.,uv add requests)
- Python formatting with Ruff
- Enable format on save
- Configure auto-organize imports and fix issues on save
- Configure auto-delay save: Automatically saves files after 1 second of modification (
files.autoSave: afterDelay,files.autoSaveDelay: 1000)
- Auto-recommend Python extension (auto-selects Pylance/Pyright)
- Auto-recommend Ruff extension for formatting
- Auto-detect Python version from project
- Standard type checking mode
- Optimized error reporting configuration
- Code line length limit: 88 characters (configurable with
--pep8,--github,--wide)--pep8: 88 characters (PEP 8 standard, default)--github: 100 characters (GitHub standard)--wide: 120 characters (wide screen mode)
- Target Python version: auto-detect
- Comprehensive code checking rules
- Auto-fix all fixable issues
- Virtual environment search paths
- Terminal auto-activation
- Shell startup activation for better Copilot support
- Auto-create or update
.gitignorewith comprehensive Python development patterns:.ruff_cache/- Ruff cache directory.vscode/user-specific files only (settings.json.user,workspace.xml,*.lock)- Python development artifacts (
__pycache__/,*.pyc,build/,dist/, etc.) - Virtual environments (
.venv/,venv/,ENV/, etc.) - Test and coverage caches (
.pytest_cache/,.coverage,htmlcov/, etc.)
- Smart merge: preserves existing custom entries, only adds missing patterns
- Project-friendly: keeps
.vscode/settings.jsonand.vscode/extensions.jsonunder version control
The script automatically detects Python version from:
pyproject.toml→requires-pythonfield.python-versionfileuv python list(active version)- Falls back to
3.13if detection fails
- Python 3.8+ (3.11+ recommended)
- Bash shell environment (built-in on macOS/Linux) -Required: uv - Modern Python package manager (used for virtual environment creation and project management)