Skip to content

Commit

Permalink
Merge pull request #119 from robotpy/2024
Browse files Browse the repository at this point in the history
Exclude prereleases when checking for updates
  • Loading branch information
virtuald authored Dec 12, 2024
2 parents 1fa1e9b + d86e1c3 commit 88a4946
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion robotpy_installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,14 @@ def get_pypi_version(self, package: str, use_certifi: bool) -> Version:

# Sort the versions
maxv = Version(str(int(_WPILIB_YEAR) + 1))
versions = sorted(v for v in versions if v < maxv)

def _version_ok(v: Version) -> bool:
ok = v < maxv and not v.is_devrelease
if ok and not _IS_BETA:
ok = not v.is_prerelease
return ok

versions = sorted(v for v in versions if _version_ok(v))
if not versions:
raise InstallerException(f"could not find {package} version on pypi")

Expand Down

0 comments on commit 88a4946

Please sign in to comment.