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

views/status: stop depending on packaging.version.LegacyVersion #2366

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kiritofeng
Copy link
Member

Closes #2116.

@kiritofeng
Copy link
Member Author

Edit: this fails with

Traceback (most recent call last):
  File "venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "venv/lib/python3.11/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 106, in version_matrix
    languages = sorted(languages, key=lambda lang: version.parse(lang.name))
  File "site/judge/views/status.py", line 106, in <lambda>
    languages = sorted(languages, key=lambda lang: version.parse(lang.name))
  File "venv/lib/python3.11/site-packages/packaging/version.py", line 56, in parse
    return Version(version)
  File "venv/lib/python3.11/site-packages/packaging/version.py", line 202, in __init__
    raise InvalidVersion(f"Invalid version: {version!r}")

Exception Type: InvalidVersion at /runtimes/matrix/
Exception Value: Invalid version: 'Ada'

@int-y1
Copy link
Contributor

int-y1 commented Dec 22, 2024

languages = sorted(languages, key=lambda lang: version.parse(lang.name))

the code is written like this because Java 8 must appear before Java 10. i wonder if there's an alternative.

or you can unsupport java and just use key=lambda lang: lang.name

@JasonLovesDoggo
Copy link

the code is written like this because Java 8 must appear before Java 10. i wonder if there's an alternative.

What's the harm in just having Java 10 after Java 8? In the current version java (latest) (22.0.1) appears before java 8

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 this pull request may close these issues.

Pin packaging to 21.*
3 participants