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

Add numba and psutil to pip setup file #83

Merged

Conversation

hakonanes
Copy link
Member

Signed-off-by: Håkon Wiik Ånes hwaanes@gmail.com

Release Notes

developer change
Summary: Add numba and psutil to pip setup file

What does this PR do? Please describe and/or link to an open issue.
When Travis builds KikuchiPy with pip our tests fail immediately because:

ImportError while loading conftest '/home/travis/build/kikuchipy/kikuchipy/kikuchipy/conftest.py'.
kikuchipy/__init__.py:20: in <module>
    from kikuchipy import signals
kikuchipy/signals/__init__.py:19: in <module>
    from kikuchipy.signals.ebsd import EBSD, LazyEBSD
kikuchipy/signals/ebsd.py:36: in <module>
    from pyxem.signals.diffraction2d import Diffraction2D
../../../testenv/lib/python3.7/site-packages/pyxem/__init__.py:33: in <module>
    from diffsims.generators.diffraction_generator import DiffractionGenerator
../../../testenv/lib/python3.7/site-packages/diffsims/__init__.py:33: in <module>
    from .utils.atomic_diffraction_generator_support.discretise_utils import get_discretisation
../../../testenv/lib/python3.7/site-packages/diffsims/utils/atomic_diffraction_generator_support/discretise_utils.py:26: in <module>
    from psutil import virtual_memory
E   ModuleNotFoundError: No module named 'psutil'
The command "python -m pytest --cov=kikuchipy --pyargs kikuchipy" exited with 4.

Running these steps locally also raised errors that numba and psutil weren't installed:

git clone https://github.com/pyxem/diffsims.git
cd diffsims
pip install -e .
pip install pytest
pytest --pyargs diffsims
ImportError while loading conftest '/home/hakon/kode/diffsims/diffsims/tests/conftest.py'.
diffsims/__init__.py:25: in <module>
    from .generators.diffraction_generator import DiffractionGenerator, AtomicDiffractionGenerator
diffsims/generators/diffraction_generator.py:34: in <module>
    from diffsims.utils.atomic_diffraction_generator_support.fourier_transform import from_recip
diffsims/utils/atomic_diffraction_generator_support/fourier_transform.py:29: in <module>
    import numba
E   ModuleNotFoundError: No module named 'numba'

Tests run fine after numba and psutil are installed. I therefore added these to setup.py.

Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@dnjohnstone dnjohnstone added the bug Something isn't working label Feb 29, 2020
@dnjohnstone dnjohnstone added this to the v0.2.3 milestone Feb 29, 2020
@dnjohnstone dnjohnstone merged commit a330ab8 into pyxem:master Feb 29, 2020
@dnjohnstone
Copy link
Member

Thanks @hakonanes and sorry for that - we're all a bit too conda based over here perhaps...

We'll put this in a v0.2.3 release this week because this will be very annoying for you!

@pc494 - do you think we should look at making our travis install with both conda and pip? I guess it might double testing time on travis, but maybe worth it?

@hakonanes hakonanes deleted the update-dependencies-in-pip-setup branch February 29, 2020 15:26
@hakonanes
Copy link
Member Author

No problem! I'm fine with the pip builds failing for now because of this, as long as I know that our conda builds pass and why. So don't rush it, at least not just for KikuchiPy.

@pc494
Copy link
Member

pc494 commented Mar 2, 2020

I think this might have been a (probably misguided) feature rather than a bug. I think we anticipated some "basic" installs wanting to avoid numba and psutils, probably because we had some issues with cython installation in the past.

That now seem misguided so this is a significant improvement, and will put it in the patch release. In terms of testing pip/conda (@dnjohnstone) I think the compromise I've struck in orix will probably work here too (have conda do environment management and test installation then have pip install . install the package)

@pc494 pc494 mentioned this pull request Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants