diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac045c0d7..25b9f102d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -197,58 +197,24 @@ jobs: needs: download_data steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v4.0.1 + - uses: prefix-dev/setup-pixi@f00437f565399d418b0acc85936d12c1fb668347 # v0.10.1 with: - miniforge-version: latest - use-mamba: true - channels: conda-forge - channel-priority: strict - python-version: "3.12" + environments: "test-py313-pyside6" - - uses: tlambert03/setup-qt-libs@v1 + - name: Setup headless display + uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 + with: + qt: true + wm: herbstluftwm - name: Download test data - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: test_data path: test_data - - name: Use mamba solver - shell: "bash -el {0}" - run: | - conda install -n base conda-libmamba-solver - conda config --set solver libmamba - - - name: Install dependencies - shell: "bash -el {0}" - run: | - mamba install -y "tox-conda>=0.10.0" - - - name: List environment packages - shell: "bash -el {0}" - run: conda list - - - name: create environment - shell: "bash -el {0}" - run: bash build_utils/create_environment_yml.sh - - - name: Upload environment file - uses: actions/upload-artifact@v7 - with: - name: environment - path: environment.yml - retention-days: 5 - - - name: patch tox.ini - shell: "bash -el {0}" - run: sed -e "s/{sys_platform}/{platform}/g" tox.ini -i - - - name: Test with tox - uses: aganders3/headless-gui@v2 - with: - run: conda run -n test --no-capture-output tox -e py312-PySide2-conda - timeout-minutes: 60 + - name: Run tests + run: pixi run -e test-py313-pyside6 test check-package: name: Build & inspect our package. diff --git a/.gitignore b/.gitignore index b9f66fd5c..f5cb6b550 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +pixi.lock report-*.json environment.yml minimum-constrains.txt diff --git a/MANIFEST.in b/MANIFEST.in index 32976046d..9a5d865b7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -47,3 +47,4 @@ exclude runtime.txt exclude .sourcery.yaml exclude survey_url.txt exclude .typos.toml +exclude pixi.toml diff --git a/build_utils/create_environment_yml.sh b/build_utils/create_environment_yml.sh deleted file mode 100644 index c003ef38f..000000000 --- a/build_utils/create_environment_yml.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -dependencies=$(python build_utils/pyproject_toml_to_yaml.py) - -cat < environment.yml -name: test -channels: - - conda-forge -dependencies: -$dependencies - - pyqt - - python=3.12 -EOF diff --git a/build_utils/pyproject_toml_to_yaml.py b/build_utils/pyproject_toml_to_yaml.py deleted file mode 100644 index 9edbbea78..000000000 --- a/build_utils/pyproject_toml_to_yaml.py +++ /dev/null @@ -1,31 +0,0 @@ -from pathlib import Path - -import tomllib - -base_dir = Path(__file__).parent.parent -pyproject_toml = base_dir / "pyproject.toml" - - -def drop_line(line): - if "python_version < '3.10'" in line: - return False - - if "python_version < '3.11'" in line: # noqa: SIM103 - return False - - return True - - -def remove_specifier(line: str): - if ";" in line: - return line.split(";", maxsplit=1)[0] - return line - - -with pyproject_toml.open("rb") as f: - data = tomllib.load(f) -dependencies = data["project"]["dependencies"] -dependencies = map(remove_specifier, filter(drop_line, dependencies)) -dependencies_str = "\n".join([f" - {v}" for v in dependencies]) -dependencies_str = dependencies_str.replace("qtconsole", "qtconsole-base") -print(dependencies_str) diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 000000000..0e966dc8c --- /dev/null +++ b/pixi.toml @@ -0,0 +1,70 @@ +[workspace] +authors = ["Grzegorz Bokota"] +channels = ["https://prefix.dev/conda-forge"] +platforms = ["win-64", "linux-64", "osx-arm64"] # Mac Intel support is not available +preview = ["pixi-build"] + +[package] +version = "0.17.1" # keep in sync with `pyproject.toml` + +[package.build] +backend.name = "pixi-build-python" +config.ignore-pypi-mapping = false + +[dependencies] +napari = ">=0.7.0" + +[feature.py311.dependencies] +python = "3.11.*" + +[feature.py312.dependencies] +python = "3.12.*" + +[feature.py313.dependencies] +python = "3.13.*" + +[feature.py314.dependencies] +python = "3.14.*" + +[feature.pyqt6.dependencies] +PartSeg = { path = ".", extras = ["pyqt6"] } + +[feature.pyside6.dependencies] +PartSeg = { path = ".", extras = ["pyside6"] } + +[feature.test.dependencies] +pytest = "*" +pytest-qt = "*" +pytest-timeout = "*" +scikit-image = "*" +lxml = "*" + + + +# there is no automatic mapping from `optional-dependencies`/`dependency-groups` +# to `package.extra-dependencies`/`dependencies` yet, +# ref. https://github.com/prefix-dev/pixi/issues/4764#issuecomment-4781239118 +[package.extra-dependencies.pyqt6] +pyqt6 = ">=6.10" + +[package.extra-dependencies.pyside6] +pyside6 = ">=6.10" + + + + +[feature.test.tasks] +test = "python -m pytest package/tests" + +[environments] +default = { features = ["py312", "pyside6", "test"] } + +# Standard python x backend +test-py311-pyqt6 = ["py311", "pyqt6", "test"] +test-py312-pyqt6 = ["py312", "pyqt6", "test"] +test-py313-pyqt6 = ["py313", "pyqt6", "test"] +test-py314-pyqt6 = ["py314", "pyqt6", "test"] +test-py311-pyside6 = ["py311", "pyside6", "test"] +test-py312-pyside6 = ["py312", "pyside6", "test"] +test-py313-pyside6 = ["py313", "pyside6", "test"] +test-py314-pyside6 = ["py314", "pyside6", "test"] diff --git a/tox.ini b/tox.ini index e618bf690..b9cd15164 100644 --- a/tox.ini +++ b/tox.ini @@ -67,14 +67,6 @@ extras = commands = python -m pytest --json-report --json-report-file={toxinidir}/report-{envname}-{sys_platform}.json {posargs} -[testenv:py312-PySide2-conda] -conda_env=environment.yml -deps= - pytest - pytest-json-report - lxml_html_clean - - [testenv:py{310,311,312,313,314,315}-{PyQt5,PySide2,PyQt6,PySide6}-napari_{62,70}] deps = {[testenv]deps}