Skip to content

[pre-commit] Add pyproject-fmt, migrate from flake8 to ruff #970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 24, 2024
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
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ repos:
hooks:
- id: check-merge-conflict
exclude: rst$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: ruff
args: [--fix]
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
Expand Down Expand Up @@ -43,11 +48,6 @@ repos:
exclude: ^(docs|tests)/.*
additional_dependencies:
- pytest
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
Expand All @@ -68,6 +68,12 @@ repos:
rev: 0.29.3
hooks:
- id: check-github-actions
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.3.1
hooks:
- id: pyproject-fmt
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
additional_dependencies: [tox>=4.9]
ci:
skip:
- actionlint-docker
Expand Down
15 changes: 12 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
[build-system]
build-backend = "setuptools.build_meta"

requires = [
"setuptools>=51.0",
"setuptools>=51",
"setuptools-scm[toml]>=6.2",
"wheel>=0.36",
"setuptools_scm[toml]>=6.2"
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "pytest_asyncio/_version.py"

[tool.ruff]
line-length = 88
lint.select = [
"E", # pycodestyle
"F", # pyflakes
"W", # pycodestyle
]
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,3 @@ junit_family=xunit2
filterwarnings =
error
ignore:The event_loop fixture provided by pytest-asyncio has been redefined.*:DeprecationWarning

[flake8]
max-line-length = 88
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
minversion = 3.14.0
minversion = 4.9.0
envlist = py39, py310, py311, py312, py13, pytest-min, docs
isolated_build = true
passenv =
Expand Down