Skip to content

Commit 4b15896

Browse files
committed
update versioning to use GIT_DESCRIBE_TAG for package versioning in meta.yaml
1 parent f8952fe commit 4b15896

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
run: |
2727
conda create -n test_vtools3 -y conda-build conda-verify numpy anaconda-client setuptools-scm
2828
source $CONDA/etc/profile.d/conda.sh
29+
GIT_DESCRIBE_TAG=$(git describe --tags --abbrev=0)
2930
conda activate test_vtools3
3031
conda config --set anaconda_upload yes
3132
conda build -c cadwr-dms -c conda-forge --user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" conda.recipe

conda.recipe/meta.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{# raw is for ignoring templating with cookiecutter, leaving it for use with conda-build -#}
22
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
33
{% set project = pyproject['project'] %}
4-
{% set version = load_setup_py_data().get('version', '0.0.0') %}
4+
#{% set version = load_setup_py_data().get('version', '0.0.0') %}
55

66
package:
77
name: vtools3
8-
version: {{ version }}
8+
version: {{ GIT_DESCRIBE_TAG }}
99

1010
source:
1111
path: ..
@@ -15,6 +15,8 @@ build:
1515
# separate bld.bat and build.sh files instead of this key. Add the line
1616
# "skip: True # [py<35]" (for example) to limit to Python 3.5 and newer, or
1717
# "skip: True # [not win]" to limit to Windows.
18+
script_env:
19+
- SETUPTOOLS_SCM_PRETEND_VERSION={{ GIT_DESCRIBE_TAG }}
1820
script: {{ PYTHON }} -m pip install --no-build-isolation --no-deps --ignore-installed -vv .
1921
noarch: python
2022
number: 0

0 commit comments

Comments
 (0)