Skip to content

Commit 90d599a

Browse files
committed
Update project template cruft, dependencies
Applied updates from upstream project template commits: 7025e55...9a783dd * 9a783dd Merge pull request #120 from smkent/ruff |\ | * 5f80cc9 Update README.md for migration to `ruff` |/ * a462a7d Merge pull request #119 from smkent/ruff |\ | * 37e016c Move `ruff` select config to correct section |/ * 58fcbd7 Merge pull request #118 from smkent/update |\ | * 08c7942 Update pre-commit hook versions in template | * 4982dd0 Update template `.pre-commit-config.yaml` whitespace | * dc91253 Replace multiple Python linters with `ruff` | * 9288b41 Update Poetry, Python versions in template |/ * e7df558 Merge pull request #117 from smkent/manage-cookie * 0200edc Update project template cruft, dependencies Updated project dependencies via `poetry update`: Package operations: 3 installs, 41 updates, 17 removals - Removing astor (0.8.1) - Removing attrs (25.3.0) - Removing black (25.1.0) - Removing deprecated (1.2.18) - Removing flake8 (7.2.0) - Removing flake8-bugbear (24.12.12) - Removing flake8-pyproject (1.2.3) - Removing flake8-simplify (0.21.0) - Removing isort (6.0.1) - Removing mccabe (0.7.0) - Removing pbr (6.1.1) - Removing pep8-naming (0.15.1) - Removing pycodestyle (2.13.0) - Removing pyflakes (3.3.2) - Removing setuptools (80.9.0) - Removing types-python-dateutil (2.9.0.20250516) - Removing wrapt (1.17.2) - Updating pycparser (2.22 -> 2.23) - Updating certifi (2025.4.26 -> 2026.1.4) - Updating cffi (1.17.1 -> 2.0.0) - Updating charset-normalizer (3.4.2 -> 3.4.4) - Updating idna (3.10 -> 3.11) - Updating markdown-it-py (3.0.0 -> 4.0.0) - Updating markupsafe (3.0.2 -> 3.0.3) - Updating pygments (2.19.1 -> 2.19.2) - Installing tzdata (2025.3) - Updating urllib3 (2.4.0 -> 2.6.3) - Updating arrow (1.3.0 -> 1.4.0) - Updating click (8.1.8 -> 8.3.1) - Updating cryptography (43.0.3 -> 46.0.3) - Updating distlib (0.3.9 -> 0.4.0) - Updating filelock (3.18.0 -> 3.20.3) - Updating iniconfig (2.1.0 -> 2.3.0) - Updating platformdirs (4.3.8 -> 4.5.1) - Updating pyyaml (6.0.2 -> 6.0.3) - Updating requests (2.32.3 -> 2.32.5) - Updating rich (14.0.0 -> 14.2.0) - Updating typing-extensions (4.13.2 -> 4.15.0) - Updating cfgv (3.4.0 -> 3.5.0) - Updating coverage (7.8.2 -> 7.13.1) - Updating identify (2.6.12 -> 2.6.16) - Updating gitpython (3.1.44 -> 3.1.46) - Installing librt (0.7.7) - Updating pynacl (1.5.0 -> 1.6.2) - Updating pathspec (0.12.1 -> 1.0.3) - Updating nodeenv (1.9.1 -> 1.10.0) - Updating stevedore (5.4.1 -> 5.6.0) - Updating termcolor (3.1.0 -> 3.3.0) - Updating typer (0.16.0 -> 0.21.1) - Updating pytest (8.3.5 -> 9.0.2) - Updating virtualenv (20.31.2 -> 20.36.1) - Updating bandit (1.8.3 -> 1.9.2) - Updating build (1.2.2.post1 -> 1.4.0) - Updating mypy (1.16.0 -> 1.19.1) - Updating poethepoet (0.34.0 -> 0.40.0) - Updating pre-commit (4.2.0 -> 4.5.1) - Updating pygithub (2.6.1 -> 2.8.1) - Updating pytest-cov (6.1.1 -> 7.0.0) - Updating pytest-sugar (1.0.0 -> 1.1.1) - Installing ruff (0.14.11) - Updating types-pyyaml (6.0.12.20250516 -> 6.0.12.20250915) Writing lock file
1 parent 9a783dd commit 90d599a

File tree

14 files changed

+1025
-1107
lines changed

14 files changed

+1025
-1107
lines changed

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": ".",
3-
"commit": "7025e55adab820dd8e63d8be0e0ec0cabad0d830",
3+
"commit": "9a783dd51cc0195a994c510e5f0eeb2d730a7e49",
44
"context": {
55
"cookiecutter": {
66
"project_name": "cookie-python",
@@ -14,7 +14,7 @@
1414
"author_email": "smkent@smkent.net",
1515
"github_user": "smkent",
1616
"_template": ".",
17-
"_commit": "7025e55adab820dd8e63d8be0e0ec0cabad0d830"
17+
"_commit": "9a783dd51cc0195a994c510e5f0eeb2d730a7e49"
1818
}
1919
},
2020
"directory": null,

.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: Release
44
env:
55
ENABLE_PYPI_PUBLISH: true
66
ENABLE_TEST_PYPI_PUBLISH: false
7-
RELEASE_PYTHON_VERSION: "3.12"
8-
RELEASE_POETRY_VERSION: "2.0"
7+
RELEASE_PYTHON_VERSION: "3.14"
8+
RELEASE_POETRY_VERSION: "2.2"
99

1010
on:
1111
push:

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
- "3.11"
2626
- "3.12"
2727
- "3.13"
28+
- "3.14"
2829
poetry-version:
29-
- "2.0"
30+
- "2.2"
3031

3132
runs-on: ${{ matrix.os }}-latest
3233
steps:

.pre-commit-config.yaml

Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,30 @@
11
exclude: '^{{cookiecutter.project_name}}/'
22
repos:
3-
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v5.0.0
5-
hooks:
6-
- id: check-yaml
7-
- id: check-merge-conflict
8-
- id: debug-statements
9-
- id: end-of-file-fixer
10-
- id: trailing-whitespace
11-
- repo: https://github.com/psf/black
12-
rev: 25.1.0
13-
hooks:
14-
- id: black
15-
args: ["--config", "pyproject.toml"]
16-
- repo: https://github.com/pycqa/isort
17-
rev: 6.0.1
18-
hooks:
19-
- id: isort
20-
args: ["--show-config"]
21-
- repo: https://github.com/pycqa/bandit
22-
rev: 1.8.3
23-
hooks:
24-
- id: bandit
25-
additional_dependencies: ['.[toml]']
26-
args: ["--configfile", "pyproject.toml"]
27-
exclude: '^tests/'
28-
- repo: https://github.com/pycqa/flake8
29-
rev: 7.2.0
30-
hooks:
31-
- id: flake8
32-
additional_dependencies:
33-
- flake8-bugbear
34-
- flake8-pyproject
35-
- flake8-simplify
36-
- pep8-naming
37-
- repo: https://github.com/pycqa/autoflake
38-
rev: v2.3.1
39-
hooks:
40-
- id: autoflake
41-
- repo: https://github.com/asottile/pyupgrade
42-
rev: v3.20.0
43-
hooks:
44-
- id: pyupgrade
45-
args: ["--py39-plus", "--keep-runtime-typing"]
46-
- repo: local
47-
hooks:
48-
- id: mypy
49-
name: mypy
50-
language: python
51-
types_or: [python, pyi]
52-
entry: env -u VIRTUAL_ENV poetry run mypy
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v6.0.0
5+
hooks:
6+
- id: check-yaml
7+
- id: check-merge-conflict
8+
- id: debug-statements
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.14.11
13+
hooks:
14+
- id: ruff
15+
args: ["--fix"]
16+
- id: ruff-format
17+
- repo: https://github.com/pycqa/bandit
18+
rev: 1.9.2
19+
hooks:
20+
- id: bandit
21+
additional_dependencies: ['.[toml]']
22+
args: ["--configfile", "pyproject.toml"]
23+
exclude: '^tests/'
24+
- repo: local
25+
hooks:
26+
- id: mypy
27+
name: mypy
28+
language: python
29+
types_or: [python, pyi]
30+
entry: env -u VIRTUAL_ENV poetry run mypy

cookie_python/manage/github.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import contextlib
22
import os
33
from functools import cached_property, lru_cache
4-
from typing import Optional
54

65
import github
76
from github.PullRequest import PullRequest
@@ -27,11 +26,12 @@ def find_repo(self, search: str) -> Repository:
2726

2827
def find_pr(
2928
self, repo: Repository, head: str, base: str = "main"
30-
) -> Optional[PullRequest]:
29+
) -> PullRequest | None:
3130
pulls = [
3231
pr
3332
for pr in repo.get_pulls(
34-
head=f"{self.username}:{head}", base=base # noqa: E231
33+
head=f"{self.username}:{head}",
34+
base=base, # noqa: E231
3535
)
3636
]
3737
if not pulls:

cookie_python/manage/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import argparse
44
import sys
5+
from collections.abc import Callable
56
from enum import Enum
67
from pathlib import Path
7-
from typing import Callable
88

99
from loguru import logger
1010

cookie_python/manage/update.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
from pathlib import Path
3-
from typing import Optional
43

54
from .repo import RepoSandbox
65

@@ -13,7 +12,7 @@ def reset_cruft_json(repo: RepoSandbox) -> None:
1312
)
1413

1514

16-
def update_cruft(repo: RepoSandbox) -> Optional[str]:
15+
def update_cruft(repo: RepoSandbox) -> str | None:
1716
before_ref = repo.cruft_attr("commit")
1817
repo.run(["poetry", "env", "remove", "--all"], check=False)
1918
repo.run(["poetry", "env", "use", "/usr/bin/python3"])
@@ -87,7 +86,7 @@ def update_cruft(repo: RepoSandbox) -> Optional[str]:
8786
)
8887

8988

90-
def update_dependencies(repo: RepoSandbox) -> Optional[str]:
89+
def update_dependencies(repo: RepoSandbox) -> str | None:
9190
repo.run(["poetry", "run", "pre-commit", "autoupdate"])
9291
updates = repo.run(
9392
["poetry", "update", "--no-cache"], capture_output=True

cookie_python/new.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ def locate_new_project(parent_dir: str) -> str:
5454
.strip()
5555
== "?? .cruft.json"
5656
), f"Detected project directory {sub_dir} has unexpected contents"
57-
assert (
58-
time.time() - os.stat(sub_dir).st_ctime < 60
59-
), f"Detected project directory {sub_dir} was not created just now"
57+
assert time.time() - os.stat(sub_dir).st_ctime < 60, (
58+
f"Detected project directory {sub_dir}"
59+
" was not created just now"
60+
)
6061
return sub_dir
6162
raise Exception("Unable to locate newly-created project directory")
6263

0 commit comments

Comments
 (0)