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
52 changes: 22 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,42 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: prefix-dev/setup-pixi@v0.9.3
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
pixi-version: v0.50.1
environments: typing
- run: pixi run -e typing typing
enable-cache: true
- name: Install just
uses: extractions/setup-just@v3
- name: Run type checking
run: just typing

run-tests:

name: Run tests for ${{ matrix.os }} on ${{ matrix.environment }}
name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
environment: ['py310', 'py311', 'py312', 'py313', 'py314']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v6
- if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
uses: julia-actions/setup-julia@v2
- uses: prefix-dev/setup-pixi@v0.9.3
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@v2
with:
pixi-version: v0.50.1
# cache: true
environments: ${{ matrix.environment }}

# Unit, integration, and end-to-end tests.

- name: Run unit tests and doctests.
shell: bash -l {0}
run: pixi run -e ${{ matrix.environment }} test -m "unit or (not integration and not end_to_end)" --cov-report=xml -n auto

- name: Upload unit test coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
version: "1"
- uses: astral-sh/setup-uv@v7
with:
flags: unit
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install Julia dependencies
run: julia --project=. --eval 'import Pkg; Pkg.instantiate()'
- name: Install just
uses: extractions/setup-just@v3

- name: Run end-to-end tests.
shell: bash -l {0}
run: pixi run -e ${{ matrix.environment }} test -m end_to_end --cov-report=xml -n auto
- name: Run tests
run: just test-cov

- name: Upload end_to_end test coverage reports to Codecov with GitHub Action
- name: Upload test coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
with:
flags: end_to_end
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ src/pytask_julia/_version.py
.ruff_cache
.pytest_cache

# pixi environments
.pixi
*.egg-info
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ repos:
hooks:
- id: check-added-large-files
args: ['--maxkb=25']
exclude: ^uv\.lock$
- id: check-case-conflict
- id: check-merge-conflict
- id: check-vcs-permalinks
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask-julia) and

## 0.x.x - 2024-xx-xx

- {pull}`64` switches CI and development tooling from pixi to uv.
- {pull}`62` removes tox in favor of pixi for typing.
- {pull}`56` updates pre-commit hooks.
- {pull}`54` drops support for Python 3.8 and 3.9 and adds support for Python 3.14.
Expand Down
22 changes: 22 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Install all dependencies
install:
uv sync --all-groups

# Run tests
test *FLAGS:
uv run --group test pytest {{FLAGS}}

# Run tests with coverage
test-cov *FLAGS:
uv run --group test pytest --cov=src --cov=tests --cov-report=xml -n auto {{FLAGS}}

# Run type checking
typing:
uv run --group typing --group test ty check src/ tests/

# Run linting
lint:
uvx prek run -a

# Run all checks (format, lint, typing, test)
check: lint typing test
8,560 changes: 0 additions & 8,560 deletions pixi.lock

This file was deleted.

50 changes: 1 addition & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Tracker = "https://github.com/pytask-dev/pytask-julia/issues"
[project.entry-points.pytask]
pytask_julia = "pytask_julia.plugin"

[project.optional-dependencies]
[dependency-groups]
test = ["pytask-parallel", "pytest", "pytest-cov", "pytest-xdist", "pyyaml"]
typing = ["pyyaml", "ty>=0.0.7"]

Expand Down Expand Up @@ -104,53 +104,5 @@ unused-ignore-comment = "ignore"
[tool.pytest.ini_options]
testpaths = ["src", "tests"]
markers = [
"wip: Tests that are work-in-progress.",
"unit: Flag for unit tests which target mainly a single function.",
"integration: Flag for integration tests which may comprise of multiple unit tests.",
"end_to_end: Flag for tests that cover the whole program.",
]
norecursedirs = [".idea"]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]

[tool.pixi.pypi-dependencies]
pytask_julia = { path = ".", editable = true }

[tool.pixi.environments]
default = { solve-group = "default", features = ["test", "typing"]}
test = { features = ["test"], solve-group = "default" }
typing = { features = ["test", "typing"], solve-group = "default" }
py310 = { features = ["py310", "test"]}
py311 = { features = ["py311", "test"]}
py312 = { features = ["py312", "test"]}
py313 = { features = ["py313", "test"]}
py314 = { features = ["py314", "test"]}

[tool.pixi.feature.py310.dependencies]
python = "3.10.*"
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.py313.dependencies]
python = "3.13.*"
[tool.pixi.feature.py314.dependencies]
python = "3.14.*"

[tool.pixi.feature.test.target.linux-64.dependencies]
julia = ">=1.0.0"

[tool.pixi.feature.test.target.osx-64.dependencies]
julia = ">=1.0.0"

[tool.pixi.feature.test.tasks]
setup-julia = "julia --project=. --eval 'import Pkg; Pkg.instantiate()'"
test = { cmd = "pytest --cov src --cov tests", depends-on = ["setup-julia"] }

[tool.pixi.feature.typing.dependencies]
ty = ">=0.0.7"

[tool.pixi.feature.typing.tasks]
typing = "ty check --python .pixi/envs/typing src/ tests/"
2 changes: 0 additions & 2 deletions tests/test_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from tests.conftest import ROOT


@pytest.mark.unit
@pytest.mark.parametrize(
(
"mark",
Expand Down Expand Up @@ -91,7 +90,6 @@ def test_parse_julia_mark( # noqa: PLR0913
assert out == expected


@pytest.mark.unit
@pytest.mark.parametrize(
("project", "root", "expected"),
[
Expand Down
2 changes: 0 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from __future__ import annotations

import pytest
from pytask import build


@pytest.mark.end_to_end
def test_marker_is_configured(tmp_path):
session = build(paths=tmp_path)
assert "julia" in session.config["markers"]
10 changes: 0 additions & 10 deletions tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from tests.conftest import parametrize_parse_code_serializer_suffix


@pytest.mark.unit
def test_pytask_execute_task_setup_missing_julia(monkeypatch):
"""Make sure that the task setup raises errors."""
# Act like julia is installed since we do not test this.
Expand All @@ -38,7 +37,6 @@ def test_pytask_execute_task_setup_missing_julia(monkeypatch):


@needs_julia
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
@pytest.mark.parametrize(
"depends_on",
Expand Down Expand Up @@ -92,7 +90,6 @@ def task_run_jl_script(


@needs_julia
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_run_jl_script_w_task_decorator(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -130,7 +127,6 @@ def run_jl_script(produces=Path("out.txt")):


@needs_julia
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_raise_error_if_julia_is_not_found(
tmp_path,
Expand Down Expand Up @@ -178,7 +174,6 @@ def task_run_jl_script(produces=Path("out.txt")):


@needs_julia
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_run_jl_script_w_wrong_cmd_option(
runner,
Expand Down Expand Up @@ -217,7 +212,6 @@ def task_run_jl_script(produces=Path("out.txt")):


@needs_julia
@pytest.mark.end_to_end
@pytest.mark.parametrize("n_threads", [2, 3])
@parametrize_parse_code_serializer_suffix
def test_check_passing_cmd_line_options( # noqa: PLR0913
Expand Down Expand Up @@ -258,7 +252,6 @@ def task_run_jl_script(produces=Path("out.txt")):


@needs_julia
@pytest.mark.end_to_end
@pytest.mark.xfail(
condition=sys.platform == "win32" and os.environ.get("CI") == "true",
reason="Test folder and repo are on different drives causing relpath to fail.",
Expand Down Expand Up @@ -312,7 +305,6 @@ def task_run_jl_script(produces=Path("out.txt")):


@needs_julia
@pytest.mark.end_to_end
@pytest.mark.xfail(
condition=sys.platform == "win32" and os.environ.get("CI") == "true",
reason="Test folder and repo are on different drives causing relpath to fail.",
Expand Down Expand Up @@ -358,7 +350,6 @@ def task_run_jl_script(produces=Path("out.txt")):


@needs_julia
@pytest.mark.end_to_end
def test_run_jl_script_w_custom_serializer(runner, tmp_path):
task_source = f"""
import pytask
Expand Down Expand Up @@ -391,7 +382,6 @@ def task_run_jl_script(produces=Path("out.txt")):


@needs_julia
@pytest.mark.end_to_end
def test_run_jl_script_fails_w_multiple_markers(runner, tmp_path):
task_source = """
import pytask
Expand Down
1 change: 0 additions & 1 deletion tests/test_normal_execution_w_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pytask import cli


@pytest.mark.end_to_end
@pytest.mark.parametrize(
"dependencies",
[(), ("in.txt",), ("in_1.txt", "in_2.txt")],
Expand Down
2 changes: 0 additions & 2 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


@needs_julia
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_parallel_parametrization_over_source_files_w_loop(
runner,
Expand Down Expand Up @@ -76,7 +75,6 @@ def task_execute_julia(produces=Path(f"{{i}}.csv")):


@needs_julia
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_parallel_parametrization_over_source_file_w_loop(
runner,
Expand Down
2 changes: 0 additions & 2 deletions tests/test_parametrize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import textwrap

import pytest
from pytask import ExitCode
from pytask import cli

Expand All @@ -12,7 +11,6 @@


@needs_julia
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_parametrized_execution_of_jl_script_w_loop(
runner,
Expand Down
1 change: 0 additions & 1 deletion tests/test_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from pytask_julia.shared import julia


@pytest.mark.unit
@pytest.mark.parametrize(
("args", "kwargs", "expectation", "expected"),
[
Expand Down
Loading