Fix setup.py to install cython, instead of giving the user an error.
https://github.com/pypa/pip/issues/5761#issuecomment-418395650
https://www.python.org/dev/peps/pep-0518/
On a fresh vitrual enviroment:
pip install cartopy
(mypython) me@my_laptop:~/path/tmp$ python
Python 3.5.3+ (default, Nov 29 2017, 08:55:08)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
(mypython) me@my_laptop:~/path/tmp$ pip install cartopy
Collecting cartopy
Using cached https://files.pythonhosted.org/packages/f5/7a/4a16db7c81f11b3c5889c5b913d9a5724c704a6947c5a87ec59c4a8985ac/Cartopy-0.16.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "/tmp/pip-install-7r1fl7u1/cartopy/setup.py", line 47, in <module>
from Cython.Distutils import build_ext
ImportError: No module named 'Cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-7r1fl7u1/cartopy/setup.py", line 49, in <module>
raise ImportError('Cython 0.15.1+ is required to install cartopy.')
ImportError: Cython 0.15.1+ is required to install cartopy.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-7r1fl7u1/cartopy/
Ubuntu 16.04
Technically, that's not adding PEP 518 support, just fixing the existing workaround so it works with setuptools>=36.7.0.
For PEP 518 support, a new pyproject.toml file should be added:
[build-system]
requires = ["Cython>=0.15.1", "numpy>=1.10", "setuptools", "wheel"]
Great that this is finally solved! 馃槃
It's great that this is finally solved.
But unfortunately it has also been un-solved later :stuck_out_tongue:
Refer to: https://github.com/SciTools/cartopy/pull/1264/commits/454a9118f711d111b36026b126724cdb8dd705e7
From the commit it seems this was because it results in some version mismatch in numpy coming from build dependencies vs numpy comping from actual dependency (although I am not completely sure what the exact reason is).
I am not sure how cartopy's build works, and what solutions are there to prevent this, but can this possibly be solved with a slightly modern build tool like poetry/dephell? I know that is sort of significant change to the project, but if that sounds like a good idea maybe I can try and take a dig at this. Would love to know maintainers thoughts on this (maybe from @dopplershift, @pelson or @QuLogic probably?).
Should this issue be ideally re-opened at least?
Most helpful comment
Technically, that's not adding PEP 518 support, just fixing the existing workaround so it works with
setuptools>=36.7.0.For PEP 518 support, a new
pyproject.tomlfile should be added: