Skip to content
Snippets Groups Projects
Commit f74f2353 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Merge branch 'use-pixi' into 'main'

Migrate to using pixi for CI and development

See merge request !23
parents ee4b1c9f 1b96c43e
No related branches found
No related tags found
1 merge request!23Migrate to using pixi for CI and development
Pipeline #86963 failed
# SPDX-FileCopyrightText: Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: BSD-3-Clause
{% set data = load_file_data(RECIPE_DIR + '/../pyproject.toml') %}
package:
name: {{ data['project']['name'] }}
version: {{ environ.get('PACKAGE_VERSION', environ.get('GIT_DESCRIBE_TAG')) }}
source:
path: ..
build:
noarch: python
number: {{ environ.get('NEXT_BUILD_NUMBER', 0) }}
run_exports:
- {{ pin_subpackage(data['project']['name']) }}
script:
- "{{ PYTHON }} -m pip install {{ SRC_DIR }} -vv"
requirements:
host:
- python >=3.10
- pip
- hatchling
- versioningit
- click >=8
- click {{ click }}
- tomli {{ tomli }}
- tomli-w {{ tomli_w }}
- xdg {{ xdg }}
run:
- python >=3.10
- {{ pin_compatible('click') }}
- {{ pin_compatible('tomli') }}
- {{ pin_compatible('tomli-w') }}
- {{ pin_compatible('xdg') }}
test:
source_files:
- tests
imports:
- {{ data['project']['name'] }}
commands:
- pytest -sv tests
requires:
- pytest {{ pytest }}
about:
home: {{ data['project']['urls']['homepage'] }}
summary: {{ data['project']['description'] }}
license: {{ data['project']['license'] }}
license_family: BSD
......@@ -8,37 +8,63 @@
Installation
==============
We support two installation modes, through pip_, or mamba_ (conda), for two
types of releases, stable, or beta (a.k.a. development, latest). Choose a
combination from the tabbed pane below.
Installation may follow one of two paths: deployment or development. Choose the
relevant tab for details on each of those installation paths.
.. tab:: pip/stable
.. tab:: Deployment (pip/uv)
.. code-block:: sh
Install using pip_, or your preferred Python project management solution (e.g.
uv_, rye_ or poetry_).
**Stable** release, from PyPI:
.. code:: sh
pip install clapper
**Latest** development branch, from its git repository:
.. code:: sh
pip install git+https://gitlab.idiap.ch/biosignal/software/clapper@main
.. tab:: Deployment (pixi)
Use pixi_ to add this package as a dependence:
.. code:: sh
.. tab:: pip/beta
pixi add clapper
.. code-block:: sh
pip install git+https://gitlab.idiap.ch/software/clapper
.. tab:: Development
Checkout the repository, and then use pixi_ to setup a full development
environment:
.. tab:: conda/stable
.. code:: sh
.. code-block:: sh
git clone git@gitlab.idiap.ch:software/clapper
pixi install --frozen
mamba install -c conda-forge clapper
.. tip::
The ``--frozen`` flag will ensure that the latest lock-file available
with sources is used. If you'd like to update the lock-file to the
latest set of compatible dependencies, remove that option.
.. tab:: conda/beta
If you use `direnv to setup your pixi environment
<https://pixi.sh/latest/features/environment/#using-pixi-with-direnv>`_
when you enter the directory containing this package, you can use a
``.envrc`` file similar to this:
.. code-block:: sh
.. code:: sh
mamba install -c https://www.idiap.ch/software/biosignal/conda/label/beta -c conda-forge clapper
watch_file pixi.lock
export PIXI_FROZEN="true"
eval "$(pixi shell-hook)"
.. include:: links.rst
......@@ -4,6 +4,10 @@
.. _python: http://www.python.org
.. _pip: https://pip.pypa.io/en/stable/
.. _uv: https://github.com/astral-sh/uv
.. _rye: https://github.com/astral-sh/rye
.. _poetry: https://python-poetry.org
.. _pixi: https://pixi.sh
.. _mamba: https://mamba.readthedocs.io/en/latest/index.html
.. _toml: https://toml.io
.. _tomli: https://pypi.org/project/tomli/
......
This diff is collapsed.
......@@ -65,8 +65,14 @@ tomli = "*"
tomli-w = "*"
xdg = "*"
[tool.pixi.pypi-dependencies]
clapper = { path = ".", editable = true, extras = ["qa", "doc", "test"] }
[tool.pixi.feature.self.pypi-dependencies]
clapper = { path = ".", editable = true }
[tool.pixi.feature.py311.dependencies]
python = "~=3.11.0"
[tool.pixi.feature.py312.dependencies]
python = "~=3.12.0"
[tool.pixi.feature.qa.dependencies]
pre-commit = "*"
......@@ -76,6 +82,7 @@ reuse = "*"
[tool.pixi.feature.qa.tasks]
qa-install = "pre-commit install"
qa = "pre-commit run --all-files"
qa-ci = "pre-commit run --all-files --show-diff-on-failure --verbose"
[tool.pixi.feature.doc.dependencies]
sphinx = "*"
......@@ -87,21 +94,37 @@ sphinx-copybutton = "*"
sphinx-inline-tabs = "*"
[tool.pixi.feature.doc.tasks]
doc = "rm -rf doc/api && rm -rf html && sphinx-build -aEW doc html"
doc-clean = "rm -rf doc/api && rm -rf html"
doc = "sphinx-build -aEW doc html"
doctest = "sphinx-build -aEb doctest doc html/doctest"
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
[tool.pixi.feature.debug.dependencies]
pdbpp = "*"
[tool.pixi.feature.test.tasks]
test = "pytest -sv tests/"
test-ci = "pytest -sv --cov-report 'html:html/coverage' --cov-report 'xml:coverage.xml' --junitxml 'junit-coverage.xml' --ignore '.profile' tests/"
[tool.pixi.feature.build.dependencies]
hatch = "*"
versioningit = "*"
twine = "*"
[tool.pixi.feature.build.tasks]
build = "hatch build"
check = "twine check dist/*"
upload = "twine upload dist/*"
[tool.pixi.feature.dev.dependencies]
pdbpp = "*"
uv = "*"
[tool.pixi.environments]
default = { features = [ "qa", "doc", "test", "debug" ] }
default = { features = ["qa", "build", "doc", "test", "dev", "py312", "self"] }
qa-ci = { features = ["qa", "py312"] }
build-ci = { features = ["build", "py312"] }
test-ci-alternative = { features = ["test", "py311", "self"] }
[tool.hatch.version]
source = "versioningit"
......
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