Skip to content

Commit ad5c098

Browse files
[pre-commit.ci] pre-commit autoupdate (#21)
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 5f617fc commit ad5c098

File tree

9 files changed

+44
-35
lines changed

9 files changed

+44
-35
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,22 @@ 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
34-
- uses: conda-incubator/setup-miniconda@v2
34+
- uses: mamba-org/setup-micromamba@v1
3535
with:
36-
auto-update-conda: false
37-
python-version: ${{ matrix.python-version }}
38-
channels: conda-forge,nodefaults
39-
miniforge-variant: Mambaforge
36+
environment-name: gha-testing
37+
condarc: |
38+
channels:
39+
- nodefaults
40+
- conda-forge
41+
create-args: >-
42+
python=${{ matrix.python-version }}
43+
mamba
44+
tox-conda
45+
cache-environment: true
4046

4147
- name: Install core dependencies.
4248
shell: bash -l {0}

.pre-commit-config.yaml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,30 @@ repos:
2424
- id: python-no-log-warn
2525
- id: python-use-type-annotations
2626
- id: text-unicode-replacement-char
27-
- repo: https://github.com/asottile/reorder_python_imports
28-
rev: v3.9.0
27+
- repo: https://github.com/asottile/reorder-python-imports
28+
rev: v3.12.0
2929
hooks:
3030
- id: reorder-python-imports
31-
args: [--py37-plus, --add-import, 'from __future__ import annotations']
31+
args: [--py38-plus, --add-import, 'from __future__ import annotations']
3232
- repo: https://github.com/asottile/setup-cfg-fmt
33-
rev: v2.2.0
33+
rev: v2.5.0
3434
hooks:
3535
- id: setup-cfg-fmt
36-
- repo: https://github.com/PyCQA/docformatter
37-
rev: v1.5.1
38-
hooks:
39-
- id: docformatter
40-
args: [--in-place, --wrap-summaries, "88", --wrap-descriptions, "88", --blank]
4136
- repo: https://github.com/psf/black
42-
rev: 22.12.0
37+
rev: 23.9.1
4338
hooks:
4439
- id: black
45-
- repo: https://github.com/charliermarsh/ruff-pre-commit
46-
rev: v0.0.223
40+
- repo: https://github.com/astral-sh/ruff-pre-commit
41+
rev: v0.0.292
4742
hooks:
4843
- id: ruff
4944
- repo: https://github.com/dosisod/refurb
50-
rev: v1.10.0
45+
rev: v1.21.0
5146
hooks:
5247
- id: refurb
5348
args: [--ignore, FURB126]
5449
- repo: https://github.com/executablebooks/mdformat
55-
rev: 0.7.16
50+
rev: 0.7.17
5651
hooks:
5752
- id: mdformat
5853
additional_dependencies: [
@@ -66,7 +61,7 @@ repos:
6661
- id: interrogate
6762
args: [-v, --fail-under=40, src]
6863
- repo: https://github.com/pre-commit/mirrors-mypy
69-
rev: 'v0.991'
64+
rev: 'v1.5.1'
7065
hooks:
7166
- id: mypy
7267
args: [
@@ -81,7 +76,7 @@ repos:
8176
]
8277
pass_filenames: false
8378
- repo: https://github.com/codespell-project/codespell
84-
rev: v2.2.2
79+
rev: v2.2.6
8580
hooks:
8681
- id: codespell
8782
- repo: https://github.com/mgedmin/check-manifest

pyproject.toml

Lines changed: 4 additions & 3 deletions
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", # ignore tryceratops
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
@@ -56,7 +57,7 @@ extend-ignore = [
5657

5758

5859
[tool.ruff.per-file-ignores]
59-
"tests/*" = ["D", "ANN", "PLR2004"]
60+
"tests/*" = ["D", "ANN", "PLR2004", "PLR0913"]
6061

6162

6263
[tool.ruff.pydocstyle]

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ url = https://github.com/pytask-dev/pytask-julia
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
pybaum>=0.1.1
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_julia/collect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def run_jl_script(
3434
project: list[str],
3535
) -> None:
3636
"""Run a Julia script."""
37-
cmd = ["julia"] + options + project + [_SEPARATOR, str(script), str(serialized)]
37+
cmd = ["julia", *options, *project, _SEPARATOR, str(script), str(serialized)]
3838
print("Executing " + " ".join(cmd) + ".") # noqa: T201
39-
subprocess.run(cmd, check=True)
39+
subprocess.run(cmd, check=True) # noqa: S603
4040

4141

4242
@hookimpl

src/pytask_julia/parametrize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
@hookimpl
1111
def pytask_parametrize_kwarg_to_marker(obj: Any, kwargs: dict[str, Any]) -> None:
1212
"""Attach parametrized Julia arguments to the function with a marker."""
13-
if callable(obj) and "julia" in kwargs: # noqa: PLR2004
13+
if callable(obj) and "julia" in kwargs:
1414
pytask.mark.julia(**kwargs.pop("julia"))(obj)

src/pytask_julia/plugin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
"""Register hook specifications and implementations."""
22
from __future__ import annotations
33

4-
from pluggy import PluginManager
4+
from typing import TYPE_CHECKING
5+
56
from pytask import hookimpl
67
from pytask_julia import collect
78
from pytask_julia import config
89
from pytask_julia import execute
910
from pytask_julia import parametrize
1011

12+
if TYPE_CHECKING:
13+
from pluggy import PluginManager
14+
1115

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

src/pytask_julia/serialization.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
from __future__ import annotations
33

44
import json
5-
from pathlib import Path
65
from typing import Any
76
from typing import Callable
7+
from typing import TYPE_CHECKING
88

9-
from pytask import Task
9+
10+
if TYPE_CHECKING:
11+
from pytask import Task
12+
from pathlib import Path
1013

1114

1215
_HIDDEN_FOLDER = ".pytask"

src/pytask_julia/shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ def julia(
1616
options: str | Iterable[str] | None = None,
1717
serializer: Callable[..., str] | str | None = None,
1818
suffix: str | None = None,
19-
project: str | Path = None,
19+
project: str | Path | None = None,
2020
) -> tuple[
2121
str | Path | None,
2222
str | Iterable[str] | None,
23-
str | Callable[..., str] | str | None,
23+
str | Callable[..., str] | None,
2424
str | None,
2525
str | Path | None,
2626
]:

0 commit comments

Comments
 (0)