Skip to content

Use pixi. #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 4, 2024
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML
39 changes: 18 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CONDA_EXE: mamba

on:
push:
branches:
Expand All @@ -20,41 +17,41 @@ jobs:

run-tests:

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

strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
environment: ['py38', 'py39', 'py310', 'py311', 'py312']

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: actions/setup-python@v5
- if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
uses: julia-actions/setup-julia@v2
- uses: prefix-dev/[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: pip
allow-prereleases: true
- run: pip install tox
pixi-version: v0.20.1
# cache: true
environments: ${{ matrix.environment }}

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

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

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

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

- name: Upload coverage reports of end-to-end tests.
if: runner.os == 'Linux' && matrix.python-version == '3.10'
shell: bash -l {0}
run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c
- name: Upload end_to_end test coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
flags: end_to_end
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ __pycache__
build
dist
src/pytask_julia/_version.py

.mypy_cache
.ruff_cache
.pytest_cache

# pixi environments
.pixi
*.egg-info
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ repos:
rev: v2.2.6
hooks:
- id: codespell
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
args: [--no-build-isolation]
additional_dependencies: [setuptools-scm, toml, wheel]
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
releases are available on [PyPI](https://pypi.org/project/pytask-julia) and
[Anaconda.org](https://anaconda.org/conda-forge/pytask-julia).

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

- {pull}`31` uses pixi to provision Julia if possible.

## 0.4.0 - 2023-10-08

- {pull}`24` prepares the release of pytask v0.4.0.
Expand Down
14 changes: 0 additions & 14 deletions MANIFEST.in

This file was deleted.

33 changes: 0 additions & 33 deletions environment.yml

This file was deleted.

6,879 changes: 6,879 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

97 changes: 67 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
build-backend = "setuptools.build_meta"

[project]
name = "pytask_julia"
description = "A Pytask plugin for Julia"
Expand All @@ -10,13 +6,10 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only"
"Programming Language :: Python :: 3 :: Only",
]
requires-python = ">=3.8"
dependencies = [
"pluggy>=1.0.0",
"pytask>=0.4.5"
]
dependencies = ["click", "pluggy>=1.0.0", "pytask>=0.4.5"]
dynamic = ["version"]

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

[tool.setuptools]
include-package-data = true
zip-safe = false
platforms = ["any"]
license-files = ["LICENSE"]

[tool.check-manifest]
ignore = ["src/pytask_julia/_version.py"]

[project.entry-points.pytask]
pytask_julia = "pytask_julia.plugin"

[tool.setuptools.package-dir]
"" = "src"
[project.optional-dependencies]
test = ["pytask-parallel", "pytest", "pytest-cov", "pytest-xdist", "pyyaml"]

[tool.rye]
managed = true

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.vcs]
version-file = "src/pytask_julia/_version.py"

[tool.hatch.build.targets.sdist]
exclude = ["tests"]
only-packages = true

[tool.setuptools_scm]
write_to = "src/pytask_julia/_version.py"
[tool.hatch.build.targets.wheel]
exclude = ["tests"]
only-packages = true

[tool.hatch.version]
source = "vcs"

[tool.hatch.metadata]
allow-direct-references = true

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

[tool.ruff.lint]
extend-ignore = [
"ANN401", # flake8-annotate typing.Any
"COM812", # Comply with ruff-format.
"ISC001", # Comply with ruff-format.
"ANN401", # flake8-annotate typing.Any
"COM812", # Comply with ruff-format.
"ISC001", # Comply with ruff-format.
]
select = ["ALL"]

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

[tool.pytest.ini_options]
# Do not add src since it messes with the loading of pytask-parallel as a plugin.
testpaths = ["tests"]
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", ".tox"]

[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" }
test = { features = ["test"], solve-group = "default" }
py38 = { features = ["py38", "test"]}
py39 = { features = ["py39", "test"]}
py310 = { features = ["py310", "test"]}
py311 = { features = ["py311", "test"]}
py312 = { features = ["py312", "test"]}

[tool.pixi.feature.py38.dependencies]
python = "3.8.*"
[tool.pixi.feature.py39.dependencies]
python = "3.9.*"
[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.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"] }
Loading