diff --git a/robotpy_installer/installer.py b/robotpy_installer/installer.py index 374cd2c..e7c1e1d 100755 --- a/robotpy_installer/installer.py +++ b/robotpy_installer/installer.py @@ -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")