An open API service indexing awesome lists of open source software.

https://github.com/miguelcosta2c/modern-python-development-environment

Modern Python Development Environment Package Manager: uv for high-speed dependency resolution and environment management. Code Quality: Ruff for near-instant linting, formatting, and automatic import organization. Type Safety: Pyright in strict mode for advanced static type analysis. Standards: Follows the PEP 621 src/ layout with centralized
https://github.com/miguelcosta2c/modern-python-development-environment

ci-cd developer-tools github-actions pyright pytest python python-template ruff uv

Last synced: 2 months ago
JSON representation

Modern Python Development Environment Package Manager: uv for high-speed dependency resolution and environment management. Code Quality: Ruff for near-instant linting, formatting, and automatic import organization. Type Safety: Pyright in strict mode for advanced static type analysis. Standards: Follows the PEP 621 src/ layout with centralized

Awesome Lists containing this project

README

          

# ๐Ÿ Modern Python Development Environment (uv)

[![Python](https://img.shields.io/badge/Python-3.13-3776AB?logo=python&logoColor=white)](https://www.python.org/)
[![License](https://img.shields.io/badge/License-MIT-2E7D32)](LICENSE)
[![Linting](https://img.shields.io/badge/Linting-Ruff-8B0000?logo=ruff&logoColor=white)](https://docs.astral.sh/ruff/)
[![Static Typing](https://img.shields.io/badge/Static%20Typing-Pyright-4B32C3?logo=microsoft&logoColor=white)](https://github.com/microsoft/pyright)
[![Dependency Management](https://img.shields.io/badge/Dependency%20Management-uv-FF7A00?logo=rust&logoColor=white)](https://docs.astral.sh/uv/)
[![CI](https://github.com/miguelcosta2c/modern-python-development-environment/actions/workflows/ci.yml/badge.svg)](
https://github.com/miguelcosta2c/modern-python-development-environment/actions/workflows/ci.yml
)

A **modern Python development template** powered by **uv**, following current best practices such as:

- `src/` layout
- Static typing with **Pyright**
- Linting and formatting with **Ruff**
- Testing with **Pytest**
- CLI scripts via `pyproject.toml`
- Environment variable support with **python-dotenv**

Ideal for quickly starting professional and maintainable Python projects.

---

## ๐Ÿš€ Tech Stack

- **Python 3.13**
- **uv** โ€“ dependency and virtual environment manager
- **Ruff** โ€“ linter and code formatter
- **Pyright** โ€“ static type checker
- **Pytest** โ€“ testing framework
- **python-dotenv** โ€“ environment variable management

---

## ๐Ÿ“‚ Project Structure

```text
.
โ”œโ”€โ”€ .vscode/ # VS Code configuration
โ”‚ โ”œโ”€โ”€ extensions.json
โ”‚ โ””โ”€โ”€ settings.json
โ”œโ”€โ”€ src/
โ”‚ โ””โ”€โ”€ my_package/
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”œโ”€โ”€ my_module.py # Core logic
โ”‚ โ””โ”€โ”€ main.py # Entry point
โ”œโ”€โ”€ .env # Environment variables
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .python-version # Python version (3.13.11)
โ”œโ”€โ”€ pyproject.toml # Project configuration
โ”œโ”€โ”€ requirements.txt # Dependencies (compatibility)
โ”œโ”€โ”€ uv.lock # uv lockfile
โ””โ”€โ”€ README.md
````

---

## โš™๏ธ Requirements

* **Python 3.13+**
* **uv** installed

Install `uv`:

```bash
pip install uv
```

Or (recommended):

```bash
curl -Ls https://astral.sh/uv/install.sh | sh
```

---

## ๐Ÿ“ฆ Installation

Clone the repository:

```bash
git clone https://github.com/miguelcosta2c/modern-python-development-environment
cd modern-python-development-environment
```

Create the virtual environment and install dependencies:

```bash
uv sync
```

Install development dependencies:

```bash
uv sync --extra dev
```

---

## โ–ถ๏ธ Running the Project

### Run with Python

```bash
python src/my_package/main.py
```

### Run as a CLI command

The project defines a console script in `pyproject.toml`:

```toml
[project.scripts]
project = "my_package.my_module:run_from_script"
```

After installing the project in the environment:

```bash
uv run project
```

---

## ๐Ÿงช Testing

Run tests with:

```bash
pytest
```

Or using `uv`:

```bash
uv run pytest
```

---

## ๐Ÿงน Linting & Formatting (Ruff)

Check for issues:

```bash
ruff check .
```

Automatically fix issues:

```bash
ruff check . --fix
```

Format the code:

```bash
ruff format .
```

---

## ๐Ÿง  Static Type Checking (Pyright)

```bash
pyright
```

Configured in **strict mode** for maximum type safety.

---

## ๐ŸŒฑ Environment Variables

This project uses **python-dotenv**.

Create a `.env` file:

```env
EXAMPLE_VAR=hello_world
```

Load it in your application when needed.

---

## ๐Ÿ“Œ Best Practices Included

* `src/` layout (recommended by the Python Packaging Authority)
* Centralized configuration via `pyproject.toml`
* Reproducible environments with `uv.lock`
* Clear separation between production and development dependencies

---

## ๐Ÿ“œ License

This project is licensed under the **MIT License**.

---

## ๐Ÿ‘ค Author

**Miguel Costa**
๐Ÿ“ง [miguelcosmecosta@gmail.com](mailto:miguelcosmecosta@gmail.com)

---

## โญ Tip

If you find this template useful, consider giving the repository a โญ!