bwoodsend / vtkplotlib

VTK (C++ 3D graphics library) wrapped into an easy to use 3D equivalent of matplotlib
MIT License
40 stars 6 forks source link

Error with Sys module when trying to make pipenv with extended test dependencies #7

Closed draked2 closed 3 years ago

draked2 commented 3 years ago

Steps to reproduce:

Result: ModuleNotFoundError: No module named 'sys.version_info'; 'sys' is not a package

Excuse me, I'm new to setup.py and I might be missing something here. Any suggestions on what extra I could do to easily make a pipenv environment capable of running the unit tests in this repo?

bwoodsend commented 3 years ago

Firstly, there is no extra called test on this repo:

https://github.com/bwoodsend/vtkplotlib/blob/c1f305d62acccd0f2bfccb406ec13d2efb1920ed/setup.py#L49-L54

There is a test_minimal which currently just adds pytest, and a test_full which includes all the optional stuff so it should be either of those inside the square brakets.


I'm not a pipenv user (prefer plain old venv) so I don't know if this is correct usage but this appeared to work for me:

pipenv install
pipenv shell
pip install -e .[test_minimal]

Then you should be able to launch the test suite via pytest:

pytest

Just running it now I see a couple of breakages have trickled in so don't be surprised if these fail:

FAILED tests/test_imageio.py::test_read[JPEG-True] - assert False
FAILED tests/test_imageio.py::test_read[JPEG-False] - assert False
FAILED tests/test_misc.py::test_data - AssertionError
draked2 commented 3 years ago

Thanks for the details. Your recommendations do result in a pipenv virtual environment with the required dependencies.

However it's a bit of a work-around. When you install dependencies from within the pipenv shell, they aren't tracked in the pipfile. I did a bit of digging and it looks like there is an open issue with pipenv when installing from setup.py if the setup.py needs to be evaluated first (https://github.com/pypa/pipenv/issues/4309).

This is out of scope of vtkplotlib so I'll close this issue for now