Skip to content

Instantly share code, notes, and snippets.

@phaustin
Last active December 24, 2018 16:07
Show Gist options
  • Select an option

  • Save phaustin/78eeff18ee074e301511e2a672c6d0bd to your computer and use it in GitHub Desktop.

Select an option

Save phaustin/78eeff18ee074e301511e2a672c6d0bd to your computer and use it in GitHub Desktop.
git tags in code

(https://github.com/pybind/python_example/blob/master/conda.recipe/meta.yaml)

Does it provide meaningful tags?
# Basic versioneer, I don't want to run the setup.py before things are required
{% if environ.get('GIT_DESCRIBE_NUMBER') == '0' %}
{% set version = environ.get('GIT_DESCRIBE_TAG') %}
{% else %}
{% set version = environ.get('GIT_DESCRIBE_TAG', '') + '+' + environ.get('GIT_DESCRIBE_NUMBER', '') %}
{% endif %}
this is my super basic versionner implementation in jinja
oh, i forgot, this has to be in the repo that contains the source
sorry
:/
(meta.yaml file with the source in the same repo)

Marius van Niekerk @mariusvniekerk 06:47
sure
I use this
version: "{{ GIT_DESCRIBE_TAG }}{% if GIT_DESCRIBE_NUMBER| int > 0 %}dev{{ GIT_DESCRIBE_NUMBER }}{% endif %}"

Mark Harfouche @hmaarrfk 06:48
keeping it in my notes :D
did you ever look at lief? I coudln't beblieve so many things failed...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment