From 8007936561e11d3312a5087ffb52dbc033cecf0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 27 Nov 2024 17:29:30 +0100 Subject: [PATCH] build: Small updates to build infrastructure (#770) --- .github/workflows/build.yaml | 3 ++- geoviews/package-lock.json | 13 +++++++------ pyproject.toml | 2 ++ scripts/conda/build.sh | 8 ++++---- scripts/conda/recipe-core/meta.yaml | 4 ++-- scripts/conda/recipe-recommended/meta.yaml | 2 +- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cad5eca6..9bdc9129 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -77,6 +77,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" + channels: "conda-forge" - name: conda setup run: | conda install -y anaconda-client @@ -125,7 +126,7 @@ jobs: - name: Install package run: python -m pip install dist/*.whl - name: Test 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/geoviews/package-lock.json b/geoviews/package-lock.json index 1dccf5c9..4b907d38 100644 --- a/geoviews/package-lock.json +++ b/geoviews/package-lock.json @@ -858,9 +858,10 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2619,9 +2620,9 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", diff --git a/pyproject.toml b/pyproject.toml index fa34ecfb..76dd668b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,12 +68,14 @@ raw-options = { version_scheme = "no-guess-dev" } [tool.hatch.build.targets.wheel] include = ["geoviews"] +exclude = ["geoviews/node_modules"] [tool.hatch.build.targets.wheel.force-include] "geoviews/dist" = "geoviews/dist" [tool.hatch.build.targets.sdist] include = ["geoviews", "scripts"] +exclude = ["geoviews/node_modules"] [tool.hatch.build.targets.sdist.force-include] "geoviews/dist" = "geoviews/dist" diff --git a/scripts/conda/build.sh b/scripts/conda/build.sh index 4941a6df..d40dea1b 100755 --- a/scripts/conda/build.sh +++ b/scripts/conda/build.sh @@ -4,7 +4,7 @@ set -euxo pipefail PACKAGE="geoviews" -python -m build . # Can add -w when this is solved: https://github.com/pypa/hatch/issues/1305 +python -m build --sdist . VERSION=$(python -c "import $PACKAGE; print($PACKAGE._version.__version__)") export VERSION @@ -14,13 +14,13 @@ import bokeh from packaging.version import Version if Version(bokeh.__version__).is_prerelease: - print('bokeh/label/dev') + print('bokeh/label/rc') else: print('bokeh') ") -conda build scripts/conda/recipe-core --no-anaconda-upload --no-verify -c "$BK_CHANNEL" -c pyviz -conda build scripts/conda/recipe-recommended --no-anaconda-upload --no-verify -c "$BK_CHANNEL" -c pyviz +conda build scripts/conda/recipe-core --no-anaconda-upload --no-verify -c pyviz -c "$BK_CHANNEL" -c conda-forge --package-format 1 +conda build scripts/conda/recipe-recommended --no-anaconda-upload --no-verify -c pyviz -c "$BK_CHANNEL" -c conda-forge --package-format 1 mv "$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-core-$VERSION-py_0.tar.bz2" dist mv "$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2" dist diff --git a/scripts/conda/recipe-core/meta.yaml b/scripts/conda/recipe-core/meta.yaml index 89395f52..31735af7 100644 --- a/scripts/conda/recipe-core/meta.yaml +++ b/scripts/conda/recipe-core/meta.yaml @@ -6,11 +6,11 @@ package: version: {{ VERSION }} source: - url: ../../../dist/{{ project["name"] }}-{{ VERSION }}-py3-none-any.whl + url: ../../../dist/{{ project["name"] }}-{{ VERSION }}.tar.gz build: noarch: python - script: {{ PYTHON }} -m pip install --no-deps -vv {{ project["name"] }}-{{ VERSION }}-py3-none-any.whl + script: {{ PYTHON }} -m pip install --no-deps -vv . entry_points: {% for group,epoints in project.get("entry_points",{}).items() %} {% for entry_point in epoints %} diff --git a/scripts/conda/recipe-recommended/meta.yaml b/scripts/conda/recipe-recommended/meta.yaml index b7823cab..79fb89eb 100644 --- a/scripts/conda/recipe-recommended/meta.yaml +++ b/scripts/conda/recipe-recommended/meta.yaml @@ -6,7 +6,7 @@ package: version: {{ VERSION }} source: - url: ../../../dist/{{ project["name"] }}-{{ VERSION }}-py3-none-any.whl + url: ../../../dist/{{ project["name"] }}-{{ VERSION }}.tar.gz build: noarch: python