Skip to content

Commit e7e3d58

Browse files
authored
Merge branch 'main' into DOC/21351/np.char
2 parents 2db329d + 8420a7e commit e7e3d58

File tree

632 files changed

+21844
-10586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

632 files changed

+21844
-10586
lines changed

.circleci/config.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,10 @@ jobs:
9595
# destination: neps
9696

9797
- run:
98-
name: run doctests on documentation
98+
name: run refguide-check
9999
command: |
100100
. venv/bin/activate
101-
# Note: keep these two checks separate, because they seem to
102-
# influence each other through changing global state (e.g., via
103-
# `np.polynomial.set_default_printstyle`)
104-
python tools/refguide_check.py --rst
105-
python tools/refguide_check.py --doctests
101+
python tools/refguide_check.py -v
106102
107103
- persist_to_workspace:
108104
root: ~/repo

.github/ISSUE_TEMPLATE/typing.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Static Typing
2+
description: Report an issue with the NumPy typing hints.
3+
title: "TYP: <Please write a comprehensive title after the 'TYP: ' prefix>"
4+
labels: [Static typing]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >
10+
Thank you for taking the time to report this issue.
11+
Please make sure that this issue hasn't already been reported before.
12+
13+
- type: textarea
14+
attributes:
15+
label: "Describe the issue:"
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: "Reproduce the code example:"
22+
description: >
23+
A short code example that reproduces the error in your type-checker. It
24+
should be self-contained, i.e., can be run as-is via e.g.
25+
`mypy myproblem.py` or `pyright myproblem.py`.
26+
placeholder: |
27+
import numpy as np
28+
import numpy.typing as npt
29+
<< your code here >>
30+
render: python
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
attributes:
36+
label: "Error message:"
37+
description: >
38+
Please include all relevant error messages from your type-checker or IDE.
39+
render: shell
40+
41+
- type: textarea
42+
attributes:
43+
label: "Python and NumPy Versions:"
44+
description: >
45+
Output from `import sys, numpy; print(numpy.__version__); print(sys.version)`.
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
attributes:
51+
label: "Type-checker version and settings:"
52+
description: >
53+
Please include the exact version of the type-checker you are using.
54+
Popular (static) type checkers include Mypy, Pyright / Pylance, Pytype,
55+
Pyre, PyCharm, etc.
56+
Also include the full CLI command used to run the type-checker, and
57+
all of the relevant configuration options.
58+
validations:
59+
required: true
60+
61+
- type: textarea
62+
attributes:
63+
label: "Additional typing packages."
64+
description: |
65+
If you are using `typing-extensions` or typing-stub packages, please
66+
list their versions here.
67+
validations:
68+
required: false

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
# Initializes the CodeQL tools for scanning.
4747
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
48+
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
4949
with:
5050
languages: ${{ matrix.language }}
5151
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
5757
- name: Autobuild
58-
uses: github/codeql-action/autobuild@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
58+
uses: github/codeql-action/autobuild@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -68,6 +68,6 @@ jobs:
6868
# ./location_of_script_within_repo/buildscript.sh
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
71+
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
7272
with:
7373
category: "/language:${{matrix.language}}"

.github/workflows/cygwin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
cd tools
6363
/usr/bin/python3.9 -m pytest --pyargs numpy -n2 -m "not slow"
6464
- name: Upload wheel if tests fail
65-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
65+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
6666
if: failure()
6767
with:
6868
name: numpy-cygwin-wheel

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: 'Checkout Repository'
1818
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1919
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a # v4.3.3
20+
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4

.github/workflows/emscripten.yml

Lines changed: 12 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ on:
66
- main
77
- maintenance/**
88
# Note: this workflow gets triggered on the same schedule as the
9-
# wheels.yml workflow, with the exception that this workflow runs
10-
# the test suite for the Pyodide wheel too, prior to uploading it.
11-
#
12-
# Run on schedule to upload to Anaconda.org
9+
# wheels.yml workflow to upload WASM wheels to Anaconda.org.
1310
schedule:
1411
# ┌───────────── minute (0 - 59)
1512
# │ ┌───────────── hour (0 - 23)
@@ -36,86 +33,30 @@ concurrency:
3633
cancel-in-progress: true
3734

3835
permissions:
39-
contents: read # to fetch code (actions/checkout)
36+
contents: read # to fetch code (actions/checkout)
4037

4138
jobs:
4239
build-wasm-emscripten:
4340
name: Build NumPy distribution for Pyodide
4441
runs-on: ubuntu-22.04
4542
# To enable this workflow on a fork, comment out:
4643
if: github.repository == 'numpy/numpy'
47-
env:
48-
PYODIDE_VERSION: 0.26.0
49-
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
50-
# The appropriate versions can be found in the Pyodide repodata.json
51-
# "info" field, or in Makefile.envs:
52-
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
53-
PYTHON_VERSION: 3.12.1
54-
EMSCRIPTEN_VERSION: 3.1.58
55-
NODE_VERSION: 18
5644
steps:
5745
- name: Checkout NumPy
58-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
46+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5947
with:
6048
submodules: recursive
61-
# This input shall fetch tags without the need to fetch the
62-
# entire VCS history, see https://github.com/actions/checkout#usage
6349
fetch-tags: true
6450

65-
- name: Set up Python ${{ env.PYTHON_VERSION }}
66-
id: setup-python
67-
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
68-
with:
69-
python-version: ${{ env.PYTHON_VERSION }}
51+
- uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
52+
env:
53+
CIBW_PLATFORM: pyodide
7054

71-
- name: Set up Emscripten toolchain
72-
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
55+
- name: Upload wheel artifact(s)
56+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
7357
with:
74-
version: ${{ env.EMSCRIPTEN_VERSION }}
75-
actions-cache-folder: emsdk-cache
76-
77-
- name: Install pyodide-build
78-
run: pip install pyodide-build==${{ env.PYODIDE_VERSION }}
79-
80-
- name: Find installation for pyodide-build
81-
shell: python
82-
run: |
83-
import os
84-
import pyodide_build
85-
from pathlib import Path
86-
87-
pyodide_build_path = Path(pyodide_build.__file__).parent
88-
89-
env_file = os.getenv('GITHUB_ENV')
90-
91-
with open(env_file, "a") as myfile:
92-
myfile.write(f"PYODIDE_BUILD_PATH={pyodide_build_path}\n")
93-
94-
- name: Build NumPy for Pyodide
95-
run: |
96-
pyodide build \
97-
-Cbuild-dir=build \
98-
-Csetup-args="--cross-file=$PWD/tools/ci/emscripten/emscripten.meson.cross" \
99-
-Csetup-args="-Dblas=none" \
100-
-Csetup-args="-Dlapack=none"
101-
102-
- name: Set up Node.js
103-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
104-
with:
105-
node-version: ${{ env.NODE_VERSION }}
106-
107-
- name: Set up Pyodide virtual environment
108-
run: |
109-
pyodide venv .venv-pyodide
110-
source .venv-pyodide/bin/activate
111-
pip install dist/*.whl
112-
pip install -r requirements/emscripten_test_requirements.txt
113-
114-
- name: Test NumPy for Pyodide
115-
run: |
116-
source .venv-pyodide/bin/activate
117-
cd ..
118-
pytest --pyargs numpy -m "not slow"
58+
name: cp312-pyodide_wasm32
59+
path: ./wheelhouse/*.whl
11960

12061
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
12162
# WARNING: this job will overwrite any existing WASM wheels.
@@ -124,7 +65,7 @@ jobs:
12465
(github.repository == 'numpy/numpy') &&
12566
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
12667
(github.event_name == 'schedule')
127-
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
68+
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
12869
with:
129-
artifacts_path: dist/
70+
artifacts_path: wheelhouse/
13071
anaconda_nightly_upload_token: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}

0 commit comments

Comments
 (0)