Skip to content

Commit bf0060f

Browse files
authoredFeb 22, 2024··
[pre-commit.ci] pre-commit autoupdate (#73)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6b82c74 commit bf0060f

File tree

8 files changed

+52
-39
lines changed

8 files changed

+52
-39
lines changed
 

‎.github/workflows/check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: check
22
on:
33
workflow_dispatch:
44
push:
5-
branches: "main"
5+
branches: ["main"]
66
tags-ignore: ["**"]
77
pull_request:
88
schedule:

‎.pre-commit-config.yaml

+15-8
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ repos:
44
hooks:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
7-
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: "v0.2.0"
7+
- repo: https://github.com/python-jsonschema/check-jsonschema
8+
rev: 0.28.0
99
hooks:
10-
- id: ruff
11-
args: [--fix, --exit-non-zero-on-fix]
12-
- repo: https://github.com/psf/black
13-
rev: 24.1.1
10+
- id: check-github-workflows
11+
args: [ "--verbose" ]
12+
- repo: https://github.com/codespell-project/codespell
13+
rev: v2.2.6
1414
hooks:
15-
- id: black
15+
- id: codespell
16+
additional_dependencies: ["tomli>=2.0.1"]
1617
- repo: https://github.com/tox-dev/tox-ini-fmt
1718
rev: "1.3.1"
1819
hooks:
@@ -22,7 +23,13 @@ repos:
2223
rev: "1.7.0"
2324
hooks:
2425
- id: pyproject-fmt
25-
additional_dependencies: ["tox>=4.11.4"]
26+
additional_dependencies: ["tox>=4.13"]
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: "v0.2.1"
29+
hooks:
30+
- id: ruff-format
31+
- id: ruff
32+
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
2633
- repo: meta
2734
hooks:
2835
- id: check-hooks-apply

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TRANSFORMED = {value = "{USER}/alpha", transform = true}
3030
SKIP_IF_SET = {value = "on", skip_if_set = true}
3131
```
3232

33-
The `tool.pytest_env` tables keys are the environment variables keys to set. The right hands-ide of the assigment:
33+
The `tool.pytest_env` tables keys are the environment variables keys to set. The right hand side of the assignment:
3434

3535
- if an inline table you can set options via the `transform` or `skip_if_set` keys, while the `value` key holds the
3636
value to set (or transform before setting). For transformation the variables you can use is other environment

‎pyproject.toml

+29-24
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs>=0.4",
5-
"hatchling>=1.18",
5+
"hatchling>=1.21.1",
66
]
77

88
[project]
@@ -35,12 +35,12 @@ dynamic = [
3535
"version",
3636
]
3737
dependencies = [
38-
"pytest>=7.4.3",
38+
"pytest>=8.0.1",
3939
'tomli>=2.0.1; python_version < "3.11"',
4040
]
4141
optional-dependencies.test = [
4242
"covdefaults>=2.3",
43-
"coverage>=7.3.2",
43+
"coverage>=7.4.2",
4444
"pytest-mock>=3.12",
4545
]
4646
urls.Homepage = "https://github.com/pytest-dev/pytest-env"
@@ -53,34 +53,39 @@ env = "pytest_env.plugin"
5353
build.hooks.vcs.version-file = "src/pytest_env/version.py"
5454
version.source = "vcs"
5555

56-
[tool.black]
57-
line-length = 120
58-
5956
[tool.ruff]
60-
select = ["ALL"]
6157
line-length = 120
6258
target-version = "py38"
63-
isort = {known-first-party = ["pytest_env"], required-imports = ["from __future__ import annotations"]}
64-
ignore = [
65-
"ANN101", # no type annotation for self
66-
"ANN401", # allow Any as type annotation
67-
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
68-
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
69-
"S104", # Possible binding to all interface
59+
lint.isort = { known-first-party = ["pytest_env"], required-imports = ["from __future__ import annotations"] }
60+
lint.select = ["ALL"]
61+
lint.ignore = [
62+
"ANN101", # no type annotation for self
63+
"ANN401", # allow Any as type annotation
64+
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
65+
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
66+
"S104", # Possible binding to all interface
67+
"COM812", # Conflict with formatter
68+
"ISC001", # Conflict with formatter
69+
"CPY", # No copyright statements
7070
]
71-
[tool.ruff.per-file-ignores]
71+
lint.preview = true
72+
format.preview = true
73+
format.docstring-code-format = true
74+
format.docstring-code-line-length = 100
75+
[tool.ruff.lint.per-file-ignores]
7276
"tests/**/*.py" = [
73-
"S101", # asserts allowed in tests...
74-
"FBT", # don"t care about booleans as positional arguments in tests
75-
"INP001", # no implicit namespace
76-
"D", # don"t care about documentation in tests
77-
"S603", # `subprocess` call: check for execution of untrusted input
78-
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
77+
"S101", # asserts allowed in tests...
78+
"FBT", # don"t care about booleans as positional arguments in tests
79+
"INP001", # no implicit namespace
80+
"D", # don"t care about documentation in tests
81+
"S603", # `subprocess` call: check for execution of untrusted input
82+
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
7983
]
8084

81-
[tool.isort]
82-
profile = "black"
83-
known_first_party = ["pytest_env"]
85+
[tool.codespell]
86+
builtin = "clear,usage,en-GB_to_en-US"
87+
write-changes = true
88+
count = true
8489

8590
[tool.coverage]
8691
run.source = ["pytest_env", "tests"]

‎src/pytest_env/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def pytest_load_initial_conftests(
4848

4949
def _load_values(early_config: pytest.Config) -> Iterator[Entry]:
5050
has_toml_conf = False
51-
for path in chain.from_iterable([[early_config.rootpath], early_config.rootpath.parents]):
51+
for path in chain.from_iterable([[early_config.rootpath], early_config.rootpath.parents]): # noqa: PLR1702
5252
toml_file = path / "pyproject.toml"
5353
if toml_file.exists():
5454
with toml_file.open("rb") as file_handler:

‎tests/test_env.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def test_env_via_pytest(
158158
),
159159
],
160160
)
161-
def test_env_via_toml( # noqa: PLR0913
161+
def test_env_via_toml( # noqa: PLR0913, PLR0917
162162
testdir: pytest.Testdir,
163163
env: dict[str, str],
164164
toml: str,

‎tests/test_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33

44
def test_version() -> None:
5-
import pytest_env
5+
import pytest_env # noqa: PLC0415
66

77
assert pytest_env.__version__ is not None

‎tox.ini

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ commands =
4343
[testenv:type]
4444
description = run type check on code base
4545
deps =
46-
mypy==1.7.1
46+
mypy==1.8
4747
set_env =
4848
{tty:MYPY_FORCE_COLOR = 1}
4949
commands =
@@ -55,7 +55,7 @@ description = check that the long description is valid
5555
skip_install = true
5656
deps =
5757
build[virtualenv]>=1.0.3
58-
twine>=4.0.2
58+
twine>=5
5959
change_dir = {toxinidir}
6060
commands =
6161
python -m build -o {envtmpdir} .
@@ -69,3 +69,4 @@ extras =
6969
commands =
7070
python -m pip list --format=columns
7171
python -c 'import sys; print(sys.executable)'
72+
uv_seed = true

0 commit comments

Comments
 (0)
Please sign in to comment.