Skip to content

Commit 1dd8781

Browse files
authored
Generate supported python versions based on current and next required (home-assistant#62618)
1 parent f4e9187 commit 1dd8781

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

script/hassfest/requirements.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from collections import deque
55
import json
6-
import operator
76
import os
87
import re
98
import subprocess
@@ -13,7 +12,7 @@
1312
from stdlib_list import stdlib_list
1413
from tqdm import tqdm
1514

16-
from homeassistant.const import REQUIRED_PYTHON_VER
15+
from homeassistant.const import REQUIRED_NEXT_PYTHON_VER, REQUIRED_PYTHON_VER
1716
import homeassistant.util.package as pkg_util
1817
from script.gen_requirements_all import COMMENT_REQUIREMENTS, normalize_package_name
1918

@@ -29,8 +28,10 @@
2928
PIP_VERSION_RANGE_SEPARATOR = re.compile(r"^(==|>=|<=|~=|!=|<|>|===)?(.*)$")
3029
SUPPORTED_PYTHON_TUPLES = [
3130
REQUIRED_PYTHON_VER[:2],
32-
tuple(map(operator.add, REQUIRED_PYTHON_VER, (0, 1, 0)))[:2],
3331
]
32+
if REQUIRED_PYTHON_VER[0] == REQUIRED_NEXT_PYTHON_VER[0]:
33+
for minor in range(REQUIRED_PYTHON_VER[1] + 1, REQUIRED_NEXT_PYTHON_VER[1] + 1):
34+
SUPPORTED_PYTHON_TUPLES.append((REQUIRED_PYTHON_VER[0], minor))
3435
SUPPORTED_PYTHON_VERSIONS = [
3536
".".join(map(str, version_tuple)) for version_tuple in SUPPORTED_PYTHON_TUPLES
3637
]

0 commit comments

Comments
 (0)