Skip to content

Commit

Permalink
pyvista vulnerability fixed in version 0.39.0 (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
raph-luc authored May 12, 2023
1 parent 79631e6 commit 85f1700
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false

steps:
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8

- name: Add version information
run: make version-info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-test-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false

steps:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ the project support team, email `[email protected] <[email protected]>

Installation
------------
The ``ansys-fluent-visualization`` package supports Python 3.7 through Python
3.10 on Windows and Linux.
The ``ansys-fluent-visualization`` package supports Python 3.8 through Python
3.11 on Windows and Linux.

If you are using Python 3.10, download and install the wheel file for the ``vtk`` package from
`here for Windows <https://github.com/pyvista/pyvista-wheels/raw/main/vtk-9.1.0.dev0-cp310-cp310-win_amd64.whl>`_
Expand Down
4 changes: 2 additions & 2 deletions doc/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ page on the Ansys website.
***************
Install package
***************
The ``ansys-fluent-visualization`` package supports Python 3.7 through
Python 3.10 on Windows and Linux.
The ``ansys-fluent-visualization`` package supports Python 3.8 through
Python 3.11 on Windows and Linux.

Install the latest release from `PyPi
<https://pypi.org/project/ansys-fluent-visualization/>`_ with:
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
python = ">=3.8,<4.0"
importlib-metadata = {version = "^4.0", python = "<3.8"}
ansys-fluent-core = "~=0.14.dev0"
vtk = {version = ">=9.0.3", python = "<=3.9"}
pyvista = ">=0.33.2"
vtk = ">=9.2.6"
pyvista = ">=0.39.0"
pyvistaqt = ">=0.7.0"
pyside6 = ">=6.2.3"
matplotlib = ">=3.5.1"
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ sphinx-gallery==0.11.1
sphinx-notfound-page==0.8.3
sphinxcontrib-websupport==1.2.4
sphinxemoji==0.2.0
pyvista>=0.33.2
pyvista>=0.39.0
matplotlib>=3.5.1
30 changes: 2 additions & 28 deletions src/ansys/fluent/visualization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,14 @@ def version_info() -> str:


required_libraries = {
"vtk": "9.1.0",
"pyvista": "0.33.2",
"vtk": "9.2.6",
"pyvista": "0.39.0",
"pyvistaqt": "0.7.0",
"pyside6": "6.2.3",
"matplotlib": "3.5.1",
}


def _get_vtk_install_cmd(reinstall=False):
is64 = struct.calcsize("P") * 8 == 64
if sys.version_info.minor == 10 and is64:
if platform.system().lower() == "linux":
return f" Please {'reinstall' if reinstall else 'install'} vtk with `pip install {'-I' if reinstall else ''} https://github.com/pyvista/pyvista-wheels/raw/main/vtk-9.1.0.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl`" # noqa: E501

elif platform.system().lower() == "windows":
return f" Please {'reinstall' if reinstall else 'install'} vtk with `pip install {'-I' if reinstall else ''} https://github.com/pyvista/pyvista-wheels/raw/main/vtk-9.1.0.dev0-cp310-cp310-win_amd64.whl`" # noqa: E501
else:
return (
f" Please {'reinstall' if reinstall else 'install'} "
f"vtk with `pip install vtk=={required_libraries[lib]}`."
)


def _update_vtk_version():
is64 = struct.calcsize("P") * 8 == 64
if sys.version_info.minor in (9, 10) and is64:
required_libraries.update({"vtk": "9.1.0.dev0"})


_update_vtk_version()
installed = {pkg.key for pkg in pkg_resources.working_set}
installed_libraries = [
lib for lib, version in required_libraries.items() if lib in installed
Expand All @@ -73,8 +51,6 @@ def _update_vtk_version():
(
f" Please install {lib} with "
f"`pip install {lib}=={required_libraries[lib]}`."
if lib != "vtk"
else _get_vtk_install_cmd()
)
)
if installed_libraries:
Expand All @@ -97,8 +73,6 @@ def _update_vtk_version():
(
f" Please re-install {lib} with "
f"`pip install -I {lib}=={required_libraries[lib]}`."
if lib != "vtk"
else _get_vtk_install_cmd(True)
)
)

Expand Down

0 comments on commit 85f1700

Please sign in to comment.