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
19 changes: 17 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ on:

jobs:

run-type-checking:

name: Run tests for type-checking
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
allow-prereleases: true
cache: pip
- run: pip install tox-uv
- run: tox -e typing

run-tests:

name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
Expand All @@ -24,7 +39,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand All @@ -35,7 +50,7 @@ jobs:
allow-prereleases: true
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.22.0
pixi-version: v0.39.4
run-install: false

- run: pip install tox-uv
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,4 @@ dist

.ruff_cache
.mypy_cache
uv.lock
36 changes: 15 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ci:
skip: [typing]

exclude: |
(?x)^(
{{cookiecutter.project_slug}}/tests/test_import.py
Expand All @@ -15,7 +18,6 @@ repos:
- id: check-yaml
exclude: |
(?x)^(
{{cookiecutter.project_slug}}/environment.yml|
{{cookiecutter.project_slug}}/.pre-commit-config.yaml
)$
- id: debug-statements
Expand All @@ -34,10 +36,6 @@ repos:
- id: python-no-log-warn
- id: python-use-type-annotations
- id: text-unicode-replacement-char
- repo: https://github.com/aio-libs/sort-all
rev: v1.3.0
hooks:
- id: sort-all
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
Expand All @@ -46,18 +44,13 @@ repos:
pass_filenames: false
- id: ruff-format
args: [--config, pyproject.toml]
- repo: https://github.com/dosisod/refurb
rev: v2.0.0
hooks:
- id: refurb
exclude: ({{cookiecutter.project_slug}})
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.21
hooks:
- id: mdformat
additional_dependencies: [
mdformat-gfm,
mdformat-black,
mdformat-ruff,
]
args: [--wrap, "88"]
files: (README\.md)
Expand All @@ -71,22 +64,23 @@ repos:
- id: mdformat
additional_dependencies: [
mdformat-myst,
mdformat-black,
mdformat-ruff,
]
args: [--wrap, "88"]
files: (docs/.)
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: [tomli]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.14.0'
- repo: https://github.com/crate-ci/typos
rev: v1.28.4
hooks:
- id: mypy
pass_filenames: false
- id: typos
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
# - id: identity # Prints all files passed to pre-commits. Debugging.
- repo: local
hooks:
- id: typing
name: typing
language: system
entry: uv run tox -e typing
pass_filenames: false
1 change: 0 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"python_version": "3.10",
"add_tox": ["yes", "no"],
"add_github_actions": ["yes", "no"],
"add_mypy": ["yes", "no"],
"add_readthedocs": ["yes", "no"],
"open_source_license": [
"MIT",
Expand Down
7 changes: 6 additions & 1 deletion docs/source/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
This is a record of all past cookiecutter-pytask-project releases and what went into
them in reverse chronological order.

## 1.7.0 - 2024-xx-xx
## 1.8.0 - 2024-12-24

- {pull}`52` updates the template in many different ways. Better pre-commit hooks,
better integration with pixi, mypy is not optional anymore, etc..

## 1.7.0 - 2024-05-03

- {pull}`39` updates the pre-commit hooks.
- {pull}`41` updates the infrastructure.
Expand Down
2 changes: 1 addition & 1 deletion hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]*$"
ENVIRON_REGEX = r"^[-_a-zA-Z0-9]*$"
PYTHONVERSION_REGEX = r"^(3\.(1[0-9]|[8-9])(\.[0-9]{1,2})?)$"
PYTHONVERSION_MIN = "3.8"
PYTHONVERSION_MIN = "3.9"

EXCEPTION_MSG_MODULE_NAME = """
ERROR: The project slug ({module_name}) is not a valid Python module name.
Expand Down
15 changes: 6 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ classifiers = [
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Build Tools",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = ["cookiecutter"]

[[project.authors]]
name = "Tobias Raabe"
email = "raabe@posteo.de"

[tool.uv]
dev-dependencies = ["tox-uv>=1.7.0"]

[project.optional-dependencies]
docs = [
"furo",
Expand All @@ -36,6 +39,7 @@ docs = [
"sphinxext-opengraph",
]
test = ["pytest", "pytest-cookies", "pytest-cov"]
typing = ["mypy"]

[project.readme]
file = "README.md"
Expand All @@ -51,13 +55,6 @@ Documentation = "https://cookiecutter-pytask-project.readthedocs.io/en/latest"
Github = "https://github.com/pytask-dev/cookiecutter-pytask-project"
Tracker = "https://github.com/pytask-dev/cookiecutter-pytask-project/issues"

[tool.rye]
managed = true
virtual = true
dev-dependencies = [
"tox-uv>=1.8.2",
]

[tool.mypy]
files = ["hooks", "tests"]
exclude = "{{cookiecutter.project_slug}}"
Expand All @@ -75,7 +72,7 @@ disallow_untyped_defs = false
ignore_errors = true

[tool.ruff]
target-version = "py38"
target-version = "py39"
fix = true
unsafe-fixes = true

Expand Down
80 changes: 0 additions & 80 deletions requirements-dev.lock

This file was deleted.

52 changes: 0 additions & 52 deletions requirements.lock

This file was deleted.

17 changes: 15 additions & 2 deletions {{cookiecutter.project_slug}}/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ on:

jobs:

run-type-checking:

name: Run tests for type-checking
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.39.4
cache: true
- run: pixi run typing

run-tests:

name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
Expand All @@ -28,9 +41,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.7.0
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.22.0
pixi-version: v0.39.4
cache: true

- name: Run tests and doctests.
Expand Down
Loading