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
- Host: GitHub
- URL: https://github.com/miguelcosta2c/modern-python-development-environment
- Owner: miguelcosta2c
- License: mit
- Created: 2025-12-10T02:37:06.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-01-09T11:51:01.000Z (3 months ago)
- Last Synced: 2026-01-12T17:13:47.337Z (2 months ago)
- Topics: ci-cd, developer-tools, github-actions, pyright, pytest, python, python-template, ruff, uv
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Modern Python Development Environment (uv)
[](https://www.python.org/)
[](LICENSE)
[](https://docs.astral.sh/ruff/)
[](https://github.com/microsoft/pyright)
[](https://docs.astral.sh/uv/)
[](
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 โญ!