From cb4d32338f1af03ca9355571e00c7fece5b922b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 28 Nov 2024 09:16:36 +0100 Subject: [PATCH] build: Small updates to build infrastructure (#143) --- .github/workflows/build.yaml | 3 ++- pixi.toml | 3 --- scripts/conda/build.sh | 5 ++--- scripts/conda/recipe/meta.yaml | 28 +++++++++++++++++----------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f7c755b7..afe05131 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -74,6 +74,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" + channels: "conda-forge" - name: conda setup run: | conda install -y anaconda-client @@ -120,7 +121,7 @@ jobs: - name: Install package run: python -m pip install dist/*.whl - name: Import package - run: python -c "import $PACKAGE; print($PACKAGE.__version__)" + run: python -c "import $PACKAGE; print($PACKAGE._version.__version__)" pip_publish: name: Publish PyPI diff --git a/pixi.toml b/pixi.toml index 763aaeb3..53b64366 100644 --- a/pixi.toml +++ b/pixi.toml @@ -38,9 +38,6 @@ python = "3.11.*" [feature.py312.dependencies] python = "3.12.*" -[feature.py313] -channels = ["pyviz/label/dev", "conda-forge/label/python_rc", "conda-forge"] - [feature.py313.dependencies] python = "3.13.*" diff --git a/scripts/conda/build.sh b/scripts/conda/build.sh index 470a9cf8..fe643736 100755 --- a/scripts/conda/build.sh +++ b/scripts/conda/build.sh @@ -4,12 +4,11 @@ set -euxo pipefail PACKAGE="holonote" -python -m build -w . +python -m build --sdist . VERSION=$(python -c "import $PACKAGE; print($PACKAGE._version.__version__)") export VERSION -conda config --env --set conda_build.pkg_format 2 -conda build scripts/conda/recipe --no-anaconda-upload --no-verify +conda build scripts/conda/recipe --no-anaconda-upload --no-verify -c conda-forge --package-format 2 mv "$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.conda" dist diff --git a/scripts/conda/recipe/meta.yaml b/scripts/conda/recipe/meta.yaml index e1c6ec42..db01e0e9 100644 --- a/scripts/conda/recipe/meta.yaml +++ b/scripts/conda/recipe/meta.yaml @@ -1,34 +1,40 @@ -{% set data = load_file_data('../../../pyproject.toml', from_recipe_dir=True) %} - +{% set pyproject = load_file_data('../../../pyproject.toml', from_recipe_dir=True) %} +{% set project = pyproject['project'] %} package: - name: holonote + name: {{ project["name"] }} version: {{ VERSION }} source: - url: ../../../dist/holonote-{{ VERSION }}-py3-none-any.whl + url: ../../../dist/{{ project["name"] }}-{{ VERSION }}.tar.gz build: noarch: python script: - - {{ PYTHON }} -m pip install -vv holonote-{{ VERSION }}-py3-none-any.whl + - {{ PYTHON }} -m pip install -vv . requirements: host: - - python {{ data['project']['requires-python']}} + - python {{ project['requires-python'] }} + {% for dep in pyproject['build-system']['requires'] %} + - {{ dep }} + {% endfor %} run: - - python {{ data['project']['requires-python']}} - - {% for dep in data['project']['dependencies'] %} + - python {{ project['requires-python'] }} + {% for dep in project['dependencies'] %} - {{ dep.lower() }} {% endfor %} test: imports: - holonote + commands: + - pip check + requires: + - pip about: license: BSD-3-Clause - summary: {{ data['project']['description'] }} - description: {{ data['project']['readme'] }} + summary: {{ project['description'] }} + description: {{ project['readme'] }}