Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirements: pyvista >= 0.38.1 needed #2500

Closed
beppo-dd opened this issue Nov 10, 2023 · 3 comments
Closed

Requirements: pyvista >= 0.38.1 needed #2500

beppo-dd opened this issue Nov 10, 2023 · 3 comments

Comments

@beppo-dd
Copy link
Contributor

beppo-dd commented Nov 10, 2023

Problem

Actual, in the project meta data pyproject.toml under dependencies there is the requirement

pyvista>=0.33.0

see, pyproject.toml, line 38. But, this old version 0.33.0 lacks the function pyvista.plotting.colors.get_cycler which ansys.mapdl.core.theme, line 16 wants to import. This functions was just introduced in pyvista 0.38.1 with pull #3739, see definition of get_cycler in the corresponding diff.

Solution

The dependency of pyvista must be bumped to

pyvista>=0.38.1

see Pull Request 2501.

Question: @akaszynski I am not sure, if the pyvista requirement .ci/requirements_test_xvfb.txt, line 1 needs also a change, can you please answer this question?

Steps to reproduce the problem

  • System: Windows 10 22H2
  • Shell: PowerShell 5.1.19041.3570
  • Python version: 3.11.5
  • Before installed pyvista version: 0.37.0 (>=0.33.0):
>>> import pyvista
>>> pyvista.__version__
'0.37.0'
  • requirements.txt:
ansys-mapdl-core >= 0.65

Steps:

  1. requirements.txt installed by using the Python Launcher py and specifying the Python version 3.11:
py -V:3.11 -m pip install --user -r requirements.txt
  1. Now, I have this package versions (py -V:3.11 -m pip list --user):
Package                               Version    Editable project location
------------------------------------- ---------- ---------------------------------------------------------
[...]
ansys-mapdl-core                      0.67.0
[...]
pyvista                               0.37.0
[...]
  1. Run the following python import in Python 3.11 (py -V:3.11):
>>> from ansys.mapdl.core import launch_mapdl
CRITICAL - pymapdl_global -  logging - handle_exception - Uncaught exception
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~\AppData\Roaming\Python\Python311\site-packages\ansys\mapdl\core\__init__.py", line 87, in <module>
    from ansys.mapdl.core.launcher import close_all_local_instances
  File "~\AppData\Roaming\Python\Python311\site-packages\ansys\mapdl\core\launcher.py", line 35, in <module>
    from ansys.mapdl.core.mapdl_grpc import MAX_MESSAGE_LENGTH, MapdlGrpc
  File "~\AppData\Roaming\Python\Python311\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 58, in <module>
    from ansys.mapdl.core.mapdl import _MapdlCore
  File "~\AppData\Roaming\Python\Python311\site-packages\ansys\mapdl\core\mapdl.py", line 59, in <module>
    from ansys.mapdl.core.theme import get_ansys_colors
  File "~\AppData\Roaming\Python\Python311\site-packages\ansys\mapdl\core\theme.py", line 8, in <module>
    from pyvista.plotting.colors import get_cycler
ImportError: cannot import name 'get_cycler' from 'pyvista.plotting.colors' (~\AppData\Roaming\Python\Python311\site-packages\pyvista\plotting\colors.py)

Steps to simulate the solution of the problem

  1. Upgrade to pyvista 0.38.1
PS C:\[...]> py -V:3.11 -m pip install --user pyvista==0.38.1
Collecting pyvista==0.38.1
  Using cached pyvista-0.38.1-py3-none-any.whl (1.6 MB)
Requirement already satisfied: [...]
Installing collected packages: pyvista
  Attempting uninstall: pyvista
    Found existing installation: pyvista 0.37.0
    Uninstalling pyvista-0.37.0:
      Successfully uninstalled pyvista-0.37.0
Successfully installed pyvista-0.38.1
  1. Run the same python import in Python 3.11 (py -V:3.11):
>>> from ansys.mapdl.core import launch_mapdl
>>>

Now, there is no ImportError exception during the import anymore.

@akaszynski
Copy link
Collaborator

Agreed regarding the minimum requirement. We're still using requirements_test_xvfb.txt in three locations in GitHub workflows.

@beppo-dd
Copy link
Contributor Author

beppo-dd commented Nov 12, 2023

@akaszynski Thanks for your answer. I bumped the minimum requirement pyvista>=0.38.1 also in .ci/requirements_test_xvfb.txt, see the last commit 891f494 in my Pull Request 2501.

@germa89
Copy link
Collaborator

germa89 commented Nov 27, 2023

Closed in #2535

@germa89 germa89 closed this as completed Nov 27, 2023
germa89 added a commit that referenced this issue Nov 29, 2023
Before in the project meta data pyproject.toml under dependencies there is
the requirement `pyvista>=0.33.0`, see pyproject.toml, line 38.
But, this old version 0.33.0 lacks the function pyvista.plotting.colors.get_cycler
which ansys.mapdl.core.theme, line 16 wants to import. This functions was
just introduced in pyvista 0.38.1 with pull #3739, see definition of
get_cycler in the corresponding diff.

Bump pyvista >= 0.38.1 also for .ci\requirements_test_xvfb.txt
As this is still used in three locations in GitHub workflows.

Co-authored-by: German <28149841+germa89@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants