Skip to content

Commit 043948d

Browse files
committed
docs: add documentation for this organization
1 parent ffb3f8f commit 043948d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3836
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# uv
2+
3+
uv.lock
4+

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

docs/index.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Python Boilerplate
2+
3+
A collection of modern Python project templates with pre-configured development tools, CI/CD pipelines, and best practices.
4+
5+
---
6+
7+
## Overview
8+
9+
**Python Boilerplate** is a curated collection of project templates designed to help developers quickly bootstrap new Python projects with industry best practices and modern tooling already configured.
10+
11+
!!! tip "✨ Why Use These Templates?"
12+
- **⚡ Fast Setup** - Get a production-ready project structure in seconds
13+
- **🛠️ Modern Tooling** - Pre-configured linters, formatters, type checkers, and testing frameworks
14+
- **🚀 CI/CD Ready** - Automated workflows for GitHub Actions
15+
- **🐳 Docker Support** - Development and production containerization
16+
- **📚 Documentation** - MkDocs integration with Material theme
17+
- **🔧 Developer Experience** - Pre-commit hooks, Makefile automation, and dev containers
18+
19+
---
20+
21+
## Available Templates
22+
23+
### 🚀 UV Template
24+
25+
Modern Python project template using [uv](https://github.com/astral-sh/uv) - the ultra-fast Python package manager.
26+
27+
!!! info "Repository & Documentation"
28+
**[📂 uv-template](https://github.com/python-boilerplate/uv-template)** | **[📖 Documentation](https://python-boilerplate.github.io/uv-template/)**
29+
30+
!!! example "🎯 Core Features"
31+
- 🐍 **Python 3.10+** - Modern Python version support
32+
- ⚡ **uv** - Ultra-fast Python project manager with dependency installer and lock file support
33+
- 🐳 **Docker Support** - Multi-stage Dockerfiles for easy local development and clean production containers
34+
- 🔄 **GitHub Actions CI/CD** - Automated linting, testing, static analysis, and security checks for every branch
35+
- 💻 **Dev Containers** - Ready-to-use development environment in GitHub Codespaces or VSCode Remote Containers
36+
37+
!!! example "🛠️ Code Quality Tools"
38+
- 🔍 **Ruff** - Built-in linting and formatting
39+
- 🔎 **MyPy** - Static type checking
40+
- 🧪 **Pytest** - Testing framework with async support
41+
- 📊 **Vermin** - Minimum Python version analysis
42+
43+
!!! example "⚙️ Developer Experience"
44+
- 🎣 **Pre-commit Hooks** - Runs linters, formatting, and tests automatically before every commit
45+
- 📝 **Commitizen** - Standardized commit messages with automated versioning and changelog updates
46+
- 🌍 **Environment Management** - Stage-based environment variable configuration for dev/prod with switching via `APP_STAGE`
47+
- 📖 **MkDocs Documentation** - Project documentation generated with MkDocs and the Material theme
48+
- 🔧 **Makefile Automation** - Common tasks available as simple Makefile commands
49+
50+
---
51+
52+
### 📦 Poetry Template
53+
54+
Classic Python project template using [Poetry](https://python-poetry.org/) for dependency management.
55+
56+
!!! info "Repository & Documentation"
57+
**[📂 poetry-template](https://github.com/python-boilerplate/poetry-template)** | **[📖 Documentation](https://python-boilerplate.github.io/poetry-template/)**
58+
59+
!!! example "🎯 Core Features"
60+
- 🐍 **Python 3.10+** - Modern Python version support
61+
- 📦 **Poetry** - Mature dependency management with lock files
62+
- 🐳 **Docker Support** - Containerization for development and production
63+
- 🔄 **CI/CD Pipelines** - Automated quality checks and deployment workflows
64+
- 📚 **Structured Documentation** - Well-organized project documentation
65+
66+
!!! example "🛠️ Code Quality Tools"
67+
- 🔍 **Ruff** - Built-in linting and formatting
68+
- 🔎 **MyPy** - Static type checking
69+
- 🧪 **Pytest** - Testing framework with async support
70+
- 📊 **Vermin** - Minimum Python version analysis
71+
72+
!!! example "⚙️ Developer Experience"
73+
- 🎣 **Pre-commit Hooks** - Runs linters, formatting, and tests automatically before every commit
74+
- 📝 **Commitizen** - Standardized commit messages with automated versioning and changelog updates
75+
- 🌍 **Environment Management** - Stage-based environment variable configuration for dev/prod with switching via `APP_STAGE`
76+
- 📖 **MkDocs Documentation** - Project documentation generated with MkDocs and the Material theme
77+
- 🔧 **Makefile Automation** - Common tasks available as simple Makefile commands
78+
79+
80+
---
81+
82+
## Quick Start
83+
84+
!!! tip "Getting Started"
85+
1. **Choose your template** from the list above
86+
2. **Use as GitHub Template** - Click "Use this template" button on the repository page
87+
3. **Clone your new repository**
88+
```bash
89+
git clone https://github.com/your-username/your-project-name.git
90+
cd your-project-name
91+
```
92+
4. **Initialize the project**
93+
```bash
94+
make init
95+
```
96+
5. **Start developing!** 🎉
97+
98+
---
99+
100+
## Templates Comparison
101+
102+
| Feature | UV Template | Poetry Template |
103+
|---------|-------------|-----------------|
104+
| Package Manager | uv (ultra-fast) | Poetry (mature) |
105+
| Dependency Locking | ✅ uv.lock | ✅ poetry.lock |
106+
| Python Version Management | ✅ Built-in | ❌ External tool needed |
107+
| Speed | ⚡ Fastest | 🐌 Slower |
108+
| Ecosystem Maturity | 🆕 New but growing | 🏆 Well-established |
109+
| Learning Curve | 📈 Minimal | 📊 Moderate |
110+
111+
---
112+
113+
## Useful Links
114+
115+
!!! info "Documentation & Resources"
116+
- **[GitHub Organization](https://github.com/python-boilerplate)** - All templates and repositories
117+
- **[UV Template Docs](https://python-boilerplate.github.io/uv-template/)** - Complete uv template documentation
118+
- **[Poetry Template Docs](https://python-boilerplate.github.io/poetry-template/)** - Complete poetry template documentation
119+
120+
---
121+
122+
## Contributing
123+
124+
!!! question "Want to Contribute?"
125+
We welcome contributions! If you have ideas for improvements or new templates:
126+
127+
1. **Open an issue** to discuss your idea
128+
2. **Fork the repository** and make your changes
129+
3. **Submit a pull request** with a clear description
130+
131+
---
132+
133+
## Support
134+
135+
!!! help "Need Help?"
136+
- 📋 **Issues** - Report bugs or request features in the specific template repository
137+
- 💬 **Discussions** - Ask questions in GitHub Discussions
138+
- 📧 **Contact** - Reach out to [@monok8i](https://github.com/monok8i)
139+
140+
---
141+
142+
!!! note "License"
143+
All templates are released under the [MIT License](https://github.com/python-boilerplate/uv-template/blob/main/LICENSE).
144+
145+
---
146+
147+
!!! success "Made with ❤️ by [@monok8i](https://github.com/monok8i)"
148+
[⭐ Follow the Organization](https://github.com/python-boilerplate)[📋 Browse Templates](https://github.com/orgs/python-boilerplate/repositories)[💬 Join Discussions](https://github.com/orgs/python-boilerplate/discussions)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# GitHub Actions
2+
3+
A powerful CI/CD platform built into GitHub for automating workflows: testing, linting, type-checking, and more.
4+
5+
---
6+
7+
## What is it used for here?
8+
!!! question "!"
9+
- **Automatically runs linters, tests, and checks code quality for every push and pull request**
10+
- **Ensures your code works on multiple Python versions**
11+
- **Checks code compatibility with the minimum Python version using Vermin**
12+
- **Runs all key quality tools: Ruff, MyPy, Pytest, and more**
13+
14+
---
15+
16+
## How does it work in this template?
17+
18+
- **Workflow files are located in [`.github/workflows/`](https://github.com/python-boilerplate/uv-template/tree/main/.github/workflows)**.
19+
- Actions are triggered automatically on push or pull request to key branches.
20+
- Each workflow installs only used dependencies using default `pip`.
21+
- Main scenarios covered:
22+
- **Linting:** Checks code style with [Ruff](../code_quality/ruff.md)
23+
- **Type Checking:** Validates type annotations using [MyPy](../code_quality/mypy.md)
24+
- **Testing:** Runs all tests with [Pytest](../code_quality/pytest.md)
25+
- **Compatibility:** Checks minimal Python version compatibility with [Vermin](../code_quality/vermin.md)
26+
- **Multi-Python:** Runs tests on several Python versions (e.g., 3.10, 3.11, 3.12, 3.13)
27+
28+
---
29+
30+
## Example workflows
31+
32+
!!! example "Common workflow: Lint, Typecheck, Test"
33+
```yaml title=".github/workflows/code-quality.yml"
34+
name: Lint, Typecheck, Test
35+
36+
on:
37+
push:
38+
branches: [main]
39+
pull_request:
40+
branches: [main]
41+
42+
jobs:
43+
build:
44+
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
python-version: ["3.10", "3.11", "3.12"]
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
- name: Install dependencies
54+
run: uv pip install -r requirements-dev.txt
55+
- name: Lint
56+
run: uv run ruff check ./src/
57+
- name: Typecheck
58+
run: uv run mypy ./src/
59+
- name: Test
60+
run: uv run pytest -v
61+
```
62+
63+
!!! example "Compatibility check: Vermin"
64+
See [Vermin section](../code_quality/vermin.md) for details.
65+
66+
---
67+
68+
## How to add or edit workflows
69+
70+
- **All workflow YAML files are in `.github/workflows/`**
71+
- To add a new workflow, just copy an existing `.yml` file and edit as needed.
72+
73+
---
74+
75+
## Configuration and secrets
76+
77+
- No sensitive secrets are used by default in this template.
78+
- For advanced scenarios (e.g., publishing, deploying), add secrets in GitHub repo settings and reference via `${{ secrets.YOUR_SECRET }}`.
79+
80+
---
81+
82+
For more details, see the [GitHub Actions Documentation](https://docs.github.com/en/actions).

docs/poetry-template/features/ci/gitlab_ci.md

Whitespace-only changes.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# MyPy
2+
3+
Static type checker for Python, designed to ensure code correctness and catch type errors before runtime.
4+
5+
---
6+
7+
## What is it used for here?
8+
!!! question "!"
9+
- **`type checking` Python code to catch type errors early**
10+
- **enforcing and verifying type annotations**
11+
- **checking code quality before every commit and during CI pipelines**
12+
13+
---
14+
15+
## How to use it?
16+
17+
- **In this case, the Makefile does the same as running the commands directly via uv. The Makefile is only needed to shorten commands.**
18+
19+
!!! tip "!"
20+
21+
=== "Makefile"
22+
23+
```bash
24+
make typecheck
25+
```
26+
27+
=== "Manually (Without make and uv)"
28+
29+
```bash
30+
mypy --config-file=pyproject.toml ./src/
31+
```
32+
33+
=== "Manually (With uv)"
34+
35+
```bash
36+
uv run mypy --config-file=pyproject.toml ./src/
37+
```
38+
39+
## How to use it with pre-commit?
40+
41+
To use MyPy with pre-commit, you need to add the appropriate configuration to `.pre-commit-config.yaml`.
42+
43+
!!! tip "!"
44+
45+
=== "Hook (by mypy)"
46+
47+
```yaml title=".pre-commit-config.yaml"
48+
- repo: https://github.com/pre-commit/mirrors-mypy
49+
rev: v1.16.0
50+
hooks:
51+
- id: mypy
52+
args: [ --config-file=pyproject.toml ]
53+
files: ^src/
54+
```
55+
56+
=== "Hook (your own)"
57+
58+
```yaml title=".pre-commit-config.yaml"
59+
- repo: local
60+
hooks:
61+
# check types
62+
- id: mypy
63+
name: Mypy
64+
description: Run Mypy for type checking types in Python code
65+
entry: uv run mypy
66+
types: [python]
67+
language: system
68+
always_run: true
69+
pass_filenames: false
70+
args: [ --config-file=pyproject.toml, ./src/ ]
71+
```
72+
73+
## Configuration
74+
All configuration for Mypy in this template is located in [pyproject.toml](https://github.com/python-boilerplate/uv-template/blob/main/pyproject.toml) under the `[tool.mypy]` section.
75+
76+
---
77+
78+
For more details on configuration, see the [MyPy Documentation](https://mypy.readthedocs.io/en/stable/)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Pytest
2+
3+
A powerful framework for testing Python code, supporting both synchronous and asynchronous tests.
4+
5+
---
6+
7+
## What is it used for here?
8+
!!! question "!"
9+
- **`unit testing` and `integration testing` of Python code**
10+
- **testing both synchronous and asynchronous functions**
11+
- **automated quality checks before every commit and in CI pipelines**
12+
13+
---
14+
15+
## Important
16+
17+
!!! warning "!"
18+
- For testing asynchronous functions, the [pytest-asyncio](https://pytest-asyncio.readthedocs.io/en/latest/) extension is added, which makes it easy to write and run async tests alongside regular ones.
19+
20+
---
21+
22+
## How to use it?
23+
24+
- **In this case, the Makefile does the same as running the commands directly via uv. The Makefile is only needed to shorten commands.**
25+
26+
!!! tip "!"
27+
28+
=== "Makefile"
29+
30+
```bash
31+
make test
32+
```
33+
34+
=== "Manually (Without make and uv)"
35+
36+
```bash
37+
pytest -v
38+
```
39+
40+
=== "Manually (With uv)"
41+
42+
```bash
43+
uv run pytest -v
44+
```
45+
46+
## How to use it with pre-commit?
47+
48+
Only a local hook is used for integration with pre-commit.
49+
!!! question "Why?"
50+
Pytest does not officially provide a pre-commit hook repository, and running tests often requires custom parameters or environments (for example, via uv or with specific options). A local hook gives maximum flexibility and control.
51+
52+
!!! tip "!"
53+
54+
=== "Local hook (recommended)"
55+
56+
```yaml title=".pre-commit-config.yaml"
57+
- repo: local
58+
hooks:
59+
# Run pytest.
60+
- id: pytest
61+
name: pytest
62+
entry: uv run pytest
63+
language: system
64+
types: [python]
65+
pass_filenames: false
66+
args: [ -v ]
67+
```
68+
---
69+
70+
## Configuration
71+
72+
All configuration for Pytest (such as plugins) in this template is located in [pyproject.toml](https://github.com/python-boilerplate/uv-template/blob/main/pyproject.toml) under the `[tool.pytest.ini_options]` section.
73+
74+
---
75+
76+
For more details on configuration, see the [Pytest Documentation](https://docs.pytest.org/en/stable/)
77+
78+
About async tests: [pytest-asyncio documentation](https://pytest-asyncio.readthedocs.io/en/stable/)

0 commit comments

Comments
 (0)