Skip to content

Commit 6e9f62a

Browse files
[pre-commit.ci] pre-commit autoupdate (#30)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tobias Raabe <[email protected]>
1 parent 687a694 commit 6e9f62a

File tree

9 files changed

+49
-60
lines changed

9 files changed

+49
-60
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
30-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
30+
python-version: ['3.8', '3.9', '3.10', '3.11']
3131

3232
steps:
3333
- uses: actions/checkout@v4

.pre-commit-config.yaml

+12-12
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ repos:
2727
- id: python-no-log-warn
2828
- id: python-use-type-annotations
2929
- id: text-unicode-replacement-char
30-
- repo: https://github.com/asottile/reorder_python_imports
31-
rev: v3.9.0
30+
- repo: https://github.com/asottile/reorder-python-imports
31+
rev: v3.12.0
3232
hooks:
3333
- id: reorder-python-imports
3434
args:
35-
- --py37-plus
35+
- --py38-plus
3636
- --add-import
3737
- from __future__ import annotations
3838
- repo: https://github.com/asottile/setup-cfg-fmt
39-
rev: v2.2.0
39+
rev: v2.5.0
4040
hooks:
4141
- id: setup-cfg-fmt
4242
- repo: https://github.com/PyCQA/docformatter
43-
rev: v1.6.0.rc1
43+
rev: v1.7.5
4444
hooks:
4545
- id: docformatter
4646
args:
@@ -51,15 +51,15 @@ repos:
5151
- '88'
5252
- --blank
5353
- repo: https://github.com/psf/black
54-
rev: 22.12.0
54+
rev: 23.9.1
5555
hooks:
5656
- id: black
57-
- repo: https://github.com/charliermarsh/ruff-pre-commit
58-
rev: v0.0.228
57+
- repo: https://github.com/astral-sh/ruff-pre-commit
58+
rev: v0.0.292
5959
hooks:
6060
- id: ruff
6161
- repo: https://github.com/dosisod/refurb
62-
rev: v1.10.0
62+
rev: v1.21.0
6363
hooks:
6464
- id: refurb
6565
args:
@@ -75,7 +75,7 @@ repos:
7575
- src
7676
- tests
7777
- repo: https://github.com/executablebooks/mdformat
78-
rev: 0.7.16
78+
rev: 0.7.17
7979
hooks:
8080
- id: mdformat
8181
additional_dependencies:
@@ -85,11 +85,11 @@ repos:
8585
- --wrap
8686
- '88'
8787
- repo: https://github.com/codespell-project/codespell
88-
rev: v2.2.2
88+
rev: v2.2.6
8989
hooks:
9090
- id: codespell
9191
- repo: https://github.com/pre-commit/mirrors-mypy
92-
rev: v0.991
92+
rev: v1.5.1
9393
hooks:
9494
- id: mypy
9595
args:

environment.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ channels:
55
- nodefaults
66

77
dependencies:
8-
- python >=3.7
8+
- python >=3.8
99
- pip
1010
- setuptools_scm
1111
- toml
1212

1313
# Package dependencies
14-
- pytask >=0.3
15-
- pytask-parallel >=0.3
14+
- pytask <0.4
15+
- pytask-parallel <0.4
1616

1717
# Misc
1818
- black

pyproject.toml

+15-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ ignore_errors = true
2525

2626

2727
[tool.ruff]
28-
target-version = "py37"
28+
target-version = "py38"
2929
select = ["ALL"]
3030
fix = true
3131
extend-ignore = [
32+
"I", # ignore isort
33+
"TRY",
3234
# Numpy docstyle
3335
"D107",
3436
"D203",
@@ -44,7 +46,6 @@ extend-ignore = [
4446
"RET504", # unnecessary variable assignment before return.
4547
"S101", # raise errors for asserts.
4648
"B905", # strict parameter for zip that was implemented in py310.
47-
"I", # ignore isort
4849
"ANN101", # type annotating self
4950
"ANN102", # type annotating cls
5051
"FBT", # flake8-boolean-trap
@@ -62,3 +63,15 @@ extend-ignore = [
6263

6364
[tool.ruff.pydocstyle]
6465
convention = "numpy"
66+
67+
68+
[tool.pytest.ini_options]
69+
# Do not add src since it messes with the loading of pytask-parallel as a plugin.
70+
testpaths = ["tests"]
71+
markers = [
72+
"wip: Tests that are work-in-progress.",
73+
"unit: Flag for unit tests which target mainly a single function.",
74+
"integration: Flag for integration tests which may comprise of multiple unit tests.",
75+
"end_to_end: Flag for tests that cover the whole program.",
76+
]
77+
norecursedirs = [".idea", ".tox"]

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ url = https://github.com/pytask-dev/pytask-stata
77
author = Tobias Raabe
88
author_email = [email protected]
99
license = MIT
10-
license_file = LICENSE
10+
license_files = LICENSE
1111
platforms = any
1212
classifiers =
1313
Development Status :: 4 - Beta
@@ -26,7 +26,7 @@ packages = find:
2626
install_requires =
2727
click
2828
pytask>=0.3
29-
python_requires = >=3.7
29+
python_requires = >=3.8
3030
include_package_data = True
3131
package_dir = =src
3232
zip_safe = False

src/pytask_stata/collect.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import functools
55
import subprocess
6-
from pathlib import Path
76
from types import FunctionType
87
from typing import Any
8+
from typing import TYPE_CHECKING
99

1010
from pytask import depends_on
1111
from pytask import has_mark
@@ -19,14 +19,17 @@
1919
from pytask_stata.shared import convert_task_id_to_name_of_log_file
2020
from pytask_stata.shared import stata
2121

22+
if TYPE_CHECKING:
23+
from pathlib import Path
24+
2225

2326
def run_stata_script(
2427
executable: str, script: Path, options: list[str], log_name: list[str], cwd: Path
2528
) -> None:
2629
"""Run an R script."""
2730
cmd = [executable, "-e", "do", script.as_posix(), *options, *log_name]
2831
print("Executing " + " ".join(cmd) + ".") # noqa: T201
29-
subprocess.run(cmd, cwd=cwd, check=True)
32+
subprocess.run(cmd, cwd=cwd, check=True) # noqa: S603
3033

3134

3235
@hookimpl

src/pytask_stata/plugin.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
"""Register hook specifications and implementations."""
22
from __future__ import annotations
33

4+
from typing import TYPE_CHECKING
5+
46
from _pytask.config import hookimpl
5-
from pluggy import PluginManager
67
from pytask_stata import cli
78
from pytask_stata import collect
89
from pytask_stata import config
910
from pytask_stata import execute
1011
from pytask_stata import parametrize
1112

13+
if TYPE_CHECKING:
14+
from pluggy import PluginManager
15+
1216

1317
@hookimpl
1418
def pytask_add_hooks(pm: PluginManager) -> None:

src/pytask_stata/shared.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
from __future__ import annotations
33

44
import sys
5-
from pathlib import Path
65
from typing import Any
76
from typing import Iterable
87
from typing import Sequence
8+
from typing import TYPE_CHECKING
9+
10+
if TYPE_CHECKING:
11+
from pathlib import Path
912

1013

1114
if sys.platform == "darwin":

tox.ini

+2-36
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,17 @@
11
[tox]
22
envlist = pytest
3-
skipsdist = True
4-
skip_missing_interpreters = True
5-
passenv = PY_IGNORE_IMPORTMISMATCH
6-
whitelist_externals = python
73

84
[testenv]
9-
basepython = python
5+
usedevelop = true
106

117
[testenv:pytest]
128
conda_channels =
139
conda-forge
1410
nodefaults
1511
conda_deps =
16-
pytask >=0.3
12+
pytask =0.3
1713
pytest
1814
pytest-cov
1915
pytest-xdist
2016
commands =
21-
pip install --no-deps -e .
2217
pytest {posargs}
23-
24-
[flake8]
25-
docstring-convention = numpy
26-
ignore =
27-
D
28-
E203 ; ignores whitespace around : which is enforced by Black.
29-
W503 ; ignores linebreak before binary operator which is enforced by Black.
30-
PT006 ; ignores that parametrizing tests with tuple argument names is preferred.
31-
PT023 ; ignores parentheses at the end of markers.
32-
max-line-length = 88
33-
warn-symbols =
34-
pytest.mark.wip = Remove 'wip' flag for tests.
35-
pytest.mark.skip = Remove 'skip' flag for tests.
36-
37-
[pytest]
38-
addopts = --doctest-modules
39-
filterwarnings =
40-
ignore: the imp module is deprecated in favour of importlib
41-
ignore: Using or importing the ABCs from 'collections' instead of
42-
ignore: The (parser|symbol) module is deprecated and will be removed in future
43-
junit_family = xunit2
44-
markers =
45-
wip: Tests that are work-in-progress.
46-
unit: Flag for unit tests which target mainly a single function.
47-
integration: Flag for integration tests which may comprise of multiple unit tests.
48-
end_to_end: Flag for tests that cover the whole program.
49-
norecursedirs =
50-
.idea
51-
.tox

0 commit comments

Comments
 (0)