[
https://issues.apache.org/jira/browse/ARROW-5210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825170#comment-16825170
]
Joris Van den Bossche commented on ARROW-5210:
----------------------------------------------
The reason it is currently failing is because we don't list numpy as a build
requirement (not in {{setup_requires}} and not in {{pyproject.toml}}).
This also seems to indicate the that current {{pyproject.toml}} is actually not
tested (because building a wheel using an isolated environment based on the
build dependencies specified in the file, should fail with missing numpy).
Patch by [~pitrou] :
{code:none}
diff --git a/python/pyproject.toml b/python/pyproject.toml
index 712647e4f..a6c51ec20 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -16,4 +16,4 @@
# under the License.
[build-system]
-requires = ["setuptools", "wheel", "setuptools_scm", "cython >= 0.29"]
+requires = ["setuptools", "wheel", "setuptools_scm", "cython >= 0.29", "numpy
>= 1.14"]
diff --git a/python/setup.py b/python/setup.py
index 907524a60..63014a80a 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -542,19 +542,20 @@ class BinaryDistribution(Distribution):
return True
+numpy_requires = 'numpy >= 1.14'
+
install_requires = (
- 'numpy >= 1.14',
+ numpy_requires,
'six >= 1.0.0',
'futures; python_version < "3.2"',
'enum34 >= 1.1.6; python_version < "3.4"',
)
+setup_requires = ['setuptools_scm', 'cython >= 0.29', numpy_requires]
# Only include pytest-runner in setup_requires if we're invoking tests
if {'pytest', 'test', 'ptr'}.intersection(sys.argv):
- setup_requires = ['pytest-runner']
-else:
- setup_requires = []
+ setup_requires.append('pytest-runner')
setup(
@@ -581,7 +582,7 @@ setup(
'write_to': os.path.join(scm_version_write_to_prefix,
'pyarrow/_generated_version.py')
},
- setup_requires=['setuptools_scm', 'cython >= 0.29'] + setup_requires,
+ setup_requires=setup_requires,
install_requires=install_requires,
tests_require=['pytest', 'pandas', 'hypothesis',
'pathlib2; python_version < "3.4"'],{code}
with that patch, one still needs {{pip install -e . --no-use-pep517}} (for the
latest pip 19.1 release) to specify to pip that we _do_ want to do an editable
install.
But I would actually argue that even if the above is fixed, doing {{pip install
-e . --no-use-pep517 --no-build-isolation}} is better, as when doing an
editable install, you don't need to the build isolation feature of numpy, you
just want to build pyarrow against your existing development environment.
> [Python] editable install (pip install -e .) is failing
> --------------------------------------------------------
>
> Key: ARROW-5210
> URL: https://issues.apache.org/jira/browse/ARROW-5210
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Reporter: Joris Van den Bossche
> Priority: Minor
>
> Following the python development documentation on building arrow and pyarrow
> ([https://arrow.apache.org/docs/developers/python.html#build-and-test),]
> building pyarrow inplace with {{python setup.py build_ext --inplace}} works
> fine.
>
> But if you want to also install this inplace version in the current python
> environment (editable install / development install) using pip ({{pip install
> -e .}}), this fails during the {{built_ext}} / cmake phase:
> {code:none}
>
> -- Looking for python3.7m
> -- Found Python lib
> /home/joris/miniconda3/envs/arrow-dev/lib/libpython3.7m.so
> CMake Error at cmake_modules/FindNumPy.cmake:62 (message):
> NumPy import failure:
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> ModuleNotFoundError: No module named 'numpy'
> Call Stack (most recent call first):
> CMakeLists.txt:186 (find_package)
> -- Configuring incomplete, errors occurred!
> See also
> "/home/joris/scipy/repos/arrow/python/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeOutput.log".
> See also
> "/home/joris/scipy/repos/arrow/python/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeError.log".
> error: command 'cmake' failed with exit status 1
> Cleaning up...
> {code}
>
> Alternatively, doing {{python setup.py develop}} to achieve the same still
> works.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)