Skip to content
Snippets Groups Projects
Verified Commit 5e58510e authored by Anton Akhmerov's avatar Anton Akhmerov
Browse files

switch to pixi from spin

parent 612b6759
No related branches found
No related tags found
1 merge request!16Switch to pixi
Pipeline #190716 passed
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
......@@ -41,3 +41,6 @@ coverage.xml
docs/_build/
.idea/
# pixi environments
.pixi
*.egg-info
image: mambaorg/micromamba:1.5.6-jammy
image: ghcr.io/prefix-dev/pixi:0.29.0
cache:
paths:
- micromamba
- .pre-commit-cache
before_script:
- mkdir -p micromamba
- export MAMBA_ROOT_PREFIX=micromamba
- micromamba create -yf environment.yml
- eval "$(micromamba shell hook --shell bash)"
- micromamba activate mumps
- git config --global --add safe.directory $CI_PROJECT_DIR
variables:
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.pre-commit-cache
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "fastest"
build and test:
pre-commit:
variables:
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.pre-commit-cache
script:
- spin test
- pixi run -e precommit git config --global --add safe.directory $CI_PROJECT_DIR
- pixi run check
cache:
key: "$CI_JOB_NAME"
paths:
- .pre-commit-cache
- .pixi
pre-commit:
test:
script:
- pixi run test
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
build:
script:
- pre-commit run --all-files
- pixi run -e publish uv build --sdist
- pixi run -e publish twine check dist/*
artifacts:
paths:
- dist
expire_in: "7 days"
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
publish to test pypi:
needs:
- build and test
- test
- build
- pre-commit
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*\+test$/' # vX.Y.Z.post1+test
script:
- python -m build
- mkdir wheelhouse && mv dist/*.whl wheelhouse
- auditwheel repair --plat manylinux_2_12_x86_64 wheelhouse/*.whl -w dist
- twine check dist/*
- twine upload -u __token__ -p $PYPI_TEST_TOKEN --repository testpypi dist/*
- pixi run -e publish twine upload -u __token__ -p $PYPI_TEST_TOKEN --repository testpypi dist/*
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
publish to pypi:
needs:
- build and test
- test
- build
- pre-commit
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+[^+]*$/' # No +test
script:
- python -m build
- mkdir wheelhouse && mv dist/*.whl wheelhouse
- auditwheel repair --plat manylinux_2_12_x86_64 wheelhouse/*.whl -w dist
- twine check dist/*
- twine upload -u __token__ -p $PYPI_TOKEN dist/*
- pixi run -e publish twine upload -u __token__ -p $PYPI_TOKEN dist/*
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
......@@ -59,16 +59,28 @@ def sparse_diag(matrix, k, sigma, **kwargs):
## Development
`python-mumps` recommends [Spin](https://github.com/scientific-python/spin/). Get spin with:
### Pixi
`python-mumps` recommends [pixi](https://pixi.sh/).
After installing pixi, use
```bash
pixi run test -v # (Pytest arguments go after test)
```
This will also install the necessary dependencies.
### pre-commit
`python-mumps` uses [pre-commit](https://pre-commit.com/) to enforce code style. After installing it, run
```bash
pip install spin
pre-commit install
```
Then to build, test and install `python-mumps`:
or if you want to use pre-commit provided by pixi, run
```bash
spin build
spin test -- --lf # (Pytest arguments go after --)
spin install
pixi run pre-commit install
```
name: mumps
channels: [conda-forge]
dependencies:
- mumps-seq=5.2
- metis=5.1.0
- pip
- python=3.11
- build
- numpy
- scipy
- meson
- ninja
- compilers
- cython
- pytest
- twine
- pre-commit
- git
- patchelf
- auditwheel
- pip:
- spin
pixi.lock 0 → 100644
This diff is collapsed.
......@@ -39,14 +39,6 @@ dynamic = ["version"]
[project.urls]
homepage = "https://gitlab.kwant-project.org/kwant/python-mumps"
[tool.spin]
package = "mumps"
commands = [
"spin.cmds.meson.build",
"spin.cmds.meson.test",
"spin.cmds.pip.install"
]
[tool.ruff.pydocstyle]
convention = "numpy"
......@@ -58,3 +50,45 @@ line-length = 88
[tool.codespell]
ignore-words-list = "groth,coo"
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tool.pixi.pypi-dependencies]
python-mumps = { path = ".", editable = true }
[tool.pixi.dependencies]
mumps-seq = ">=5.7.3,<6"
scipy = ">=1.14.1,<2"
numpy = ">=2.1.1,<3"
setuptools_scm = ">=8.1.0,<9"
meson-python = ">=0.16.0,<0.17"
compilers = ">=1.7.0,<2"
ninja = ">=1.12.1,<2"
cython = ">=3.0.11,<4"
pytest = ">=8.3.2,<9"
git = "*"
[tool.pixi.feature.publish.dependencies]
uv = ">=0.4.5"
twine = ">=5.1.1"
[tool.pixi.feature.precommit.dependencies]
pre-commit = "*"
git = "*"
[tool.pixi.pypi-options]
no-build-isolation = ["python-mumps"]
[tool.pixi.environments]
default = { solve-group = "default" }
precommit = { features = ["precommit"], no-default-feature = true }
publish = { features = ["publish"] }
[tool.pixi.tasks]
test = "python -P -m pytest --import-mode=importlib --pyargs mumps"
[tool.pixi.feature.precommit.tasks]
check = "pre-commit run --all-files"
pre-commit = "pre-commit"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment