mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Generate supported python versions based on current and next required (#62618)
This commit is contained in:
parent
f4e9187d01
commit
1dd87810bc
@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections import deque
|
from collections import deque
|
||||||
import json
|
import json
|
||||||
import operator
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -13,7 +12,7 @@ from awesomeversion import AwesomeVersion, AwesomeVersionStrategy
|
|||||||
from stdlib_list import stdlib_list
|
from stdlib_list import stdlib_list
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
from homeassistant.const import REQUIRED_PYTHON_VER
|
from homeassistant.const import REQUIRED_NEXT_PYTHON_VER, REQUIRED_PYTHON_VER
|
||||||
import homeassistant.util.package as pkg_util
|
import homeassistant.util.package as pkg_util
|
||||||
from script.gen_requirements_all import COMMENT_REQUIREMENTS, normalize_package_name
|
from script.gen_requirements_all import COMMENT_REQUIREMENTS, normalize_package_name
|
||||||
|
|
||||||
@ -29,8 +28,10 @@ PIP_REGEX = re.compile(r"^(--.+\s)?([-_\.\w\d]+.*(?:==|>=|<=|~=|!=|<|>|===)?.*$)
|
|||||||
PIP_VERSION_RANGE_SEPARATOR = re.compile(r"^(==|>=|<=|~=|!=|<|>|===)?(.*)$")
|
PIP_VERSION_RANGE_SEPARATOR = re.compile(r"^(==|>=|<=|~=|!=|<|>|===)?(.*)$")
|
||||||
SUPPORTED_PYTHON_TUPLES = [
|
SUPPORTED_PYTHON_TUPLES = [
|
||||||
REQUIRED_PYTHON_VER[:2],
|
REQUIRED_PYTHON_VER[:2],
|
||||||
tuple(map(operator.add, REQUIRED_PYTHON_VER, (0, 1, 0)))[:2],
|
|
||||||
]
|
]
|
||||||
|
if REQUIRED_PYTHON_VER[0] == REQUIRED_NEXT_PYTHON_VER[0]:
|
||||||
|
for minor in range(REQUIRED_PYTHON_VER[1] + 1, REQUIRED_NEXT_PYTHON_VER[1] + 1):
|
||||||
|
SUPPORTED_PYTHON_TUPLES.append((REQUIRED_PYTHON_VER[0], minor))
|
||||||
SUPPORTED_PYTHON_VERSIONS = [
|
SUPPORTED_PYTHON_VERSIONS = [
|
||||||
".".join(map(str, version_tuple)) for version_tuple in SUPPORTED_PYTHON_TUPLES
|
".".join(map(str, version_tuple)) for version_tuple in SUPPORTED_PYTHON_TUPLES
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user