conda-forge / hdmf-feedstock

A conda-smithy repository for hdmf.
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Conda-forge packages of hdmf misidentify their version #68

Closed pgunn closed 1 year ago

pgunn commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

The hdmf package in conda-forge misreports its version string to both pip and to general python versioning mechanisms:

>>> import hdmf
>>> hdmf.__version__
'0.0.0'
>>>
(caiman) pgunn@penguin:~$ conda list hdmf
# packages in environment at /home/pgunn/miniconda3/envs/caiman:
#
# Name                    Version                   Build  Channel
hdmf                      3.6.1              pyh1a96a4e_0    conda-forge
(caiman) pgunn@penguin:~$ pip list | grep hdmf
hdmf                          0.0.0

This creates problems for things like pip check as well as any other system that wants to check versions of dependencies.

The problem does not occur with pip installs of hdmf.

Installed packages

...

Environment info

...
pgunn commented 1 year ago

I spent awhile trying to figure out why the version wasn't being figured out and couldn't get there; asked a few other people to give it a look. It might help to switch over to using github tarballs:

>>> It's not my package, but I'm enjoying trying to figure out why conda-forge packaging of hdmf results in it (and pip/distutils) not understanding its version and reporting it as 0.0.0 while pip installs of the same don't have the problem. Been poring over its feedstock and build artefacts to try to figure it out.
Probably because setuptools_scm needs to be told the version explicitly when using sdists instead of git tarballs
rly commented 1 year ago

Hi @pgunn, thanks for the bug report! Here is what I get now with the latest release. Could you please see if upgrading fixes the issue for you?

test ❯ python
Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:41:52) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hdmf
hdmf.__version__
>>> hdmf.__version__
'3.8.1'
pgunn commented 1 year ago

Yes, looks good now. Thanks!