Skip to content

Commit f3fd408

Browse files
committed
build: conda
1 parent 165e1b6 commit f3fd408

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,10 @@ publish-pypi: # publish the pypi package
6161
@exec echo twine upload ./dist/*-py3-none-any.whl
6262
@exec echo
6363
@exec echo https://pypi.org/project/datalayer-core/#history
64+
65+
publish-conda: # publish the conda package
66+
@exec echo
67+
cd ./conda-recipe; ./publish-conda.sh
68+
@exec echo
69+
@exec echo https://anaconda.org/datalayer/datalayer-core
70+
@exec echo conda install datalayer::datalayer-core

conda-recipe/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Building the Conda Package

conda-recipe/meta.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package:
2+
name: datalayer-core
3+
version: "{{ DATALAYER_CORE_VERSION }}"
4+
5+
source:
6+
path: ../
7+
8+
channels:
9+
- datalayer
10+
11+
build:
12+
noarch: python
13+
script: "{{ PYTHON }} -m pip install . -vv"
14+
15+
requirements:
16+
build:
17+
- python
18+
- hatch-jupyter-builder>=0.5
19+
- hatch-nodejs-version
20+
- hatchling
21+
run:
22+
- python
23+
24+
test:
25+
imports:
26+
- datalayer_core

conda-recipe/post-link.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/bash

conda-recipe/publish-conda.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
export DATALAYER_CORE_VERSION=1.0.23
4+
5+
CONDA_CHANNEL_NAME=datalayer
6+
ORGANIZATION=datalayer
7+
8+
# Make sure the script stops on any error (errors are otherwise hard to spot)
9+
set -o errtrace -o nounset -o pipefail -o errexit
10+
11+
rm -fr ./out
12+
13+
PKG_PATH=$(conda-build --output-folder ./out . -c defaults)
14+
15+
echo $PKG_PATH generated
16+
17+
# Upload the package to a conda channel.
18+
# anaconda upload $PKG_PATH -c $CONDA_CHANNEL_NAME
19+
# Upload the package to a conda organization.
20+
anaconda upload --user $ORGANIZATION $PKG_PATH

0 commit comments

Comments
 (0)