diff --git a/install_utils.py b/install_utils.py index ee4a91aa661..d2e4cffa812 100644 --- a/install_utils.py +++ b/install_utils.py @@ -273,7 +273,10 @@ def python_is_compatible(): python_version = packaging.version.parse(platform.python_version()) version_range = packaging.specifiers.SpecifierSet(version_specifier) - if python_version not in version_range: + # Pass prereleases=True so pre-release interpreters (e.g. 3.15.0b4) are + # accepted when they fall within the supported range; SpecifierSet + # excludes pre-releases by default. + if not version_range.contains(python_version, prereleases=True): print( f'ERROR: ExecuTorch does not support python version {python_version}: must satisfy "{version_specifier}"', file=sys.stderr, diff --git a/pyproject.toml b/pyproject.toml index 1bf343cfd5f..b09b022ca53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ classifiers = [ "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.10,<3.15" +requires-python = ">=3.10,<3.16" # Runtime dependencies are declared dynamically (see `dynamic` above) and # computed in setup.py, so the EXECUTORCH_BUILD_MINIMAL wheel can ship a slimmer