You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "agriyakhetarpal (via GitHub)" <gi...@apache.org> on 2024/12/18 22:30:02 UTC

[PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

agriyakhetarpal opened a new pull request, #45072:
URL: https://github.com/apache/arrow/pull/45072

   <!--
   Thanks for opening a pull request!
   If this is your first pull request you can find detailed information on how 
   to contribute here:
     * [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
     * [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
   
   
   If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
   
   Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
   
   Then could you also rename the pull request title in the following format?
   
       GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   or
   
       MINOR: [${COMPONENT}] ${SUMMARY}
   
   -->
   
   ### Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   This change would allow building PyArrow correctly with NumPy 1.X and NumPy 2.X, since we are trying to do the latter for pyodide/pyodide#4925. This PR closes gh-45071.
   
   ### What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   This PR
   - issues a correction for the NumPy header files when building under Emscripten
   - updates Pyodide-related build instructions
   
   ### Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   Yes, working here: https://github.com/agriyakhetarpal/pyodide-numpy-2.0-rebuilds/actions/runs/12399351376/job/34619554658#step:8:4547 via https://github.com/agriyakhetarpal/pyodide/commit/b651698ab31b9fe277437543dd483eb19aaa2462 that applies a subset of the changes as a patch (the CI job is failing for unrelated reasons, please ignore).
   
   ### Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   Yes, users trying to build a WASM wheel via Pyodide are now requested to use newer Pyodide and Emscripten versions, and the latest stable version of `pyodide-build` available.
   
   <!--
   If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
   -->
   <!-- **This PR includes breaking changes to public APIs.** -->
   
   <!--
   Please uncomment the line below (and provide explanation) if the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld). We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
   -->
   <!-- **This PR contains a "Critical Fix".** -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2552631169

   Revision: bb6ff292ee3916c991729a0b9b89636c156fd3ca
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-a9ba1a0870](https://github.com/ursacomputing/crossbow/branches/all?query=actions-a9ba1a0870)
   
   |Task|Status|
   |----|------|
   |example-python-minimal-build-fedora-conda|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-example-python-minimal-build-fedora-conda)](https://github.com/ursacomputing/crossbow/actions/runs/12404940643/job/34630939866)|
   |example-python-minimal-build-ubuntu-venv|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-example-python-minimal-build-ubuntu-venv)](https://github.com/ursacomputing/crossbow/actions/runs/12404940968/job/34630940923)|
   |test-conda-python-3.10|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.10)](https://github.com/ursacomputing/crossbow/actions/runs/12404941362/job/34630942496)|
   |test-conda-python-3.10-cython2|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.10-cython2)](https://github.com/ursacomputing/crossbow/actions/runs/12404941210/job/34630942262)|
   |test-conda-python-3.10-hdfs-2.9.2|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.10-hdfs-2.9.2)](https://github.com/ursacomputing/crossbow/actions/runs/12404941026/job/34630940919)|
   |test-conda-python-3.10-hdfs-3.2.1|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.10-hdfs-3.2.1)](https://github.com/ursacomputing/crossbow/actions/runs/12404941192/job/34630941840)|
   |test-conda-python-3.10-pandas-latest-numpy-latest|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.10-pandas-latest-numpy-latest)](https://github.com/ursacomputing/crossbow/actions/runs/12404941214/job/34630942263)|
   |test-conda-python-3.10-substrait|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.10-substrait)](https://github.com/ursacomputing/crossbow/actions/runs/12404941184/job/34630941888)|
   |test-conda-python-3.11|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11)](https://github.com/ursacomputing/crossbow/actions/runs/12404940654/job/34630939862)|
   |test-conda-python-3.11-dask-latest|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-dask-latest)](https://github.com/ursacomputing/crossbow/actions/runs/12404941098/job/34630941397)|
   |test-conda-python-3.11-dask-upstream_devel|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-dask-upstream_devel)](https://github.com/ursacomputing/crossbow/actions/runs/12404940950/job/34630940908)|
   |test-conda-python-3.11-hypothesis|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-hypothesis)](https://github.com/ursacomputing/crossbow/actions/runs/12404941120/job/34630941621)|
   |test-conda-python-3.11-pandas-latest-numpy-1.26|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-pandas-latest-numpy-1.26)](https://github.com/ursacomputing/crossbow/actions/runs/12404940644/job/34630939837)|
   |test-conda-python-3.11-pandas-latest-numpy-latest|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-pandas-latest-numpy-latest)](https://github.com/ursacomputing/crossbow/actions/runs/12404940638/job/34630940123)|
   |test-conda-python-3.11-pandas-nightly-numpy-nightly|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-pandas-nightly-numpy-nightly)](https://github.com/ursacomputing/crossbow/actions/runs/12404940874/job/34630940778)|
   |test-conda-python-3.11-pandas-upstream_devel-numpy-nightly|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-pandas-upstream_devel-numpy-nightly)](https://github.com/ursacomputing/crossbow/actions/runs/12404940922/job/34630940770)|
   |test-conda-python-3.11-spark-master|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.11-spark-master)](https://github.com/ursacomputing/crossbow/actions/runs/12404940859/job/34630940789)|
   |test-conda-python-3.12|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.12)](https://github.com/ursacomputing/crossbow/actions/runs/12404941129/job/34630941377)|
   |test-conda-python-3.12-cpython-debug|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.12-cpython-debug)](https://github.com/ursacomputing/crossbow/actions/runs/12404940881/job/34630940780)|
   |test-conda-python-3.13|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.13)](https://github.com/ursacomputing/crossbow/actions/runs/12404940694/job/34630940032)|
   |test-conda-python-3.9|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.9)](https://github.com/ursacomputing/crossbow/actions/runs/12404940637/job/34630940005)|
   |test-conda-python-3.9-pandas-1.1.3-numpy-1.19.5|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-3.9-pandas-1.1.3-numpy-1.19.5)](https://github.com/ursacomputing/crossbow/actions/runs/12404941248/job/34630942388)|
   |test-conda-python-emscripten|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-conda-python-emscripten)](https://github.com/ursacomputing/crossbow/actions/runs/12404941113/job/34630941398)|
   |test-cuda-python-ubuntu-22.04-cuda-11.7.1|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-cuda-python-ubuntu-22.04-cuda-11.7.1)](https://github.com/ursacomputing/crossbow/actions/runs/12404941313/job/34630942473)|
   |test-debian-12-python-3-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-debian-12-python-3-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/12404941185/job/34630941863)|
   |test-debian-12-python-3-i386|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-debian-12-python-3-i386)](https://github.com/ursacomputing/crossbow/actions/runs/12404940682/job/34630939853)|
   |test-fedora-39-python-3|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-fedora-39-python-3)](https://github.com/ursacomputing/crossbow/actions/runs/12404941190/job/34630942272)|
   |test-ubuntu-22.04-python-3|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-ubuntu-22.04-python-3)](https://github.com/ursacomputing/crossbow/actions/runs/12404941047/job/34630941059)|
   |test-ubuntu-22.04-python-313-freethreading|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-ubuntu-22.04-python-313-freethreading)](https://github.com/ursacomputing/crossbow/actions/runs/12404941213/job/34630942267)|
   |test-ubuntu-24.04-python-3|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a9ba1a0870-github-test-ubuntu-24.04-python-3)](https://github.com/ursacomputing/crossbow/actions/runs/12404940979/job/34630940955)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "agriyakhetarpal (via GitHub)" <gi...@apache.org>.
agriyakhetarpal commented on code in PR #45072:
URL: https://github.com/apache/arrow/pull/45072#discussion_r1890957382


##########
python/CMakeLists.txt:
##########
@@ -166,8 +166,17 @@ if($ENV{PYODIDE})
   # modules (at least under Pyodide it does).
   set(Python3_INCLUDE_DIR $ENV{PYTHONINCLUDE})
   set(Python3_LIBRARY $ENV{CPYTHONLIB})
-  set(Python3_NumPy_INCLUDE_DIR $ENV{NUMPY_LIB}/core/include)
   set(Python3_EXECUTABLE)
+  execute_process(COMMAND ${Python3_EXECUTABLE} -c
+                          "import numpy; print(numpy.__version__)"
+                  OUTPUT_VARIABLE PYODIDE_NUMPY_VERSION
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REGEX MATCH "^([0-9]+)" PYODIDE_NUMPY_MAJOR_VERSION ${PYODIDE_NUMPY_VERSION})
+  if(NUMPY_MAJOR_VERSION GREATER_EQUAL 2)

Review Comment:
   ```suggestion
     if(PYODIDE_NUMPY_MAJOR_VERSION GREATER_EQUAL 2)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "agriyakhetarpal (via GitHub)" <gi...@apache.org>.
agriyakhetarpal commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2553428290

   Glad that it passed :D
   
   I would recommend switching to using the Pyodide virtual environment `pyodide venv` for running the test suite, by the way – while `python/scripts/run_emscripten_tests.py` tests on Chrome and Firefox as well, the Node.js tests in it could be swapped out for it, and we found to be more reliable in projects such as SymPy.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "agriyakhetarpal (via GitHub)" <gi...@apache.org>.
agriyakhetarpal commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2552937058

   Thanks for triggering CI! Looks like the failure is unrelated, it's just a timeout.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #45072:
URL: https://github.com/apache/arrow/pull/45072


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "agriyakhetarpal (via GitHub)" <gi...@apache.org>.
agriyakhetarpal commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2556558907

   I have no idea either, though FWIW, timeouts and flakes with `selenium` in our own test suite are pretty common.
   
   I'll open a new issue about it, sure!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2552392709

   :warning: GitHub issue #45071 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2585292866

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 7bec4fa3dd770e4d5f66e66d5f58da0314dbbf69.
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/35472156375) has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2553098918

   > Thanks for triggering CI! Looks like the failure is unrelated, it's just a timeout.
   
   Yes, it seems a timeout issue but it's pretty consistent, I just triggered it a 4th time, and it has never failed on our nightly CI. The other CI failures are unrelated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45071: [Packaging][Docs] Fix NumPy v2 include directory for Emscripten, and update Pyodide-related documentation [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #45072:
URL: https://github.com/apache/arrow/pull/45072#issuecomment-2552628897

   @github-actions crossbow submit -g python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org