gwastro / pycbc

Core package to analyze gravitational-wave data, find signals, and study their parameters. This package was used in the first direct detection of gravitational waves (GW150914), and is used in the ongoing analysis of LIGO/Virgo data.
http://pycbc.org
GNU General Public License v3.0
313 stars 347 forks source link

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

Open duncanmmacleod opened 2 years ago

duncanmmacleod commented 2 years ago

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  git@github.com:duncanmmacleod/pycbc-feedstock.git (fetch)
origin  git@github.com:duncanmmacleod/pycbc-feedstock.git (push)
regro-cf-autotick-bot   git@github.com:regro-cf-autotick-bot/pycbc-feedstock.git (fetch)
regro-cf-autotick-bot   git@github.com: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 <duncan.macleod@ligo.org>',
 'branch': 'master',
 'build_date': '2022-01-25 10:18:10 +0000',
 'builder': 'Duncan Macleod <duncan.macleod@ligo.org>',
 'committer': 'GitHub <noreply@github.com>',
 '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.

spxiwh commented 2 years ago

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

titodalcanton commented 1 year ago

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