Skip to content

Commit 5cd0b55

Browse files
authored
Merge pull request #1717 from mathbunnyru/asalikhov/major_minor_python_version
Compare major.minor python version to be expected one
2 parents 5e1a27a + 84d041b commit 5cd0b55

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

mypy.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ ignore_missing_imports = True
2727
[mypy-matplotlib.*]
2828
ignore_missing_imports = True
2929

30-
[mypy-packaging.*]
31-
ignore_missing_imports = True
32-
3330
[mypy-pandas.*]
3431
ignore_missing_imports = True
3532

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
docker
2-
packaging
32
plumbum
43
pre-commit
54
pytest

tests/base-notebook/test_python.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@
22
# Distributed under the terms of the Modified BSD License.
33
import logging
44

5-
from packaging import version # type: ignore
6-
75
from tests.conftest import TrackedContainer
86

97
LOGGER = logging.getLogger(__name__)
8+
EXPECTED_PYTHON_VERSION = "3.10"
109

1110

12-
def test_python_version(
13-
container: TrackedContainer, python_next_version: str = "3.11"
14-
) -> None:
15-
"""Check that python version is lower than the next version"""
16-
LOGGER.info(f"Checking that python version is lower than {python_next_version}")
11+
def test_python_version(container: TrackedContainer) -> None:
12+
LOGGER.info(
13+
f"Checking that python major.minor version is {EXPECTED_PYTHON_VERSION}"
14+
)
1715
logs = container.run_and_wait(
1816
timeout=5,
1917
tty=True,
2018
command=["python", "--version"],
2119
)
2220
assert logs.startswith("Python ")
23-
actual_python_version = version.parse(logs.split()[1])
24-
assert actual_python_version < version.parse(
25-
python_next_version
26-
), f"Python version shall be lower than {python_next_version}"
21+
full_version = logs.split()[1]
22+
major_minor_version = full_version[: full_version.rfind(".")]
23+
24+
assert major_minor_version == EXPECTED_PYTHON_VERSION

0 commit comments

Comments
 (0)