Modern Python Setup: uv, ruff, pyright & CI

    by Ignasi

    1

    Standardize Python projects with uv, ruff, pyright, and modern pyproject.toml conventions.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Modern Python Setup: uv, ruff, pyright & CI

    Example session with this skill installed

    Migrate this project from poetry to uv. Add ruff for linting and pyright for strict typing. Fix imports to use pathlib.

    • Read your context and instructions
    • Compiled the modern python setup

    I have migrated the project from Poetry to the modern uv toolchain. I consolidated the dependencies into a PEP 621 compliant pyproject.toml, replaced the multi-tool linting setup with Ruff, and enabled strict mode for Pyright.

    Modern Python Configuration

    [project]
    name = "data-processor"
    version = "0.1.0"
    description = "High-performance data transformation utility"
    readme = "README.md"
    requires-python = ">=3.12"
    dependencies = [
        "httpx>=0.27.0",
        "pydantic>=2.6.0",
        "pydantic-settings>=2.2.0",
    ]
    
    [dependency-groups]
    dev = [
        "ruff>=0.3.0",
        "pyright>=1.1.350",
        "pytest>=8.0.0",
        "pytest-cov>=4.1.0",
        "pre-commit>=3.6.0",
    ]
    
    [tool.ruff]
    line-length = 100
    target-version = "py312"
    
    [tool.ruff.lint]
    select = ["E", "F", "I", "UP", "B", "SIM", "RUF", "S", "PT", "C4", "DTZ", "PL"]
    ignore = ["PLR2004"]
    
    [tool.ruff.lint.per-file-ignores]
    "tests/**" = ["S101"]
    
    [tool.pyright]
    typeCheckingMode = "strict"
    include = ["src"]
    
    [tool.pytest.ini_options]
    addopts = "-q --strict-markers --cov=src --cov-report=term-missing"
    

    I have also refactored src/utils/file_ops.py to use pathlib.Path instead of os.path and applied ruff check --fix to the entire codebase.

    Next steps

    1. Run uv sync to install the new environment and generate uv.lock.
    2. Execute uv run pre-commit install to set up the git hooks.
    3. Review the ruff report for 3 remaining manual fixes in the legacy_parser.py module.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Fragmented Python toolchains lead to slow environments and inconsistent code quality. This skill migrates legacy projects to a modern 2026 stack, replacing slow package managers and multiple linters with a unified, high-performance toolset.

    What it does

    • Unified package management replaces pip, poetry, or pipenv with uv for lightning-fast installs and lockfile management.
    • Consolidated linting swaps black, isort, and flake8 for ruff to handle formatting and linting in a single pass.
    • Strict type checking configures pyright or mypy to enforce type safety across the codebase.
    • Project modernization implements the src layout and standardizes configuration within a single pyproject.toml.
    • Automated CI/CD generates GitHub Actions workflows using setup-uv for cached, multi-version testing and linting.

    How it works

    1. Detect existing configuration files like requirements.txt, setup.py, or .flake8 to map the migration path.
    2. Initialize the environment using uv and migrate dependencies into PEP 621 compliant blocks.
    3. Configure tool settings for Ruff, Pyright, and Pytest directly within the pyproject.toml.
    4. Refactor legacy patterns by applying modern conventions like pathlib, f-strings, and Pydantic settings.
    5. Verify the setup by running the full suite and reporting performance improvements or remaining type errors.

    Frameworks & tools

    This skill uses uv for environment orchestration, ruff for linting, pyright or mypy for typing, and pytest for testing. It targets Python 3.12+ and GitHub Actions for CI.

    Why this beats prompting it yourself

    Standardizing a Python project requires deep knowledge of PEP standards and evolving tool defaults. This skill ensures your configuration follows the 2026 best practices for pyproject.toml structure, CI caching, and linter rule selections without manual trial and error.

    Use cases

    • Migrating a legacy requirements.txt project to a modern uv workflow.
    • Bootstrapping a new Pydantic-based microservice with strict typing and src layout.
    • Replacing a slow Poetry/Black/Flake8 pipeline with high-performance Rust-based tools.
    • Setting up a library for PyPI publishing using OIDC Trusted Publishing.

    Known limitations

    Does not delete old configuration files until the new setup is verified. Requires Python 3.12+ for certain modern syntax recommendations.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 11 days ago

    • Free with an Agensi account

    Software
    Python

    Permissions

    Terminal / Shell
    Network Access
    Listed11 days ago

    What's inside

    Frequently Asked Questions

    This skill automates the migration of legacy projects (using pip, Poetry, or Pipenv) to a high-performance Rust-based stack including uv and Ruff, while implementing modern PEP 621 standards and the 'src' layout.

    This skill is optimized for Python 3.12 and newer to leverage modern syntax; it is compatible with any AI agent capable of file system operations and terminal execution, such as those within VS Code or terminal-based IDEs.

    The skill maps your existing dependencies from files like requirements.txt or setup.py directly into a unified pyproject.toml, ensuring your environment remains identical but manages packages significantly faster.

    Yes, the skill automatically generates optimized GitHub Actions workflows featuring setup-uv and intelligent caching to ensure your linting and testing pipeline is as fast as your local development.

    By default, the skill leaves legacy configuration files (like .flake8 or requirements.txt) intact until the new uv and Ruff setup is verified, allowing you to manually delete them once you are satisfied with the migration.

    New in APIs & Backend

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Free