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

Fix ordering of versions for alphas > 9 #129

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions local_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import List, Optional

import requests
import semver
from cookiecutter.utils import simple_filter

REGISTRIES = {
Expand Down Expand Up @@ -62,8 +63,10 @@ def latest_version(
version=v, min_version=min_version, max_version=max_version
)
],
key=lambda v: semver.VersionInfo.parse(v.replace("v", "")),
reverse=True,
)

if not include_alphas:
valid = [v for v in valid if "-" not in v]
return valid[0]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ requests_mock
pytest
pytest-cookies
wheel
semver