Skip to content

Commit 992f418

Browse files
authored
Use pixi. (#31)
1 parent 61c1a77 commit 992f418

File tree

9 files changed

+6978
-104
lines changed

9 files changed

+6978
-104
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# GitHub syntax highlighting
2+
pixi.lock linguist-language=YAML

.github/workflows/main.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ concurrency:
55
group: ${{ github.head_ref || github.run_id }}
66
cancel-in-progress: true
77

8-
env:
9-
CONDA_EXE: mamba
10-
118
on:
129
push:
1310
branches:
@@ -20,41 +17,41 @@ jobs:
2017

2118
run-tests:
2219

23-
name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
20+
name: Run tests for ${{ matrix.os }} on ${{ matrix.environment }}
2421
runs-on: ${{ matrix.os }}
2522

2623
strategy:
2724
fail-fast: false
2825
matrix:
2926
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
30-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
27+
environment: ['py38', 'py39', 'py310', 'py311', 'py312']
3128

3229
steps:
3330
- uses: actions/checkout@v4
34-
- uses: julia-actions/setup-julia@v2
35-
- uses: actions/setup-python@v5
31+
- if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
32+
uses: julia-actions/setup-julia@v2
33+
- uses: prefix-dev/[email protected]
3634
with:
37-
python-version: ${{ matrix.python-version }}
38-
cache: pip
39-
allow-prereleases: true
40-
- run: pip install tox
35+
pixi-version: v0.20.1
36+
# cache: true
37+
environments: ${{ matrix.environment }}
4138

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

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

48-
- name: Upload coverage report for unit tests and doctests.
49-
if: runner.os == 'Linux' && matrix.python-version == '3.10'
50-
shell: bash -l {0}
51-
run: bash <(curl -s https://codecov.io/bash) -F unit -c
45+
- name: Upload unit test coverage reports to Codecov with GitHub Action
46+
uses: codecov/codecov-action@v4
47+
with:
48+
flags: unit
5249

5350
- name: Run end-to-end tests.
5451
shell: bash -l {0}
55-
run: tox -e pytest -- -m end_to_end --cov=./ --cov-report=xml -n auto
52+
run: pixi run -e ${{ matrix.environment }} test -m end_to_end --cov-report=xml -n auto
5653

57-
- name: Upload coverage reports of end-to-end tests.
58-
if: runner.os == 'Linux' && matrix.python-version == '3.10'
59-
shell: bash -l {0}
60-
run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c
54+
- name: Upload end_to_end test coverage reports to Codecov with GitHub Action
55+
uses: codecov/codecov-action@v4
56+
with:
57+
flags: end_to_end

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ __pycache__
1717
build
1818
dist
1919
src/pytask_julia/_version.py
20+
21+
.mypy_cache
22+
.ruff_cache
23+
.pytest_cache
24+
25+
# pixi environments
26+
.pixi
27+
*.egg-info

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ repos:
5858
rev: v2.2.6
5959
hooks:
6060
- id: codespell
61-
- repo: https://github.com/mgedmin/check-manifest
62-
rev: "0.49"
63-
hooks:
64-
- id: check-manifest
65-
args: [--no-build-isolation]
66-
additional_dependencies: [setuptools-scm, toml, wheel]
6761
- repo: meta
6862
hooks:
6963
- id: check-hooks-apply

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
55
releases are available on [PyPI](https://pypi.org/project/pytask-julia) and
66
[Anaconda.org](https://anaconda.org/conda-forge/pytask-julia).
77

8+
## 0.x.x - 2024-xx-xx
9+
10+
- {pull}`31` uses pixi to provision Julia if possible.
11+
812
## 0.4.0 - 2023-10-08
913

1014
- {pull}`24` prepares the release of pytask v0.4.0.

MANIFEST.in

Lines changed: 0 additions & 14 deletions
This file was deleted.

environment.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

pixi.lock

Lines changed: 6879 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 67 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[build-system]
2-
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
3-
build-backend = "setuptools.build_meta"
4-
51
[project]
62
name = "pytask_julia"
73
description = "A Pytask plugin for Julia"
@@ -10,13 +6,10 @@ classifiers = [
106
"License :: OSI Approved :: MIT License",
117
"Operating System :: OS Independent",
128
"Programming Language :: Python :: 3",
13-
"Programming Language :: Python :: 3 :: Only"
9+
"Programming Language :: Python :: 3 :: Only",
1410
]
1511
requires-python = ">=3.8"
16-
dependencies = [
17-
"pluggy>=1.0.0",
18-
"pytask>=0.4.5"
19-
]
12+
dependencies = ["click", "pluggy>=1.0.0", "pytask>=0.4.5"]
2013
dynamic = ["version"]
2114

2215
[[project.authors]]
@@ -37,27 +30,35 @@ Documentation = "https://github.com/pytask-dev/pytask-julia"
3730
Github = "https://github.com/pytask-dev/pytask-julia"
3831
Tracker = "https://github.com/pytask-dev/pytask-julia/issues"
3932

40-
[tool.setuptools]
41-
include-package-data = true
42-
zip-safe = false
43-
platforms = ["any"]
44-
license-files = ["LICENSE"]
45-
46-
[tool.check-manifest]
47-
ignore = ["src/pytask_julia/_version.py"]
48-
4933
[project.entry-points.pytask]
5034
pytask_julia = "pytask_julia.plugin"
5135

52-
[tool.setuptools.package-dir]
53-
"" = "src"
36+
[project.optional-dependencies]
37+
test = ["pytask-parallel", "pytest", "pytest-cov", "pytest-xdist", "pyyaml"]
38+
39+
[tool.rye]
40+
managed = true
5441

55-
[tool.setuptools.packages.find]
56-
where = ["src"]
57-
namespaces = false
42+
[build-system]
43+
requires = ["hatchling", "hatch-vcs"]
44+
build-backend = "hatchling.build"
45+
46+
[tool.hatch.build.hooks.vcs]
47+
version-file = "src/pytask_julia/_version.py"
48+
49+
[tool.hatch.build.targets.sdist]
50+
exclude = ["tests"]
51+
only-packages = true
5852

59-
[tool.setuptools_scm]
60-
write_to = "src/pytask_julia/_version.py"
53+
[tool.hatch.build.targets.wheel]
54+
exclude = ["tests"]
55+
only-packages = true
56+
57+
[tool.hatch.version]
58+
source = "vcs"
59+
60+
[tool.hatch.metadata]
61+
allow-direct-references = true
6162

6263
[tool.mypy]
6364
files = ["src", "tests"]
@@ -81,9 +82,9 @@ unsafe-fixes = true
8182

8283
[tool.ruff.lint]
8384
extend-ignore = [
84-
"ANN401", # flake8-annotate typing.Any
85-
"COM812", # Comply with ruff-format.
86-
"ISC001", # Comply with ruff-format.
85+
"ANN401", # flake8-annotate typing.Any
86+
"COM812", # Comply with ruff-format.
87+
"ISC001", # Comply with ruff-format.
8788
]
8889
select = ["ALL"]
8990

@@ -97,12 +98,48 @@ force-single-line = true
9798
convention = "numpy"
9899

99100
[tool.pytest.ini_options]
100-
# Do not add src since it messes with the loading of pytask-parallel as a plugin.
101-
testpaths = ["tests"]
101+
testpaths = ["src", "tests"]
102102
markers = [
103103
"wip: Tests that are work-in-progress.",
104104
"unit: Flag for unit tests which target mainly a single function.",
105105
"integration: Flag for integration tests which may comprise of multiple unit tests.",
106106
"end_to_end: Flag for tests that cover the whole program.",
107107
]
108108
norecursedirs = [".idea", ".tox"]
109+
110+
[tool.pixi.project]
111+
channels = ["conda-forge"]
112+
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
113+
114+
[tool.pixi.pypi-dependencies]
115+
pytask_julia = { path = ".", editable = true }
116+
117+
[tool.pixi.environments]
118+
default = { solve-group = "default" }
119+
test = { features = ["test"], solve-group = "default" }
120+
py38 = { features = ["py38", "test"]}
121+
py39 = { features = ["py39", "test"]}
122+
py310 = { features = ["py310", "test"]}
123+
py311 = { features = ["py311", "test"]}
124+
py312 = { features = ["py312", "test"]}
125+
126+
[tool.pixi.feature.py38.dependencies]
127+
python = "3.8.*"
128+
[tool.pixi.feature.py39.dependencies]
129+
python = "3.9.*"
130+
[tool.pixi.feature.py310.dependencies]
131+
python = "3.10.*"
132+
[tool.pixi.feature.py311.dependencies]
133+
python = "3.11.*"
134+
[tool.pixi.feature.py312.dependencies]
135+
python = "3.12.*"
136+
137+
[tool.pixi.feature.test.target.linux-64.dependencies]
138+
julia = ">=1.0.0"
139+
140+
[tool.pixi.feature.test.target.osx-64.dependencies]
141+
julia = ">=1.0.0"
142+
143+
[tool.pixi.feature.test.tasks]
144+
setup-julia = "julia --project=. --eval 'import Pkg; Pkg.instantiate()'"
145+
test = { cmd = "pytest --cov src --cov tests", depends_on = ["setup-julia"] }

0 commit comments

Comments
 (0)