e2nIEE / pandapower

Convenient Power System Modelling and Analysis based on PYPOWER and pandas
https://www.pandapower.org
Other
848 stars 478 forks source link

[bug] Missing dependency pytest #1988

Closed BDonnot closed 1 year ago

BDonnot commented 1 year ago

Issue Report Checklist

Problem Description

Related (but not the same) to #1985 I also found out a missing dependency for pandapower version 2.12 (still the CI of some of my projects). This time it's not related to a python version, but the "pytest" package is missing (in the setup.py / setup.cfg) and prevents the use of pandapower when it's not installed.

This problem did not appear with previous version of pandapower.

What steps reproduce the problem?

Run the following script:

python3 -m virtualenv venv_test_pp
source venv_test_pp/bin/activate
pip install --upgrade pandapower
python -c "import pandapower as pp"

What is the expected output? What do you see instead?

This results in the error:

matplotlib could not be imported. It is required for many plotting functions. 
Thus, this might lead to errors with some plotting functions. To install all pandapower dependencies, pip install pandapower['all'] can be used.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "venv_test_pp/lib/python3.8/site-packages/pandapower/__init__.py", line 35, in <module>
    import pandapower.test
  File "venv_test_pp/lib/python3.8/site-packages/pandapower/test/__init__.py", line 7, in <module>
    from pandapower.test.conftest import *
  File "venv_test_pp/lib/python3.8/site-packages/pandapower/test/conftest.py", line 8, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'

Paste Traceback/Error Below (if applicable)


Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "venv_test_pp/lib/python3.8/site-packages/pandapower/__init__.py", line 35, in <module>
    import pandapower.test
  File "venv_test_pp/lib/python3.8/site-packages/pandapower/test/__init__.py", line 7, in <module>
    from pandapower.test.conftest import *
  File "venv_test_pp/lib/python3.8/site-packages/pandapower/test/conftest.py", line 8, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'

Versions

It does not depends on any of these packages, the bug is a missing package in setup.py / setup.cfg or when importing pandapower (in __init__.py line 35) :

try:
    import pandapower.test
except ImportError:
    # pytest is not installed, the "test" module will not be available
    pass

Labels (if access available)

BDonnot commented 1 year ago

closing due to duplicate : #1983

(I did a wrong search when looking for similar issues)