Skip to content
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

feat: Add pixi to the template #305

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
76172d8
edit files for add pixi
YurelyCamacho Jul 20, 2024
3b32a06
add basic structure for pixi
YurelyCamacho Jul 20, 2024
53e2c35
add configuration to pixipyproject.toml
YurelyCamacho Jul 25, 2024
54af08c
update pixi pyproject.toml
YurelyCamacho Jul 25, 2024
57a0be5
update pyproject.toml
YurelyCamacho Jul 30, 2024
6be875e
add setuptools
YurelyCamacho Jul 31, 2024
2069cb3
update requires-python in base-pyproject.toml
YurelyCamacho Jul 31, 2024
38ce950
change requires-python
YurelyCamacho Jul 31, 2024
19b1c13
change python version
YurelyCamacho Jul 31, 2024
9097f22
update
YurelyCamacho Jul 31, 2024
5224018
change in files for cargo build
YurelyCamacho Jul 31, 2024
1d239cd
changes in base to hatch
YurelyCamacho Jul 31, 2024
313d365
update command
YurelyCamacho Jul 31, 2024
912b15e
changes cargo command
YurelyCamacho Jul 31, 2024
7bb2647
change cargo build command
YurelyCamacho Jul 31, 2024
ab2276a
add pip install command
YurelyCamacho Jul 31, 2024
798b20d
update files
YurelyCamacho Aug 1, 2024
4299eb2
build requirement
YurelyCamacho Aug 6, 2024
363b9a1
add build
YurelyCamacho Aug 6, 2024
bd04968
update pyproject.toml
YurelyCamacho Aug 6, 2024
9dcb01f
test with pixi
YurelyCamacho Aug 6, 2024
3481ed8
update base.sh
YurelyCamacho Aug 14, 2024
f59af07
move from conda pkg build to python-build for pixi
YurelyCamacho Sep 5, 2024
66eb1fb
fix commands test
YurelyCamacho Sep 5, 2024
0c0ec01
syntax error
YurelyCamacho Sep 5, 2024
7ce382e
buiold commands
YurelyCamacho Sep 10, 2024
0297eb0
pixi commands
YurelyCamacho Sep 11, 2024
2298259
revert command
YurelyCamacho Sep 11, 2024
1ae3de4
update
YurelyCamacho Sep 12, 2024
71323f2
fix build
YurelyCamacho Sep 12, 2024
931a924
version build
YurelyCamacho Sep 12, 2024
93b9c2a
build-system table
YurelyCamacho Sep 12, 2024
dde94ab
fix pyproject.toml
YurelyCamacho Sep 12, 2024
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 poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
create = false
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 @@ -264,6 +266,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" %}
python -m 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" %}
python -m build
{%- endif %}

.PHONY:release-ci
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{%- endif %}
dev = [
{#- keep this line here -#}
{%- if cookiecutter.build_system in ["setuptools", "pybind11"] %}
{%- if cookiecutter.build_system in ["setuptools", "pybind11", "pixi"] %}
"build>=0.10.0",
{%- endif -%}
{%- if cookiecutter.use_pytest == "yes" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = [
{ name = "{{ cookiecutter.author_full_name }}", email = "{{ cookiecutter.author_email }}" },
]
description = "{{ cookiecutter.project_short_description }}"
{% if cookiecutter.build_system not in ["setuptools", "pybind11"]%}
{% if cookiecutter.build_system not in ["setuptools", "pybind11", "pixi"]%}
{% if cookiecutter.project_layout == "src" -%}
packages = [
{include = "{{ cookiecutter.package_slug }}", from="src"},
Expand Down Expand Up @@ -48,7 +48,7 @@ version = "{{ cookiecutter.project_version }}"
{% else %}
dynamic = ["version"]
{% endif -%}
requires-python = ">=3.8.1,<4"
requires-python = ">=3.8.6,<4"
dependencies = [
# note: add your dependencies here
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[build-system]
requires = ["setuptools>=65", "wheel", "build>=1.2.2"]
build-backend = "setuptools.build_meta"

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]

[tool.pixi.pypi-dependencies]
"{{ cookiecutter.project_slug }}" = { path = ".", editable = true }

[pypi-dependencies]
build = ">=1.2.2"

{% include "build-system/base/pyproject.toml" %}
{% include "build-system/base/dev-deps-pyproject.toml" %}
{% include "build-system/base/urls-pyproject.toml" %}
{% include "build-system/base/dev-deps-config-pyproject.toml" %}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ dependencies:
{%- elif cookiecutter.build_system == "pybind11" %}
- pybind11
- cmake
{%- elif cookiecutter.build_system == "pixi" %}
- setuptools
- pixi
- python-build
{%- 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,10 @@ cmake
{%- elif cookiecutter.build_system == "pybind11" %}
pybind11
cmake
{%- elif cookiecutter.build_system == "pixi" %}
setuptools
pixi
build
{%- 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
20 changes: 12 additions & 8 deletions tests/smoke/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ export PATH=$(echo $PATH| sed -E "s/[^:]+\/scicookie\/[^:]+//g")

BUILD_SYSTEM="others"

COMMAND_PREFIX=
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
COMMAND_PREFIX="pixi run"
pip install ".[dev]"
elif command -v meson &> /dev/null; then
BUILD_SYSTEM="mesonpy"
pip install ".[dev]"
Expand All @@ -97,23 +101,23 @@ else
pip install ".[dev]"
fi

ipython kernel install --name "python3" --user
$COMMAND_PREFIX ipython kernel install --name "python3" --user

if command -v makim &> /dev/null; then
makim tests.linter
makim docs.build
makim package.build
$COMMAND_PREFIX makim tests.linter
$COMMAND_PREFIX makim docs.build
$COMMAND_PREFIX makim package.build
elif command -v make &> /dev/null; then
make lint
make docs-build
make build
$COMMAND_PREFIX make lint
$COMMAND_PREFIX make docs-build
$COMMAND_PREFIX make build
else
echo "Makim and Make were not found in the system."
exit 1

fi

python -c "import osl_python_package as mypkg; assert mypkg.__version__ == '0.1.0'"
$COMMAND_PREFIX python -c "import osl_python_package as mypkg; assert mypkg.__version__ == '0.1.0'"

if [[ "$BUILD_SYSTEM" == "maturin" ]]; then
python -c "from osl_python_package import add; add(1, 1)"
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"
Loading