Skip to content

Conversation

vphilippon
Copy link
Contributor

@vphilippon vphilippon commented Feb 28, 2020

fixes #2158
Doing pip install gdal[numpy] will install gdal with numpy > 1.0.0.
pip will ensure that numpy is installed first so that it's detected
and the releveant features/bindings/etc. are compiled and made available
for users.

FYI I did not touch how numpy was installed in the various CI scripts, being a bit afraid of breaking things and/or making a mess.

Doing `pip install gdal[numpy]` will install `gdal` with `numpy > 1.0.0`.
`pip` will ensure that `numpy` is installed first so that it's detected
and the releveant features/bindings/etc. are compiled and made available
for users.
@@ -463,7 +463,8 @@ def parallel_build_extensions(self):
data_files=data_files,
ext_modules=ext_modules,
scripts=glob('scripts/*.py'),
cmdclass={'build_ext': gdal_ext}
cmdclass={'build_ext': gdal_ext},
extras_require={'numpy': ['numpy > 1.0.0']},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't that be conditionalized by if HAVE_NUMPY: ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's the opposite: using pip install gdal[numpy] will install numpy, so that HAVE_NUMPY will be true when building/installing gdal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python bindings to gdal should make use of extras feature for packaging.
2 participants