Skip to content
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
18 changes: 12 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
- uses: mamba-org/setup-micromamba@v1
with:
auto-update-conda: false
python-version: ${{ matrix.python-version }}
channels: conda-forge,nodefaults
miniforge-variant: Mambaforge
environment-name: gha-testing
condarc: |
channels:
- nodefaults
- conda-forge
create-args: >-
python=${{ matrix.python-version }}
mamba
tox-conda
cache-environment: true

- name: Install core dependencies.
shell: bash -l {0}
Expand Down
27 changes: 11 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,30 @@ repos:
- id: python-no-log-warn
- id: python-use-type-annotations
- id: text-unicode-replacement-char
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--py37-plus, --add-import, 'from __future__ import annotations']
args: [--py38-plus, --add-import, 'from __future__ import annotations']
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/PyCQA/docformatter
rev: v1.5.1
hooks:
- id: docformatter
args: [--in-place, --wrap-summaries, "88", --wrap-descriptions, "88", --blank]
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.223
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
hooks:
- id: ruff
- repo: https://github.com/dosisod/refurb
rev: v1.10.0
rev: v1.21.0
hooks:
- id: refurb
args: [--ignore, FURB126]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies: [
Expand All @@ -66,7 +61,7 @@ repos:
- id: interrogate
args: [-v, --fail-under=40, src]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.991'
rev: 'v1.5.1'
hooks:
- id: mypy
args: [
Expand All @@ -81,7 +76,7 @@ repos:
]
pass_filenames: false
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.6
hooks:
- id: codespell
- repo: https://github.com/mgedmin/check-manifest
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ ignore_errors = true


[tool.ruff]
target-version = "py37"
target-version = "py38"
select = ["ALL"]
fix = true
extend-ignore = [
"I", # ignore isort
"TRY", # ignore tryceratops
# Numpy docstyle
"D107",
"D203",
Expand All @@ -44,7 +46,6 @@ extend-ignore = [
"RET504", # unnecessary variable assignment before return.
"S101", # raise errors for asserts.
"B905", # strict parameter for zip that was implemented in py310.
"I", # ignore isort
"ANN101", # type annotating self
"ANN102", # type annotating cls
"FBT", # flake8-boolean-trap
Expand All @@ -56,7 +57,7 @@ extend-ignore = [


[tool.ruff.per-file-ignores]
"tests/*" = ["D", "ANN", "PLR2004"]
"tests/*" = ["D", "ANN", "PLR2004", "PLR0913"]


[tool.ruff.pydocstyle]
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = https://github.com/pytask-dev/pytask-julia
author = Tobias Raabe
author_email = raabe@posteo.de
license = MIT
license_file = LICENSE
license_files = LICENSE
platforms = any
classifiers =
Development Status :: 4 - Beta
Expand All @@ -26,7 +26,7 @@ packages = find:
install_requires =
pybaum>=0.1.1
pytask>=0.3
python_requires = >=3.7
python_requires = >=3.8
include_package_data = True
package_dir = =src
zip_safe = False
Expand Down
4 changes: 2 additions & 2 deletions src/pytask_julia/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def run_jl_script(
project: list[str],
) -> None:
"""Run a Julia script."""
cmd = ["julia"] + options + project + [_SEPARATOR, str(script), str(serialized)]
cmd = ["julia", *options, *project, _SEPARATOR, str(script), str(serialized)]
print("Executing " + " ".join(cmd) + ".") # noqa: T201
subprocess.run(cmd, check=True)
subprocess.run(cmd, check=True) # noqa: S603


@hookimpl
Expand Down
2 changes: 1 addition & 1 deletion src/pytask_julia/parametrize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
@hookimpl
def pytask_parametrize_kwarg_to_marker(obj: Any, kwargs: dict[str, Any]) -> None:
"""Attach parametrized Julia arguments to the function with a marker."""
if callable(obj) and "julia" in kwargs: # noqa: PLR2004
if callable(obj) and "julia" in kwargs:
pytask.mark.julia(**kwargs.pop("julia"))(obj)
6 changes: 5 additions & 1 deletion src/pytask_julia/plugin.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
"""Register hook specifications and implementations."""
from __future__ import annotations

from pluggy import PluginManager
from typing import TYPE_CHECKING

from pytask import hookimpl
from pytask_julia import collect
from pytask_julia import config
from pytask_julia import execute
from pytask_julia import parametrize

if TYPE_CHECKING:
from pluggy import PluginManager


@hookimpl
def pytask_add_hooks(pm: PluginManager) -> None:
Expand Down
7 changes: 5 additions & 2 deletions src/pytask_julia/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
from __future__ import annotations

import json
from pathlib import Path
from typing import Any
from typing import Callable
from typing import TYPE_CHECKING

from pytask import Task

if TYPE_CHECKING:
from pytask import Task
from pathlib import Path


_HIDDEN_FOLDER = ".pytask"
Expand Down
4 changes: 2 additions & 2 deletions src/pytask_julia/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def julia(
options: str | Iterable[str] | None = None,
serializer: Callable[..., str] | str | None = None,
suffix: str | None = None,
project: str | Path = None,
project: str | Path | None = None,
) -> tuple[
str | Path | None,
str | Iterable[str] | None,
str | Callable[..., str] | str | None,
str | Callable[..., str] | None,
str | None,
str | Path | None,
]:
Expand Down