Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version number slightly broken #327

Open
phackstock opened this issue Feb 13, 2024 · 0 comments
Open

Version number slightly broken #327

phackstock opened this issue Feb 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@phackstock
Copy link
Contributor

phackstock commented Feb 13, 2024

As pointed out by @danielhuppmann, there are certain cases in which:

import nomenclature
nomenclature.__version__

prints out 0.0.0 or some other wrong number.
It's also 0.0.0 in readthedocs https://nomenclature-iamc.readthedocs.io/en/stable/.

Update

After some detective work with @meksor (thanks a lot), I think we've figured it out.
The issue with readthedocs should be resolved with #329.
@danielhuppmann the issue that you've reported where your local version number is 0.0.0. seems to be related to the same issue, i.e. not having the poetry dynamic versioning plugin installed. If you've installed nomenclature from GitHub using pip install instead of poetry install, I'd be curious how you did that since it should not work anymore.
That being said, the installation instructions from GitHub are outdated in the README and in the docs.
I think we should remove this option altogether from the README and the docs and just suggest installing from pypi.
We'd keep the instructions on how to install from GitHub only in the DEVELOPING.rst.

Finally, the way nomenclature.__version__ currently works is that it's using importlib.metadata.version. This reads as the name suggests the metadata file in the site-packages. This is only set when you run poetry install. However, running poetry install in a poetry repository emulates the behavior of running the -e flag for pip install. This means that all current local changes will be active but nomenclature.__version__ will show the version number from the last time it was installed.
This is potentially confusing and can be remedied by using poetry version to get the version number instead.
I could implement it this way.

@phackstock phackstock added the bug Something isn't working label Feb 13, 2024
@phackstock phackstock self-assigned this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant