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

Update pcmdi_metrics/version.py #917

Closed
msahn opened this issue Apr 6, 2023 · 7 comments · Fixed by #918
Closed

Update pcmdi_metrics/version.py #917

msahn opened this issue Apr 6, 2023 · 7 comments · Fixed by #918
Assignees

Comments

@msahn
Copy link
Collaborator

msahn commented Apr 6, 2023

It seem that the latest version of PMP is 3.0.2, but the version in pcmdi_metrics/version.py is 3.0.1. I think it should be updated.

@lee1043
Copy link
Contributor

lee1043 commented Apr 6, 2023

@msahn nice catch! I think this file is just automatically generated after each install. If that is true, we may just remove version.py from the repository. Otherwise, yes, I will update it to 3.0.2. @acordonez do you have any idea?

@acordonez
Copy link
Collaborator

I think the release version is supposed to be updated in setup.py L14. I don't know that we currently use version.py for anything.

@lee1043 lee1043 linked a pull request Apr 6, 2023 that will close this issue
@lee1043
Copy link
Contributor

lee1043 commented Apr 6, 2023

@acordonez thank you for your comment. Any chance the conda release of conda feedstock will need the version.py file? Or they also refer to setup.py or something else?

@acordonez
Copy link
Collaborator

@lee1043 the conda release does not need version.py. It uses setup.py.

@acordonez
Copy link
Collaborator

@lee1043 Also noticing that version.py seems to get created when setup.py is run (L42-L46), so if we delete version.py we should also edit setup.py to remove those lines.

@lee1043
Copy link
Contributor

lee1043 commented Apr 7, 2023

@acordonez thanks for checking. I tested installing via setup.py after removing version.py and observed it generates version.py.

The version.py records version and identification of the last commit (git_sha1), which I guess for developers to track during local testing (or it may have been used for nightly release) but since we don't see any use of the version.py I think we can edit setup.py to remove those lines, as you suggested.

I opened PR for this and will ping you for safety check once the PR is ready.

@lee1043
Copy link
Contributor

lee1043 commented Apr 7, 2023

I found build test is failing in PR with below message:


==================================== ERRORS ====================================
___________________ ERROR collecting tests/test_resources.py ___________________
ImportError while importing test module '/home/runner/work/pcmdi_metrics/pcmdi_metrics/tests/test_resources.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/share/miniconda/envs/pcmdi_metrics_dev/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_resources.py:4: in <module>
    from pcmdi_metrics import resources
pcmdi_metrics/__init__.py:20: in <module>
    from .version import __git_sha1__, __git_tag_describe__, __version__  # noqa
E   ModuleNotFoundError: No module named 'pcmdi_metrics.version'
=============================== warnings summary ===============================

So I will bring version.py back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants