Skip to content

Commit 5ad5fc9

Browse files
EliEli
authored andcommitted
Change version calc.
1 parent eef5f5c commit 5ad5fc9

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/python-package-conda.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,17 @@ jobs:
7676
shell: bash -l {0}
7777
run: |
7878
micromamba activate tools
79-
# Ensure setuptools-scm is available to run the CLI
80-
python -m pip install -q setuptools-scm
81-
export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm)
82-
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$SETUPTOOLS_SCM_PRETEND_VERSION" >> $GITHUB_ENV
79+
V=$(python -m setuptools_scm || true)
80+
if [ -z "$V" ]; then
81+
# fall back to tag name or short SHA; strip leading 'v' if present
82+
if [[ "${GITHUB_REF:-}" == refs/tags/* ]]; then
83+
V="${GITHUB_REF_NAME#v}"
84+
else
85+
V="0.0.0+${GITHUB_SHA::7}"
86+
fi
87+
fi
88+
echo "PKG_VERSION=$V" | tee -a "$GITHUB_ENV"
89+
8390
8491
- name: Build conda recipe (no tests first)
8592
shell: bash -l {0}

conda.recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
package:
88
name: schimpy
9-
version: {{ SETUPTOOLS_SCM_PRETEND_VERSION }}
9+
version: {{ environ.get('PKG_VERSION') }}
1010

1111
source:
1212
#git_url: https://github.com/CADWRDeltaModeling/schimpy.git

schimpy/params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import param
2-
32
from collections import namedtuple
43

54
Params = namedtuple("Params", ["core", "opt", "schout"])

0 commit comments

Comments
 (0)