Skip to content

Commit 3b0e728

Browse files
EliEli
authored andcommitted
Another version number variant.
1 parent 5ad5fc9 commit 3b0e728

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ jobs:
5959
conda-build
6060
boa
6161
anaconda-client
62+
setuptools-scm
6263
condarc: |
6364
channel_priority: strict
6465
channels:
6566
- conda-forge
66-
- cadwr-dms # uncomment if your recipe/tests need it
67+
- cadwr-dms
6768
6869
- name: Show env
6970
shell: bash -l {0}
@@ -76,16 +77,17 @@ jobs:
7677
shell: bash -l {0}
7778
run: |
7879
micromamba activate tools
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
80+
# 1) tag -> version
81+
if [[ "${GITHUB_REF:-}" == refs/tags/* ]]; then
82+
V="${GITHUB_REF_NAME#v}"
83+
else
84+
# 2) setuptools-scm (needs fetch-depth: 0)
85+
V=$(python -m setuptools_scm 2>/dev/null || true)
8786
fi
87+
# 3) fallback to 0.0.0+SHA
88+
[[ -z "$V" ]] && V="0.0.0+${GITHUB_SHA::7}"
8889
echo "PKG_VERSION=$V" | tee -a "$GITHUB_ENV"
90+
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$V" | tee -a "$GITHUB_ENV"
8991
9092
9193
- name: Build conda recipe (no tests first)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ exclude = ["docs"]
9393
select = ["NPY201"]
9494

9595
[tool.setuptools.packages.find]
96-
include = ["schimpy"]
96+
include = ["schimpy","schimpy.util"]
9797
exclude = ["docsrc"]
9898

9999
[tool.setuptools_scm]

schimpy/params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

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

6-
76
class Core(param.Parameterized):
87
ipre = param.Integer(
98
default=0, bounds=(0, 1), doc="Pre-processing flag (1: on; 0: off)"

0 commit comments

Comments
 (0)