srnas / barnaba

Analyse Nucleic Acids Structure and Simulations with baRNAba
GNU General Public License v3.0
38 stars 15 forks source link

setuptools_scm does not work with git archives #18

Closed GiovanniBussi closed 6 years ago

GiovanniBussi commented 6 years ago

Inferring the version with setuptools_scm makes it impossible to work with git archives (that is: what you download as a release from github). This is a known problem of setuptools_scm.

Here's a possible solution: https://github.com/Changaco/setuptools_scm_git_archive

wouterboomsma commented 6 years ago

Annoying. What exactly does not work? An alternative is just to reintroduce the version number explicitly in the setup.py file - although the double representation is a little ugly.

On 20 February 2018 at 11:43, Giovanni notifications@github.com wrote:

Inferring the version with setuptools_scm makes it impossible to work with git archives (that is: what you download as a release from github). This is a known problem of setuptools_scm.

Here's a possible solution: https://github.com/Changaco/se tuptools_scm_git_archive

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/srnas/barnaba/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8sB1JR2DiapZAx-jVkMi7utJVCY4kTks5tWqHRgaJpZM4SLvjw .

GiovanniBussi commented 6 years ago

I noticed it setting up stuff for MacPorts, which by default downloads from a github archive. I have a workaround for that, which however is not completely satisfactory (I have to tell MacPorts to download directly from git, which makes it not able to cache the distfile). Anyway, all of this is pretty much MacPorts related and could be fixed in other ways.

The main symptom is the following:

The reason is actually straightforward: there is no version information stored in the tar.gz. The package I mentioned above (https://github.com/Changaco/setuptools_scm_git_archive) recommends creating a file that is changed by git upon export and that can then be used as a version number. Maybe with some python knowledge it is easy to modify setup.py so that the extra package is not even needed.

GiovanniBussi commented 6 years ago

A small update on this. I found out that MacPorts can also download directly from pypi (see here) so I think it will be easy to maintain the Portfile. So, from the MacPorts file the issue is solved.

So, the correct ways to install barnaba are:

People trying to install from the tarball would see the mysterious error above. I will add a comment in the README file.

wouterboomsma commented 6 years ago

Great that you found a solution! For future reference: if this issue ever turns up again in a different setting, we should just go back to representing the version number explicitly in setup.py.