Description
Hello,
When trying to build a wheel for rake-nltk package it fails if system does not have nltk package installed explicitly.
- create empty virtual environment & switch to it
- issue pip wheel command:
pip wheel rake-nltk
...
File "/tmp/pip-wheel-u4cxytr5/rake-nltk/setup.py", line 17, in _post_install
import nltk
ModuleNotFoundError: No module named 'nltk'
----------------------------------------
Failed building wheel for rake-nltk
Running setup.py clean for rake-nltk
Failed to build rake-nltk
ERROR: Failed to build one or more wheels
Apparently during bdist
or bdist_wheel
commands distutils also does an "fake" install -- and apparently without installing requirements before.
From docs: https://docs.python.org/3/distutils/builtdist.html
then the Distutils builds my module distribution (the Distutils itself in this case), does a “fake” installation
I am not familiar with distutils enough to know if it is possible to distinguish such "fake" install from real install.
Our use case is to build wheels during packaging progress on build server and then later use these wheels to speed up deployment. There is no reason to install python packages on build server itself and in some cases it would be hard to identify requirements before -- for an example if some other package has rake-nltk as install_requirement in setup.py.
This problem would not exists if rake-nltk would be available as wheel on pypi (but then package installation would not automatically download "punkt" and "stopwords").