Skip to content

Commit

Permalink
Exclude prereleases when checking for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Oct 31, 2024
1 parent 6e424ef commit d86e1c3
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 @@ -656,7 +656,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 d86e1c3

Please sign in to comment.