Skip to content

Commit

Permalink
edit files for add pixi
Browse files Browse the repository at this point in the history
  • Loading branch information
YurelyCamacho committed Jul 20, 2024
1 parent 4018593 commit 5baf191
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scicookie/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"hatch",
"maturin",
"scikit-build-core",
"pybind11"
"pybind11",
"pixi"
],
"use_bandit": "no",
"use_black": "no",
Expand Down
7 changes: 7 additions & 0 deletions src/scicookie/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
BUILD_SYSTEM = "scikit-build-core"
{% elif cookiecutter.build_system == "pybind11" -%}
BUILD_SYSTEM = "pybind11"
{% elif cookiecutter.build_system == "pixi" -%}
BUILD_SYSTEM = "pixi"
{%- else %}
BUILD_SYSTEM = None
{%- endif %}
Expand Down Expand Up @@ -252,6 +254,11 @@ def clean_up_build_system():
build_system_dir / "pyproject.toml",
PROJECT_DIRECTORY / 'pyproject.toml'
)
elif BUILD_SYSTEM == "pixi":
shutil.move(
build_system_dir / "pyproject.toml",
PROJECT_DIRECTORY / 'pyproject.toml'
)
elif BUILD_SYSTEM == "poetry":
shutil.move(
build_system_dir / "pyproject.toml",
Expand Down
1 change: 1 addition & 0 deletions src/scicookie/profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ build_system:
- maturin
- scikit-build-core
- pybind11
- pixi
visible: true

command_line_interface:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
flit install
{%- elif cookiecutter.build_system == "pdm" %}
pdm install
{%- elif cookiecutter.build_system == "pixi" %}
pixi install
{%- else %}
pip install .
{%- endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
flit install
{%- elif cookiecutter.build_system == "pdm" %}
pdm install
{%- elif cookiecutter.build_system == "pixi" %}
pixi install
{%- else %}
pip install .
{%- endif %}
Expand Down
2 changes: 2 additions & 0 deletions src/scicookie/{{cookiecutter.project_slug}}/.makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ groups:
maturin build
{%- elif cookiecutter.build_system == "pybind11" %}
python -m build
{%- elif cookiecutter.build_system == "pixi" %}
cargo build
{%- endif %}
release:
Expand Down
2 changes: 2 additions & 0 deletions src/scicookie/{{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ build:
maturin build
{%- elif cookiecutter.build_system == "pybind11" %}
python -m build
{%- elif cookiecutter.build_system == "pixi" %}
cargo build
{%- endif %}

.PHONY:release-ci
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dependencies:
{%- elif cookiecutter.build_system == "pybind11" %}
- pybind11
- cmake
{%- elif cookiecutter.build_system == "pixi" %}
- pixi
{%- endif %}
- nodejs # used by semantic-release
{%- if cookiecutter.use_shellcheck == "yes" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ cmake
{%- elif cookiecutter.build_system == "pybind11" %}
pybind11
cmake
{%- elif cookiecutter.build_system == "pixi" %}
pixi
{%- endif %}
nodejs # used by semantic-release
{%- if cookiecutter.use_shellcheck == "yes" %}
Expand Down
1 change: 1 addition & 0 deletions tests/profiles/test-depends-on.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ build_system:
- maturin
- scikit-build-core
- pybind11
- pixi
visible: true

command_line_interface:
Expand Down
1 change: 1 addition & 0 deletions tests/profiles/test-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ build_system:
- maturin
- scikit-build-core
- pybind11
- pixi
visible: true

command_line_interface:
Expand Down
2 changes: 2 additions & 0 deletions tests/smoke/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ if command -v poetry &> /dev/null; then
poetry install
elif command -v flit &> /dev/null; then
flit install
elif command -v pixi &> /dev/null; then
pixi install
elif command -v meson &> /dev/null; then
BUILD_SYSTEM="mesonpy"
pip install ".[dev]"
Expand Down
1 change: 1 addition & 0 deletions tests/smoke/build-systems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ SMOKE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. ${SMOKE_DIR}/base.sh "build_system=maturin"
. ${SMOKE_DIR}/base.sh "build_system=scikit-build-core"
. ${SMOKE_DIR}/base.sh "build_system=pybind11"
. ${SMOKE_DIR}/base.sh "build_system=pixi"
. ${SMOKE_DIR}/base.sh "build_system=poetry"

0 comments on commit 5baf191

Please sign in to comment.