MolSSI / QCEngine

Quantum chemistry program executor and IO standardizer (QCSchema).
https://molssi.github.io/QCEngine/
BSD 3-Clause "New" or "Revised" License
163 stars 79 forks source link

Release artifact tarballs are missing qcengine/_version.py replacement #337

Closed mbanck closed 2 years ago

mbanck commented 2 years ago

Describe the bug Psi4's FindPythonModule cmake module fails to find qcengine because it can't figure out the version:

Setting up python3-qcengine (0.21.0-1) ...
[...]
-- Suitable qcengine could not be located, Building qcengine instead.

The Cache has:

psi4-1.5# grep -i qcengine builddir/CMakeCache.txt 
//Location of Python module qcengine
PY_qcengine:STRING=/usr/lib/python3/dist-packages/qcengine
//Version of Python module qcengine
qcengine_VERSION:STRING=0+unknown

Same if I run qcengine info:

psi4-1.5# qcengine info | grep QCEngine
QCEngine:    0+unknown

This seems to be because the tarball if downloaded from Github still has (contrary to the QCElemental tarball, but I couldn't figure out why) the placeholders:

$ grep git_ QCEngine-0.21.0/qcengine/_version.py | head -4
    git_refnames = "$Format:%d$"
    git_full = "$Format:%H$"
    git_date = "$Format:%ci$"
    keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}

I also checked (randomly) the 0.13.0 tarball, and it's the same there.

QCElemental's tarball e.g. has:

$ grep git_ QCElemental-0.24.0/qcelemental/_version.py | head -4
    git_refnames = " (HEAD -> master, tag: v0.24.0)"
    git_full = "cabec4a7d1095b656320f2c842f0e132149e4bd1"
    git_date = "2021-11-18 14:41:00 -0500"
    keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}

To Reproduce

wget -O - https://github.com/MolSSI/QCEngine/archive/refs/tags/v0.21.0.tar.gz 2> /dev/null | zcat | tar xO | grep git_ | head -5
__git_revision__ = get_information("git_revision")
    git_refnames = "$Format:%d$"
    git_full = "$Format:%H$"
    git_date = "$Format:%ci$"
    keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}

Expected behavior

Same as QCElemental

loriab commented 2 years ago

Thanks for the report. I see some differences here https://github.com/MolSSI/QCElemental/blob/ff52f1460cdcd49f2255e507e5f389a4ffb247e5/setup.cfg#L35-L36 that I'll investigate Tuesday.

loriab commented 2 years ago

ok, it was missing qcengine/_version.py export-subst in .gitattributes that git-archive must act on to create the tarball. would a patch release with this be helpful?

mbanck commented 2 years ago

I very crudely patched in the commit ref in the Debian package[0], so personally I'm fine, but I think this might be worth making a release for, thanks for tracking it down and fixing it!

[0] https://salsa.debian.org/debichem-team/qcengine/-/blob/master/debian/patches/fix_version.py