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
5 changes: 5 additions & 0 deletions .github/bake.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Docs: https://github.com/EbodShojaei/bake

[formatter]
ensure_final_newline = true
auto_insert_phony_declarations = true
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ updates:
open-pull-requests-limit: 10
cooldown:
default-days: 7

- package-ecosystem: github-actions
directory: "/{{cookiecutter.project_name}}"
schedule:
interval: daily
time: "02:00"
open-pull-requests-limit: 10
cooldown:
default-days: 7
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v6
Expand Down
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ repos:
hooks:
- id: shellcheck

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff
args: ["--exit-non-zero-on-fix"]
- id: ruff-format

- repo: https://github.com/EbodShojaei/bake
rev: v1.4.4
hooks:
- id: mbake-format
args: ["--config=.github/bake.toml"]
- id: mbake-validate

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
Expand Down
3 changes: 2 additions & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def generate_license() -> None:
encoding='utf8',
) as license_file:
license_file.write(
license_result.strip()
license_result
.strip()
.replace(' \n ', ' \n')
.replace('\n \n', '\n\n'),
)
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 @@ -51,7 +51,7 @@ def _validate_deps() -> None:
_validate_deps,
)

for validator in validators:
for validator in validators: # noqa: WPS481
try:
validator()
except ValueError as ex: # noqa: PERF203
Expand Down
836 changes: 450 additions & 386 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@ requires = ["poetry-core>=2.0"]
build-backend = "poetry.core.masonry.api"


[project]
[tool.poetry]
name = "wemake-python-package"
description = "Bleeding edge cookiecutter template to create new python packages"
version = "0.1.0"
requires-python = ">=3.10,<3.14"
readme = "README.md"
authors = [
{ name = "Nikita Sobolev", email = "[email protected]" },
"Nikita Sobolev <[email protected]>",
]
license = "MIT"
dynamic = ["dependencies", "classifiers"]


[tool.poetry]
package-mode = false
classifiers = [
"Private :: Do not Upload",
]


[tool.poetry.dependencies]
python = "^3.10"
cookiecutter = "^2.6"
jinja2-git = "^1.4"
lice = "^0.6"
Expand All @@ -33,7 +29,7 @@ setuptools = "*"
binaryornot = "^0.4"
tomli = "^2.3"

wemake-python-styleguide = "^1.4"
wemake-python-styleguide = "^1.5"
ruff = "^0.14"

mypy = "^1.19"
Expand Down
8 changes: 3 additions & 5 deletions tests/test_project_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,14 @@ def test_pyproject_toml(cookies: Cookies, context: dict[str, str]) -> None:
(baked_project.project_path / 'pyproject.toml').read_text(),
)

project = pyproject['project']
poetry = pyproject['tool']['poetry']

assert project['name'] == context['project_name']
assert project['description'] == context['project_description']
assert project['repository'] == 'https://github.com/{}/{}'.format(
assert poetry['name'] == context['project_name']
assert poetry['description'] == context['project_description']
assert poetry['repository'] == 'https://github.com/{}/{}'.format(
context['organization'],
context['project_name'],
)
assert poetry


@pytest.mark.parametrize(
Expand Down
5 changes: 5 additions & 0 deletions {{cookiecutter.project_name}}/.github/bake.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Docs: https://github.com/EbodShojaei/bake

[formatter]
ensure_final_newline = true
auto_insert_phony_declarations = true
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v4
Expand Down
17 changes: 12 additions & 5 deletions {{cookiecutter.project_name}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
rev: 0.36.0
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-github-actions
- id: check-readthedocs

- repo: https://github.com/rhysd/actionlint
rev: v1.7.8
rev: v1.7.10
hooks:
- id: actionlint
additional_dependencies:
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@latest"

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.16.3
rev: v1.20.0
hooks:
- id: zizmor
args: ["--no-progress", "--fix"]
Expand All @@ -26,19 +26,26 @@ repos:
- id: shellcheck
args: ["--severity=style"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
rev: v0.14.10
hooks:
- id: ruff
args: ["--exit-non-zero-on-fix"]
- id: ruff-format

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.1
rev: v1.0.2
hooks:
- id: sphinx-lint
args: ["--enable=all"]
files: ^docs/

- repo: https://github.com/EbodShojaei/bake
rev: v1.4.4
hooks:
- id: mbake-format
args: ["--config=.github/bake.toml"]
- id: mbake-validate

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
Expand Down
3 changes: 1 addition & 2 deletions {{cookiecutter.project_name}}/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SHELL:=/usr/bin/env bash
SHELL := /usr/bin/env bash

.PHONY: lint
lint:
Expand All @@ -13,7 +13,6 @@ unit:

.PHONY: package
package:
poetry check
poetry run pip check

.PHONY: test
Expand Down
13 changes: 6 additions & 7 deletions {{cookiecutter.project_name}}/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
#

# You can set these variables from the command line.
SPHINXOPTS = -W
SPHINXBUILD = python -msphinx
SPHINXPROJ = {{cookiecutter.project_name}}
SOURCEDIR = .
BUILDDIR = _build
SPHINXOPTS = -W
SPHINXBUILD = python -msphinx
SPHINXPROJ = {{cookiecutter.project_name}}
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
.PHONY: help
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _get_project_meta() -> dict[str, str]:
pyproject = _ROOT / 'pyproject.toml'
return cast(
dict[str, str],
tomli.loads(pyproject.read_text())['project'],
tomli.loads(pyproject.read_text())['tool']['poetry'],
)


Expand Down
Loading