python-project-setup

Scaffolds Python library projects with pyproject.toml, ruff, pytest, and CI configuration.

1|2|Updated Nov 25, 2017
One-click install
npx skills add https://github.com/asarchami/dotfiles --skill python-project-setup-asarchami
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-project-setup
Source: https://github.com/asarchami/dotfiles/tree/main/dot_config/opencode/skills/python/project-setup
Command: npx skills add https://github.com/asarchami/dotfiles --skill python-project-setup-asarchami

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up a new Python project involves many repetitive decisions—directory layout, build backend, linting, testing, and CI—which are easy to get wrong or inconsistent across projects. ## Core Features & Use Cases - Project Scaffolding: Creates a src/ layout with pyproject.toml, Makefile, pre-commit config, and GitHub Actions CI. - Modern Tooling Defaults: Standardizes on ruff for linting/formatting, pytest for testing, mypy for type checking, and uv/pip for dependency management. - Use Case: When starting a new Python library, ask the agent to scaffold the project and receive a complete, ready-to-develop structure with lint, test, and CI workflows already configured. ## Quick Start Ask the agent to set up a new Python library project named my-project with src layout, ruff, pytest, and GitHub Actions CI.

Frequently Asked Questions about python-project-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a new Python project with pyproject.toml?

Create a src/ layout with your package directory, then add a pyproject.toml declaring the setuptools build backend, project metadata, and dependencies. Add a dev extra with pytest, ruff, and mypy, then install with pip install -e ".[dev]".

What is the difference between src layout and flat layout in Python?

The src layout places package code under a src/ directory so tests run against the installed package rather than the working directory. This catches packaging and import bugs early, which the flat layout can hide.

Should I use ruff or flake8 and black for Python linting?

Ruff is recommended because it replaces flake8, isort, and black in a single fast tool. Configure it in pyproject.toml and run ruff check and ruff format on your src and tests directories.

Does pyproject.toml replace setup.py completely?

Yes, for most modern projects pyproject.toml fully replaces setup.py when using setuptools>=61 or another PEP 517 build backend. All metadata, dependencies, and tool configuration live in one file.

Why should I avoid pinning an exact Python version in requires-python?

Pinning an exact version prevents users on newer Python releases from installing your library. Use a lower bound like >=3.10 so the package stays installable across supported versions.