Skip to content

Commit

Permalink
Remove Python Upper Bound Requirements (#1506)
Browse files Browse the repository at this point in the history
* initial draft for python 3.11 support

* update release doc

* add python warnings for e2e tests

* modify e2e test

* modify e2e test

* test by removing lower req scenario

* skip e2e tests for lower bound requirement on python 3.11

* skip e2e tests for lower bound requirement on python 3.11

* remove python upperbounds initial draft

* fix lint and format errors

* test remove upperbound warning

* test lowerbound pandas install

* revert back pandas requirement

* bump lower requirements for pandas

* remove upper bound clean up

* update release notes

* fix PR comments

---------

Co-authored-by: Nok Lam Chan <nok_lam_chan@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
  • Loading branch information
ravi-kumar-pilla and noklam committed Aug 31, 2023
1 parent d935065 commit 02a5073
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 7 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Please follow the established format:
## Bug fixes and other changes

- Fix to search for a '<lambda' Python function in the sidebar. (#1497)
- Remove python upper-bound requirements and add KedroVizPythonVersion warning. (#1506)

# Release 6.4.0

Expand Down
5 changes: 0 additions & 5 deletions package/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ def before_scenario(context, scenario):
print(f"{scenario} will be skipped on Windows with Python 3.7")
scenario.skip()

# skip lower-bound scenario for python versions greater than 3.10
if sys.version_info >= (3, 11) and "lower-bound" in scenario.name:
print(f"{scenario} will be skipped for Python version greater than 3.10")
scenario.skip()

for step in scenario.steps:
if "I have installed kedro version" in step.name:
match = re.search(r"\b\d+\.\d+\.\d+\b", step.name)
Expand Down
2 changes: 1 addition & 1 deletion package/features/steps/lower_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ uvicorn[standard]==0.22.0
watchgod==0.8.2
plotly==4.0
pandas==1.3; python_version < '3.10'
pandas==1.4; python_version >= '3.10'
pandas==1.5; python_version >= '3.10'
sqlalchemy==1.4
strawberry-graphql==0.192.0
networkx==2.5
Expand Down
14 changes: 14 additions & 0 deletions package/kedro_viz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
"""Kedro plugin for visualising a Kedro pipeline"""
import sys
import warnings

__version__ = "6.4.0"


class KedroVizPythonVersionWarning(UserWarning):
"""Custom class for warnings about incompatibilities with Python versions."""


if sys.version_info >= (3, 12):
warnings.warn(
"""Please be advised that Kedro Viz is not yet fully
compatible with the Python version you are currently using.""",
KedroVizPythonVersionWarning,
)
2 changes: 1 addition & 1 deletion package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
long_description_content_type="text/markdown",
license="Apache Software License (Apache 2.0)",
url="https://github.com/kedro-org/kedro-viz",
python_requires=">=3.7, <3.12",
python_requires=">=3.7",
install_requires=requires,
keywords="pipelines, machine learning, data pipelines, data science, data engineering, visualisation",
author="Kedro",
Expand Down
19 changes: 19 additions & 0 deletions package/tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest

import kedro_viz


def test_import_kedro_viz_with_no_official_support_emits_warning(mocker):
"""Test importing kedro Viz with python>=3.12 and controlled warnings should work"""
mocker.patch("kedro_viz.sys.version_info", (3, 12))

# We use the parent class to avoid issues with `exec_module`
with pytest.warns(UserWarning) as record:
kedro_viz.__loader__.exec_module(kedro_viz)

assert len(record) == 1
assert (
"""Please be advised that Kedro Viz is not yet fully
compatible with the Python version you are currently using."""
in record[0].message.args[0]
)

0 comments on commit 02a5073

Please sign in to comment.