pycbc icon indicating copy to clipboard operation
pycbc copied to clipboard

version_helper picks up the wrong git information when building from a tarball inside another git repo

Open duncanmmacleod opened this issue 2 years ago • 2 comments

With conda-forge, the package build is typically executed inside of a clone of the conda-forge feedstock repository for PyCBC. However, this means that when the PyCBC release tarball is unpacked, pycbc._version_helper picks up the wrong git information:

$ git remote -v
origin  [email protected]:duncanmmacleod/pycbc-feedstock.git (fetch)
origin  [email protected]:duncanmmacleod/pycbc-feedstock.git (push)
regro-cf-autotick-bot   [email protected]:regro-cf-autotick-bot/pycbc-feedstock.git (fetch)
regro-cf-autotick-bot   [email protected]:regro-cf-autotick-bot/pycbc-feedstock.git (push)
upstream        https://github.com/conda-forge/pycbc-feedstock.git (fetch)
upstream        https://github.com/conda-forge/pycbc-feedstock.git (push)
$ tar -xf PyCBC-2.0.1.tar.gz
$ cd PyCBC-2.0.1/
$ python -c "
import pprint;
from pycbc import _version_helper;
pprint.pprint(vars(_version_helper.generate_git_version_info()))
"
{'author': 'Duncan Macleod <[email protected]>',
 'branch': 'master',
 'build_date': '2022-01-25 10:18:10 +0000',
 'builder': 'Duncan Macleod <[email protected]>',
 'committer': 'GitHub <[email protected]>',
 'date': '2022-01-20 12:17:31 +0000',
 'hash': '65c2853069951016a45041baee7c423daa16683d',
 'last_release': None,
 'release': False,
 'status': 'CLEAN: All modifications committed',
 'tag': None,
 'version': '0.0a163'}

I can patch the build to force it to use the bundled pycbc/version.py, but it would be great to get this fixed upstream.

duncanmmacleod avatar Jan 25 '22 10:01 duncanmmacleod

Any suggestion on what is needed to fix this within PyCBC?

spxiwh avatar Jan 28 '22 13:01 spxiwh

Now that I am starting to get a bit familiar with conda-forge, I could try to pick this up.

titodalcanton avatar Mar 21 '23 18:03 titodalcanton