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

Pin packaging to 21.* #2116

Open
adambenali opened this issue Jan 8, 2023 · 2 comments · Fixed by #2138 · May be fixed by #2366
Open

Pin packaging to 21.* #2116

adambenali opened this issue Jan 8, 2023 · 2 comments · Fixed by #2138 · May be fixed by #2366

Comments

@adambenali
Copy link
Contributor

packaging 22 drops support for LegacyVersion which causes the version matrix page to fail when a language does not have a specified version. The stack trace is:

Traceback (most recent call last):
  File "/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/site/judge/views/status.py", line 98, in version_matrix
    versions.versions = [version.parse(runtime.version) for runtime in versions]
  File "/site/judge/views/status.py", line 98, in <listcomp>
    versions.versions = [version.parse(runtime.version) for runtime in versions]
  File "/venv/lib/python3.10/site-packages/packaging/version.py", line 52, in parse
    return Version(version)
  File "/venv/lib/python3.10/site-packages/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: ''

Going back to packaging 21.3 fixes the issue.

I suggest to update requirements.txt to have

packaging<22
Xyene added a commit to Xyene/online-judge that referenced this issue Jan 22, 2023
Temporarily fixes DMOJ#2116. We should look into migrating off of
`LegacyVersion` in the future.
Xyene added a commit that referenced this issue Jan 22, 2023
Temporarily fixes #2116. We should look into migrating off of
`LegacyVersion` in the future.
@Xyene
Copy link
Member

Xyene commented Jan 22, 2023

Thanks for reporting this. I've pinned packaging to < 22, but will keep this issue open as a reminder to switch off of LegacyVersion.

@Ninjaclasher
Copy link
Member

I think all languages that do have versions have valid versions that can be parsed. We just need to check languages that don't have versions.

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