Skip to content

Commit e218653

Browse files
committed
Merge branch 'upstream/main' into numpygh-29824-vectorize-signature-fix
2 parents f34b6d9 + 0b6274e commit e218653

805 files changed

Lines changed: 81472 additions & 18880 deletions

File tree

Some content is hidden

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

‎.circleci/config.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ _defaults: &defaults
1212
- image: cimg/python:3.12.12
1313
working_directory: ~/repo
1414

15+
# PRs changing only paths matching this regex skip the build job
16+
_paths_ignore_re: &paths_ignore_re '\.pyi$|^tools/stubtest/'
17+
1518

1619
jobs:
1720
build:
@@ -33,6 +36,24 @@ jobs:
3336
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
3437
circleci-agent step halt;
3538
fi
39+
40+
- run:
41+
name: check ignored paths
42+
# CircleCI has no `paths-ignore` equivalent
43+
environment:
44+
PATHS_IGNORE_RE: *paths_ignore_re
45+
command: |
46+
[[ -v CIRCLE_PULL_REQUEST ]] || exit 0
47+
# parent 1 of the merge ref is the tip of the target branch
48+
git fetch --quiet origin "refs/pull/${CIRCLE_PULL_REQUEST##*/}/merge" || exit 0
49+
# --no-renames so that a `foo.py` -> `foo.pyi` rename reports both paths
50+
changed=$(git diff --name-only --no-renames "FETCH_HEAD^1...HEAD") || exit 0
51+
if ! grep -qvE "${PATHS_IGNORE_RE}" \<<< "${changed}"; then
52+
echo "Only ignored paths changed, exiting job ${CIRCLE_JOB}:"
53+
echo "${changed}"
54+
circleci-agent step halt
55+
fi
56+
3657
- run:
3758
name: pull changes from merge
3859
command: |

‎.coveragerc‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
[run]
22
branch = True
33
include = */numpy/*
4+
omit =
5+
*/tests/*
6+
*/numpy/conftest.py
47
disable_warnings = include-ignored
8+
parallel = True
9+
patch = subprocess
10+
concurrency =
11+
multiprocessing
12+
thread
13+
14+
[paths]
15+
source =
16+
numpy/
17+
*/numpy/
18+
*/site-packages/numpy/

‎.devcontainer/setup.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ git submodule update --init
1414

1515
# Enables users to activate environment without having to specify the full path
1616
echo "envs_dirs:
17-
- /home/codespace/micromamba/envs" > /opt/conda/.condarc
17+
- $HOME/micromamba/envs" > ~/.condarc
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "NumPy Dev : ubuntu-micromamba",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4+
5+
"features": {
6+
// install sshd to enable ssh connection
7+
"ghcr.io/devcontainers/features/sshd:1": {},
8+
9+
// install python for base python tooling, but disabled global package installs
10+
"ghcr.io/devcontainers/features/python:1": {
11+
"installTools": false
12+
},
13+
// install conda
14+
"ghcr.io/devcontainers/features/conda:1": {}
15+
},
16+
17+
"postCreateCommand": "bash .devcontainer/setup.sh",
18+
19+
"customizations": {
20+
"vscode": {
21+
"settings": {
22+
"python.defaultInterpreterPath": "/home/vscode/micromamba/envs/numpy-dev/bin/python"
23+
},
24+
"extensions": [
25+
"ms-python.python",
26+
"ms-python.vscode-pylance",
27+
"ms-toolsai.jupyter",
28+
"charliermarsh.ruff"
29+
]
30+
}
31+
}
32+
}

.devcontainer/devcontainer.json renamed to .devcontainer/universal-2/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"image": "mcr.microsoft.com/devcontainers/universal:2",
44
"features": {},
55

6-
"onCreateCommand": ".devcontainer/setup.sh",
6+
"onCreateCommand": "",
77
"postCreateCommand": "",
88

99
"customizations": {

‎.gitattributes‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# We want all text files to be /n
2+
# Specific settings below this can still override it
3+
# e.g.
4+
# *.bat text eol=crlf
5+
* text=auto eol=lf
6+
17
# Highlight our custom templating language as C, since it's hopefully better
28
# than nothing. This also affects repo statistics.
39
*.c.src text linguist-language=C
@@ -9,7 +15,6 @@
915
# Mark some files as vendored
1016
numpy/linalg/lapack_lite/f2c.c linguist-vendored
1117
numpy/linalg/lapack_lite/f2c.h linguist-vendored
12-
numpy/_core/include/numpy/libdivide/* linguist-vendored
1318
numpy/_core/src/umath/svml/* linguist-vendored
1419
numpy/_core/src/common/dlpack/dlpack.h linguist-vendored
1520

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
### PR summary
2-
<!-- Please take some time to make it easier for us maintainers to understand
3-
and review your PR. Describe the pull request, using the questions below as
4-
guidance, and link to any relevant issues and PRs.
2+
<!-- Please take some time to make it easier for us to review
3+
your pull request (PR). Describe the PR using the questions below as guidance.
54
6-
7-
Also, have you hit all [the guidelines](https://numpy.org/devdocs/dev/index.html#guidelines)?
8-
And have you filled out the disclosure section below?
5+
- What problem does this PR solve? Link any relevant issues and PRs.
6+
- Why are you interested in working on this PR?
7+
- How does the proposed change help you?
8+
9+
Please keep in mind that even seemingly small changes can have unexpected consequences
10+
for workflows unrelated to the ones you may be familiar with. For this reason, maintainers
11+
carefully consider the risks of all changes, including bug fixes.
12+
13+
Make sure to review the guidelines for contributing code to NumPy (https://numpy.org/devdocs/dev/index.html#guidelines) and fill out the AI disclosure section below.
14+
15+
Please note that non-maintainers may only have 2 non-draft PRs open for review at a
16+
time.
917
1018
-->
1119

12-
### First time committer introduction
13-
<!-- If you are new to the NumPy community, please introduce yourself. How do you
14-
use NumPy, what prompted you to make this contribution? We are a community of
15-
mostly volunteers, and getting to know you helps us trust your judgement
16-
and welcome you into the community.
20+
### First time contributor introduction
21+
<!-- If you are new to the NumPy contributor community, please introduce yourself and
22+
share how you use NumPy. It helps us get to know you, understand the context of your
23+
contribution, and collaborate more effectively during the review process. 2-3
24+
sentences is plenty, we are not looking for a work history or a measure of your
25+
expertise.
26+
1727
-->
1828

1929
#### AI Disclosure
20-
<!-- If AI was used in the preparation of this pull request, please disclose
30+
<!-- If AI was used in the preparation of this PR, please disclose
2131
the tool(s) used, how they were used, and specify what code or text is AI generated.
22-
If no AI tools were used, please write "No AI tools used" in this section. Read our
23-
policy on AI generated code at
24-
https://numpy.org/devdocs/dev/ai_policy.html.
32+
If no AI tools were used, please write "No AI tools used" in this section.
33+
34+
All interactions with reviewers must be performed by humans, including the submission of PRs.
35+
36+
Read the NumPy policy on AI generated code at https://numpy.org/devdocs/dev/ai_policy.html.
2537
26-
In particular, all interaction is to be done by humans, including submission of PRs.
2738
-->

‎.github/ccache/action.yml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Adapted from SciPy's ccache action:
2+
# https://github.com/scipy/scipy/blob/main/.github/ccache/action.yml
3+
name: Setup Compiler Cache
4+
description: Prepare and restore compiler cache using ccache
5+
inputs:
6+
workflow_name:
7+
description: "Name of the calling workflow to use as cache key prefix"
8+
required: true
9+
job_name:
10+
description: "Name of the calling job, used as cache key prefix"
11+
required: true
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Prepare compiler cache
17+
id: prep-ccache
18+
shell: bash
19+
run: |
20+
mkdir -p "${CCACHE_DIR:-$HOME/.ccache}"
21+
echo "dir=${CCACHE_DIR:-$HOME/.ccache}" >> $GITHUB_OUTPUT
22+
NOW=$(date -u +"%F-%T")
23+
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
24+
- name: Setup compiler cache and save it
25+
# Run a restore and save if running on main
26+
# Note: we can't simply use restore followed by save because composite actions
27+
# are not capable of running post job steps.
28+
if: ${{ github.ref == 'refs/heads/main' }}
29+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
30+
with:
31+
path: ${{ steps.prep-ccache.outputs.dir }}
32+
key: ${{ inputs.workflow_name }}-${{ inputs.job_name }}-ccache-linux-${{ steps.prep-ccache.outputs.timestamp }}
33+
restore-keys: ${{ inputs.workflow_name }}-${{ inputs.job_name }}-ccache-linux-
34+
- name: Setup compiler cache
35+
# Run just the restore if not running on main
36+
if: ${{ github.ref != 'refs/heads/main' }}
37+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
38+
with:
39+
path: ${{ steps.prep-ccache.outputs.dir }}
40+
key: ${{ inputs.workflow_name }}-${{ inputs.job_name }}-ccache-linux-${{ steps.prep-ccache.outputs.timestamp }}
41+
restore-keys: ${{ inputs.workflow_name }}-${{ inputs.job_name }}-ccache-linux-
42+
- name: Reset stats
43+
shell: bash
44+
run: |
45+
# Restoring the cache also restored the stats from the previous run
46+
ccache --zero-stats

‎.github/check-warnings/action.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@ runs:
1717
steps:
1818
- name: Extract warnings
1919
shell: bash
20+
env:
21+
LOG_FILE: ${{ inputs.log-file }}
22+
WARNING_REGEX: ${{ inputs['warning-regex'] }}
23+
ALLOWLIST: ${{ inputs.allowlist }}
2024
run: |
21-
echo "Extracting warnings from ${{ inputs.log-file }} using regex: ${{ inputs['warning-regex'] }}"
22-
grep -E "${{ inputs['warning-regex'] }}" "${{ inputs.log-file }}" | tee warnings.log || true
25+
echo "Extracting warnings from $LOG_FILE using regex: $WARNING_REGEX"
26+
grep -E "$WARNING_REGEX" "$LOG_FILE" | tee warnings.log || true
2327
2428
if [ ! -s warnings.log ]; then
2529
echo "No warnings found."
2630
exit 0
2731
fi
2832
29-
echo "Filtering against allowlist ${{ inputs.allowlist }}"
30-
grep -v -F -f "${{ inputs.allowlist }}" warnings.log | tee disallowed.log || true
33+
echo "Filtering against allowlist $ALLOWLIST"
34+
grep -v -F -f "$ALLOWLIST" warnings.log | tee disallowed.log || true
3135
3236
if [ -s disallowed.log ]; then
3337
echo "::error::Disallowed warnings detected:"

‎.github/dependabot.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
version: 2
22
updates:
33
- package-ecosystem: github-actions
4-
directory: /
4+
directories:
5+
- /
6+
- /.github/ccache
57
schedule:
6-
interval: daily
8+
interval: weekly
79
cooldown:
810
default-days: 7 # optional
911
commit-message:
1012
prefix: "MAINT"
1113
labels:
1214
- "03 - Maintenance"
15+
groups:
16+
github-actions:
17+
patterns:
18+
- "*"
1319
ignore:
1420
- dependency-name: "bus1/cabuild"
1521
- package-ecosystem: pip
1622
directory: /requirements
1723
schedule:
1824
interval: daily
25+
versioning-strategy: increase-if-necessary
1926
cooldown:
2027
default-days: 7 # optional
2128
groups:
@@ -32,3 +39,4 @@ updates:
3239
- dependency-name: "scipy-openblas64"
3340
- dependency-name: "jupyterlite-pyodide-kernel"
3441
- dependency-name: "sphinx"
42+
- dependency-name: "pkgconf"

0 commit comments

Comments
 (0)