-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cookiecutters: Use ruff and uv. Simplify coverage.
- build: Add .python-version. Use coverage directly, instead of pytest-cov. Remove linters from dev requirements. - ci: Use official coveralls action. Test on PyPy 3.10. - chore: Switch to ruff and uv. ci: Add pre-commit job to automerge workflow, for consistency chore: Switch to pyproject.toml
- Loading branch information
1 parent
565ae17
commit 82048eb
Showing
30 changed files
with
211 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ jobs: | |
cache: pip | ||
cache-dependency-path: '**/requirements*.txt' | ||
- id: changed-files | ||
uses: tj-actions/changed-files@v40 | ||
- uses: pre-commit/[email protected].0 | ||
uses: tj-actions/changed-files@v45 | ||
- uses: pre-commit/[email protected].1 | ||
continue-on-error: true | ||
with: | ||
extra_args: pip-compile --files ${{ steps.changed-files.outputs.all_changed_files }} | ||
|
27 changes: 10 additions & 17 deletions
27
cookiecutter-django/{{cookiecutter.project_slug}}/.pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
ci: | ||
autoupdate_schedule: quarterly | ||
skip: [pip-compile] | ||
default_language_version: | ||
python: python3.11 | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.3 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-comprehensions] | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/jazzband/pip-tools | ||
rev: 7.3.0 | ||
- id: ruff | ||
- id: ruff-format | ||
- repo: https://github.com/astral-sh/uv-pre-commit | ||
rev: 0.4.4 | ||
hooks: | ||
- id: pip-compile | ||
name: pip-compile requirements.in | ||
files: ^requirements\.(in|txt)$ | ||
args: [requirements.in, -o, requirements.txt] | ||
- id: pip-compile | ||
name: pip-compile requirements_dev.in | ||
args: [requirements_dev.in, -o, requirements_dev.txt] | ||
files: ^requirements(_dev)?\.(in|txt)$ | ||
args: [requirements_dev.in] | ||
exclude: /migrations/ |
1 change: 1 addition & 0 deletions
1
cookiecutter-django/{{cookiecutter.project_slug}}/.python-version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11 |
39 changes: 33 additions & 6 deletions
39
cookiecutter-django/{{cookiecutter.project_slug}}/pyproject.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,38 @@ | ||
[tool.black] | ||
[project] | ||
name = "{{ cookiecutter.project_slug }}" | ||
version = "0.0.0" | ||
|
||
[tool.ruff] | ||
line-length = 119 | ||
exclude = '/(migrations|node_modules)/' | ||
target-version = "py311" | ||
|
||
[tool.ruff.lint] | ||
select = ["ALL"] | ||
ignore = [ | ||
"ANN", "COM", "EM", | ||
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules | ||
"W191", "D206", "Q000", "Q001", "Q002", "Q003", "ISC001", | ||
"D203", "D212", # ignore incompatible rules | ||
"D200", "D205", # documentation preferences | ||
"C901", "PLR091", # complexity preferences | ||
"ARG001", "ARG002", "DJ008", "RUF012", "SLF001", # Django | ||
] | ||
|
||
[tool.ruff.lint.flake8-builtins] | ||
builtins-ignorelist = ["copyright"] | ||
|
||
[tool.isort] | ||
profile = 'black' | ||
line_length = 119 | ||
skip = ['migrations'] | ||
[tool.ruff.lint.per-file-ignores] | ||
"docs/conf.py" = ["INP001"] # no __init__.py file | ||
"*/management/commands/*" = ["INP001"] # no __init__.py file | ||
"*/migrations/*" = ["E501"] | ||
"tests/*" = [ | ||
"D", # docstring | ||
"ARG001", # pytest fixtures | ||
"PLR0913", # Too many arguments | ||
"PLR2004", # Magic value used | ||
"PT", # Django | ||
"S101", # assert | ||
] | ||
|
||
[tool.coverage.run] | ||
omit = ['*/migrations/*'] |
8 changes: 2 additions & 6 deletions
8
cookiecutter-django/{{cookiecutter.project_slug}}/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
cookiecutter-django/{{cookiecutter.project_slug}}/requirements_dev.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
-r requirements.txt | ||
black | ||
coverage | ||
coveralls | ||
flake8 | ||
isort | ||
pip-tools | ||
pre-commit |
86 changes: 3 additions & 83 deletions
86
cookiecutter-django/{{cookiecutter.project_slug}}/requirements_dev.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,34 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python {{ cookiecutter.python_version }} | ||
# by the following command: | ||
# | ||
# pip-compile requirements_dev.in | ||
# | ||
# This file was autogenerated by uv via the following command: | ||
# uv pip compile requirements_dev.in -o requirements_dev.txt | ||
asgiref==3.7.2 | ||
# via | ||
# -r requirements.txt | ||
# django | ||
backports-entry-points-selectable==1.1.1 | ||
# via virtualenv | ||
black==24.3.0 | ||
# via -r requirements_dev.in | ||
build==1.0.3 | ||
# via pip-tools | ||
certifi==2024.7.4 | ||
# via | ||
# -r requirements.txt | ||
# requests | ||
# sentry-sdk | ||
cfgv==3.3.1 | ||
# via pre-commit | ||
charset-normalizer==2.0.7 | ||
# via requests | ||
click==8.0.3 | ||
# via | ||
# black | ||
# pip-tools | ||
coverage[toml]==6.1.2 | ||
# via | ||
# -r requirements_dev.in | ||
# coveralls | ||
coveralls==4.0.1 | ||
coverage==7.6.1 | ||
# via -r requirements_dev.in | ||
distlib==0.3.3 | ||
# via virtualenv | ||
dj-database-url==2.1.0 | ||
# via -r requirements.txt | ||
django==4.2.15 | ||
# via | ||
# -r requirements.txt | ||
# dj-database-url | ||
docopt==0.6.2 | ||
# via coveralls | ||
filelock==3.4.0 | ||
# via virtualenv | ||
flake8==4.0.1 | ||
# via -r requirements_dev.in | ||
identify==2.3.6 | ||
# via pre-commit | ||
idna==3.7 | ||
# via requests | ||
isort==5.10.1 | ||
# via -r requirements_dev.in | ||
mccabe==0.6.1 | ||
# via flake8 | ||
mypy-extensions==0.4.3 | ||
# via black | ||
nodeenv==1.6.0 | ||
# via pre-commit | ||
packaging==23.2 | ||
# via | ||
# black | ||
# build | ||
pathspec==0.9.0 | ||
# via black | ||
pip-tools==7.3.0 | ||
# via -r requirements_dev.in | ||
platformdirs==2.4.0 | ||
# via | ||
# black | ||
# virtualenv | ||
pre-commit==3.6.0 | ||
# via -r requirements_dev.in | ||
psycopg2==2.9.2 | ||
# via -r requirements.txt | ||
pycodestyle==2.8.0 | ||
# via flake8 | ||
pyflakes==2.4.0 | ||
# via flake8 | ||
pyproject-hooks==1.0.0 | ||
# via build | ||
pyyaml==6.0 | ||
# via pre-commit | ||
requests==2.32.2 | ||
# via coveralls | ||
sentry-sdk==2.10.0 | ||
# via -r requirements.txt | ||
six==1.16.0 | ||
# via virtualenv | ||
sqlparse==0.5.0 | ||
# via | ||
# -r requirements.txt | ||
# django | ||
tomli==1.2.2 | ||
# via coverage | ||
typing-extensions==4.9.0 | ||
# via | ||
# -r requirements.txt | ||
# dj-database-url | ||
urllib3==2.2.2 | ||
# via | ||
# -r requirements.txt | ||
# requests | ||
# sentry-sdk | ||
virtualenv==20.10.0 | ||
# via pre-commit | ||
wheel==0.38.1 | ||
# via pip-tools | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
# pip | ||
# setuptools |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 4 additions & 18 deletions
22
cookiecutter-pypackage/{{cookiecutter.repository_name}}/.pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
ci: | ||
autoupdate_schedule: quarterly | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.3 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-comprehensions] | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/pycqa/pydocstyle | ||
rev: 6.3.0 | ||
hooks: | ||
- id: pydocstyle | ||
additional_dependencies: [toml] | ||
files: ^(?!tests) | ||
- id: ruff | ||
- id: ruff-format |
Oops, something went wrong.