Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: template-testing
description: "Comprehensive testing of the cookiecutter template across all configurations."
---

Expand Down Expand Up @@ -39,7 +40,7 @@ make mypy_check # Type checking
make ruff_check # Linting
```

Note: Formatting issues (dapperdata, tomlsort, paracelsus) can be auto-fixed with `make chores` and are not critical for validation.
Note: Formatting issues (prettier, tomlsort, paracelsus) can be auto-fixed with `make chores` and are not critical for validation.

#### Step 3: Verify Results

Expand Down Expand Up @@ -136,15 +137,13 @@ Standard configurations should produce these results:
After testing, provide a summary that includes:

1. **Configuration Results**: For each tested configuration

- Configuration name
- Number of tests run
- Number of tests passed/failed
- Code coverage percentage
- Any errors or warnings

2. **Test Output Analysis**: Key findings from test execution

- Any deprecation warnings
- Performance issues
- Coverage gaps in important modules
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Transform any Python idea into a production-ready project in minutes. This Cooki

## Why Choose This Template?

- **Modern Development Tools**: Get a fully configured environment with Ruff (formatting/linting), mypy (type checking), pytest (testing), and pre-commit hooks ready to use
- **Modern Development Tools**: Get a fully configured environment with Ruff (formatting/linting), prettier (YAML/JSON/Markdown formatting), mypy (type checking), pytest (testing), and pre-commit hooks ready to use
- **Production-Ready Frameworks**: Optional integration with FastAPI (web APIs), Celery (distributed tasks), SQLAlchemy + Alembic (database ORM), and QuasiQueue (multiprocessing)
- **Professional Infrastructure**: Includes Docker containerization, GitHub Actions CI/CD, Pydantic Settings for configuration, and Makefile automation
- **Developer-Friendly CLI**: Optional Typer integration for building beautiful command-line interfaces with automatic help and shell completion
Expand Down Expand Up @@ -47,6 +47,7 @@ Every project created with this template includes these essential components:

- **[Ruff](https://docs.astral.sh/ruff/)**: Blazingly fast Python linter and formatter (10-100x faster than Black) that replaces multiple tools (Flake8, isort, Black) with a single, zero-configuration solution written in Rust
- **[mypy](https://mypy.readthedocs.io/en/stable/)**: Industry-standard static type checker that catches type-related bugs before runtime, providing IDE autocompletion and making refactoring safer
- **[prettier](https://prettier.io/)**: Universal code formatter for YAML, JSON, Markdown, and other config files, running via npx with no Python dependency needed and consistent formatting across all supported file types
- **[pytest](https://docs.pytest.org/)**: Python's most popular testing framework with powerful fixtures, parametrization, full async/await support, and extensive plugin ecosystem for testing web apps, databases, and more
- **Coverage reporting**: Comprehensive test coverage tracking with support for multiprocess and distributed applications, ensuring your tests exercise all code paths

Expand Down Expand Up @@ -153,7 +154,7 @@ Pick and choose the features you need. Unused components are completely removed
**Comprehensive [GitHub Actions](https://docs.github.com/en/actions)**

- Matrix testing across multiple Python versions (3.10, 3.11, 3.12, 3.13, 3.14) to ensure broad compatibility before release
- Automated code quality enforcement with Ruff for formatting and linting, mypy for type checking, and pytest for test execution
- Automated code quality enforcement with Ruff for formatting and linting, prettier for YAML/JSON/Markdown formatting, mypy for type checking, and pytest for test execution
- Fully automated PyPI publishing triggered by git tags, with automatic changelog generation, version bumping, and release notes from commit messages
- Container image building and multi-architecture publishing to GitHub Container Registry and Docker Hub, with automatic tagging based on branches and release/tag versions
- Intelligent dependency updates using Dependabot and [uv](https://pypi.org/project/uv/) lockfile management for fast, reproducible builds and automated PR creation for updates
Expand Down
24 changes: 0 additions & 24 deletions {{cookiecutter.__package_slug}}/.github/workflows/dapperdata.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions {{cookiecutter.__package_slug}}/.github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Configuration File Formatting

on:
push:
pull_request:

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Check Formatting
run: npx --yes prettier --check . --log-level warn
7 changes: 7 additions & 0 deletions {{cookiecutter.__package_slug}}/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.venv/
{{cookiecutter.__package_slug}}.egg-info/
tmp/
.*/**/*.md
{%- if cookiecutter.include_sqlalchemy == "y" %}
docs/dev/database.md
{%- endif %}
8 changes: 4 additions & 4 deletions {{cookiecutter.__package_slug}}/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ git mv old_path new_path # ALWAYS use git mv for moving or renaming files, never
### Testing and Validation

```bash
make tests # Run all tests and checks (pytest, ruff, black, mypy, dapperdata, tomlsort)
make tests # Run all tests and checks (pytest, ruff, black, mypy, prettier, tomlsort)
make pytest # Run pytest with coverage report
make pytest_loud # Run pytest with debug logging enabled
uv run pytest # Run pytest directly with uv, adding any arguments and options needed
Expand All @@ -37,17 +37,17 @@ uv run pytest # Run pytest directly with uv, adding any arguments and options ne
make ruff_check # Check code with ruff linter
make black_check # Check code formatting with ruff format using the black format
make mypy_check # Run type checking with mypy
make dapperdata_check # Check data file formatting
make prettier_check # Check markdown/json/yaml/etc formatting with prettier
make tomlsort_check # Check TOML file linting and formatting
```

### Code Formatting (Auto-fix)

```bash
make chores # Run all formatting fixes (ruff, black, dapperdata, tomlsort)
make chores # Run all formatting fixes (ruff, black, prettier, tomlsort)
make ruff_fixes # Auto-fix ruff issues
make black_fixes # Auto-format code with ruff using the black format
make dapperdata_fixes # Auto-format data files
make prettier_fixes # Auto-format markdown/json/yaml/etc
make tomlsort_fixes # Auto-format TOML files
```

Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.__package_slug}}/docs/dev/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Development dependencies are organized in the `[project.optional-dependencies]`
- **ruff**: Fast Python linter and formatter (replaces Black, isort, Flake8)
- **mypy**: Static type checker for catching type-related bugs
- **build**: PEP 517 build frontend for creating distribution packages
- **dapperdata**: Data formatting and validation tool
- **prettier**: Universal code formatter for YAML, JSON, Markdown, and other config files (runs via npx)
- **glom**: Nested data access and transformation
- **greenlet**: Lightweight concurrent programming support (required for coverage with async)
- **toml-sort**: Automatic TOML file sorting for consistency
Expand Down
6 changes: 3 additions & 3 deletions {{cookiecutter.__package_slug}}/docs/dev/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ The project includes the following GitHub Actions workflows in `.github/workflow
- **Purpose**: Validates type hints and catches type-related errors
- **Command**: `make mypy_check`

**dapperdata.yaml** - Data Format Validation
**prettier.yaml** - Configuration File Formatting

- **Trigger**: Every push and pull request
- **Purpose**: Validates data file formatting (YAML, JSON, etc.)
- **Command**: `make dapperdata_check`
- **Purpose**: Validates markdown/JSON/YAML/config file formatting with prettier
- **Command**: `make prettier_check`

**tomlsort.yaml** - TOML File Sorting

Expand Down
27 changes: 14 additions & 13 deletions {{cookiecutter.__package_slug}}/docs/dev/makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ make uv

- Fixes linting issues with Ruff
- Formats code with Black (via Ruff)
- Formats data files with dapperdata
- Formats markdown/JSON/YAML/config files with prettier
- Sorts TOML files
{%- if cookiecutter.include_sqlalchemy == "y" %}
- Updates database schema documentation
Expand Down Expand Up @@ -197,21 +197,22 @@ make ruff_fixes
make black_fixes
```

### `make dapperdata_fixes`
### `make prettier_fixes`

**Purpose**: Format JSON and YAML data files.
**Purpose**: Format markdown, JSON, YAML, and other config files.

**What it does**:

- Pretty-prints JSON files
- Formats YAML files consistently
- Fixes indentation and structure
- Pretty-prints JSON files
- Formats markdown files
- Handles other supported file types (TOML, CSS, etc.)

**Usage**:

```bash
# Format data files
make dapperdata_fixes
# Format config and data files
make prettier_fixes
```

### `make tomlsort_fixes`
Expand Down Expand Up @@ -243,7 +244,7 @@ make tomlsort_fixes
3. Checks linting (ruff)
4. Checks formatting (black)
5. Runs type checking (mypy)
6. Checks data file formatting
6. Checks config/markdown formatting (prettier)
7. Checks TOML file sorting
{%- if cookiecutter.include_sqlalchemy == "y" %}
8. Verifies database schema documentation is up-to-date
Expand Down Expand Up @@ -363,20 +364,20 @@ make black_check
make mypy_check
```

### `make dapperdata_check`
### `make prettier_check`

**Purpose**: Check data file formatting without modifying.
**Purpose**: Check markdown, JSON, YAML, and config file formatting without modifying.

**What it does**:

- Verifies JSON/YAML files are properly formatted
- Verifies YAML/JSON/markdown files are properly formatted
- Exits with error if files need formatting

**Usage**:

```bash
# Check data file formatting
make dapperdata_check
# Check config and data file formatting
make prettier_check
```

### `make tomlsort_check`
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.__package_slug}}/docs/dev/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ Tests run automatically on every push and pull request via GitHub Actions. The C
2. **Checks code formatting** with ruff
3. **Performs type checking** with mypy
4. **Validates linting rules** with ruff
5. **Checks data formatting** with dapperdata
5. **Checks config/markdown formatting** with prettier
6. **Verifies TOML formatting** with toml-sort

See the [GitHub Actions documentation](./github.md) for more details on CI configuration.
Expand Down
20 changes: 10 additions & 10 deletions {{cookiecutter.__package_slug}}/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ pre-commit:

{%- if cookiecutter.include_sqlalchemy == "y" %}
.PHONY: chores
chores: ruff_fixes black_fixes dapperdata_fixes tomlsort_fixes document_schema
chores: ruff_fixes black_fixes prettier_fixes tomlsort_fixes document_schema
{%- else %}
.PHONY: chores
chores: ruff_fixes black_fixes dapperdata_fixes tomlsort_fixes
chores: ruff_fixes black_fixes prettier_fixes tomlsort_fixes
{%- endif %}

.PHONY: ruff_fixes
Expand All @@ -72,9 +72,9 @@ ruff_fixes:
black_fixes:
$(UV) run ruff format .

.PHONY: dapperdata_fixes
dapperdata_fixes:
$(UV) run python -m dapperdata.cli pretty . --no-dry-run
.PHONY: prettier_fixes
prettier_fixes:
npx --yes prettier --write . --log-level warn

.PHONY: tomlsort_fixes
tomlsort_fixes:
Expand All @@ -86,10 +86,10 @@ tomlsort_fixes:

{%- if cookiecutter.include_sqlalchemy == "y" %}
.PHONY: tests
tests: install pytest ruff_check black_check mypy_check dapperdata_check tomlsort_check paracelsus_check
tests: install pytest ruff_check black_check mypy_check prettier_check tomlsort_check paracelsus_check
{%- else %}
.PHONY: tests
tests: install pytest ruff_check black_check mypy_check dapperdata_check tomlsort_check
tests: install pytest ruff_check black_check mypy_check prettier_check tomlsort_check
{%- endif %}

.PHONY: pytest
Expand All @@ -112,9 +112,9 @@ black_check:
mypy_check:
$(UV) run mypy ${PACKAGE_SLUG}

.PHONY: dapperdata_check
dapperdata_check:
$(UV) run python -m dapperdata.cli pretty .
.PHONY: prettier_check
prettier_check:
npx --yes prettier --check . --log-level warn

.PHONY: tomlsort_check
tomlsort_check:
Expand Down
1 change: 0 additions & 1 deletion {{cookiecutter.__package_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ dependencies = [
[dependency-groups]
dev = [
"build",
"dapperdata",
"glom",
"greenlet",
{%- if cookiecutter.include_fastapi == "y" %}
Expand Down
Loading