Accessing githash of a conda-installed package

227 Views Asked by At

I have some code that runs simulations and saves the results into text files.

To ensure reproducibility, I was also saving the git hash of the last commit , so that if I look a simulation several months later I can know exactly which commit was used to produce the result.

Now we are looking into making our code conda-installable. I know I can access the git hast in the conda recipe by using the {{ GIT_FULL_HASH }} env variable; and save it in the about section of my meta.yaml:

about:
  summary: data['description']
  description: data['long_description']
  githash: {{ GIT_FULL_HASH }}

is there a way I can access its value programmatically after the package has been built and installed, so that I can include it on the saved sim data?

0

There are 0 best solutions below