Skip to content

Commit

Permalink
build: Small updates to build infrastructure (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Nov 28, 2024
1 parent 1ee7cb1 commit cb4d323
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"

Expand Down
5 changes: 2 additions & 3 deletions scripts/conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 17 additions & 11 deletions scripts/conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -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'] }}

0 comments on commit cb4d323

Please sign in to comment.