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

packaging==22.0 breaks aiidalab install #339

Open
danielhollas opened this issue Dec 14, 2022 · 7 comments · Fixed by #341
Open

packaging==22.0 breaks aiidalab install #339

danielhollas opened this issue Dec 14, 2022 · 7 comments · Fixed by #341
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Milestone

Comments

@danielhollas
Copy link
Contributor

Package packaging version 22.0 breaks the aiidalab install command. Here's what I see

$ aiidalab install aiidalab-widgets-base==2.0.0b0
Collecting apps matching requirements... /
Traceback (most recent call last):
  File "/opt/conda/envs/aiida-base/bin/aiidalab", line 10, in <module>
    sys.exit(cli())
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/aiidalab/__main__.py", line 399, in install
    install_candidates = {
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/aiidalab/__main__.py", line 400, in <dictcomp>
    requirement: _find_version_to_install(
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/aiidalab/__main__.py", line 297, in _find_version_to_install
    matching_releases = app.find_matching_releases(
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/aiidalab/app.py", line 225, in find_matching_releases
    specifier.filter(self.releases or [], prereleases=prereleases)
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/packaging/specifiers.py", line 979, in filter
    parsed_version = _coerce_version(item)
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/packaging/specifiers.py", line 25, in _coerce_version
    version = Version(version)
  File "/opt/conda/envs/aiida-base/lib/python3.9/site-packages/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: 'stable'

Downgrading to version 21.3 fixes the issue. We need to either constrain the version in setup.cfg or fix the underlying issue.

Note, in the current docker-stack this is not an issue since packaging is already installed in the underlying jupyter image. But as soon as they update we will break.

@danielhollas danielhollas added bug Something isn't working dependencies Pull requests that update a dependency file question Further information is requested labels Dec 14, 2022
@danielhollas
Copy link
Contributor Author

danielhollas commented Dec 14, 2022

Hmm, maybe packaging isn't to blame after all. I am playing with conda environments, perhaps I am doing something wrong...

EDIT: Nope, it's definitely packaging. I think aiidalab uses some non-standard version labels which results in breakage.

@danielhollas danielhollas removed the question Further information is requested label Dec 14, 2022
@danielhollas danielhollas self-assigned this Dec 14, 2022
@yakutovicha
Copy link
Member

yakutovicha commented Dec 14, 2022

Should we switch to flit? Happy to open a PR for that.

[UPDATE]
Oh, sorry - this is for the aiidalab functionality, not for the installation of AiiDAlab. Nevertheless, I think it makes sense to move aiidalab to flit.

@danielhollas
Copy link
Contributor Author

danielhollas commented Dec 14, 2022 via email

@yakutovicha
Copy link
Member

Not sure what you mean? The issue here is not with the build.

Yeah, I realised that later 😅 . That is why I wrote an update:

[UPDATE]
Oh, sorry - this is for the aiidalab functionality, not for the installation of AiiDAlab. Nevertheless, I think it makes sense to move aiidalab to flit.

@danielhollas

This comment was marked as off-topic.

@danielhollas
Copy link
Contributor Author

I will re-open this so that we remember to fix this properly (for now we only pinned to the old version of packaging).

@danielhollas danielhollas reopened this Jan 10, 2023
@danielhollas
Copy link
Contributor Author

I think this the same issue as in aiidalab/aiidalab-registry#103

@unkcpz unkcpz self-assigned this Mar 6, 2023
@danielhollas danielhollas added this to the v23.10 milestone Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants