Skip to content

Commit 0bf6703

Browse files
authored
Merge pull request #1 from rmhowe425/main
rebase
2 parents 1d3c807 + ee56599 commit 0bf6703

File tree

134 files changed

+1263
-1025
lines changed

Some content is hidden

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

134 files changed

+1263
-1025
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
. venv/bin/activate
6464
pip install --progress-bar=off -r test_requirements.txt
6565
pip install --progress-bar=off -r doc_requirements.txt
66-
pip install .
66+
pip install . --config-settings=setup-args="-Dallow-noblas=true"
6767
6868
- run:
6969
name: create release notes

.cirrus.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def main(ctx):
2424
# only contains the actual commit message on a non-PR trigger event.
2525
# For a PR event it contains the PR title and description.
2626
SHA = env.get("CIRRUS_CHANGE_IN_REPO")
27-
url = "https://api.github.com/repos/scipy/scipy/git/commits/" + SHA
27+
url = "https://api.github.com/repos/numpy/numpy/git/commits/" + SHA
2828
dct = http.get(url).json()
2929
# if "[wheel build]" in dct["message"]:
3030
# return fs.read("ci/cirrus_wheels.yml")

.github/workflows/build_test.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,12 @@ jobs:
181181
python-version: ${{ env.PYTHON_VERSION }}
182182
- uses: ./.github/actions
183183

184-
debug_and_cython3:
184+
debug:
185185
needs: [smoke_test]
186186
runs-on: ubuntu-latest
187187
if: github.event_name != 'push'
188188
env:
189189
USE_DEBUG: 1
190-
USE_CYTHON3: 1
191190
steps:
192191
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
193192
with:
@@ -343,11 +342,10 @@ jobs:
343342
sudo apt update
344343
sudo apt install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf gfortran-arm-linux-gnueabihf
345344
346-
# Keep the `test_requirements.txt` dependency-subset synced
347-
docker run --name the_container --interactive -v /:/host arm32v7/ubuntu:22.04 /bin/bash -c "
345+
docker run --name the_container --interactive -v /:/host -v $(pwd):/numpy arm32v7/ubuntu:22.04 /bin/bash -c "
348346
apt update &&
349347
apt install -y git python3 python3-dev python3-pip &&
350-
python3 -m pip install cython==0.29.34 setuptools\<49.2.0 hypothesis==6.23.3 pytest==6.2.5 'typing_extensions>=4.2.0' &&
348+
python3 -m pip install -r /numpy/test_requirements.txt
351349
ln -s /host/lib64 /lib64 &&
352350
ln -s /host/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu &&
353351
ln -s /host/usr/arm-linux-gnueabihf /usr/arm-linux-gnueabihf &&
@@ -425,7 +423,7 @@ jobs:
425423
python-version: ${{ env.PYTHON_VERSION }}
426424
- name: Install Intel SDE
427425
run: |
428-
curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/751535/sde-external-9.14.0-2022-10-25-lin.tar.xz
426+
curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/784319/sde-external-9.24.0-2023-07-13-lin.tar.xz
429427
mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/
430428
sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde
431429
- name: Install dependencies
@@ -442,8 +440,6 @@ jobs:
442440
python -c "import numpy as np; np.show_config()"
443441
# Run only a few tests, running everything in an SDE takes a long time
444442
# Using pytest directly, unable to use python runtests.py -n -t ...
445-
# Disabled running in the SDE because of an SDE bug
446443
- name: Run linalg/ufunc/umath tests
447444
run: |
448-
python -m pytest numpy/core/tests/test_umath* numpy/core/tests/test_ufunc.py numpy/linalg/tests/test_*
449-
#sde -spr -- python -m pytest numpy/core/tests/test_umath* numpy/core/tests/test_ufunc.py numpy/linalg/tests/test_*
445+
sde -spr -- python -m pytest numpy/core/tests/test_umath* numpy/core/tests/test_ufunc.py numpy/linalg/tests/test_*

.github/workflows/circleci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
statuses: write
1818
steps:
1919
- name: GitHub Action step
20-
uses: larsoner/circleci-artifacts-redirector-action@443f056c4757600f1452146a7ce1627d1c034029 # master
20+
uses: larsoner/circleci-artifacts-redirector-action@7e80b26b4c58b5d3272effc05491c18296b1ad6e # master
2121
with:
2222
repo-token: ${{ secrets.GITHUB_TOKEN }}
2323
api-token: ${{ secrets.CIRCLE_TOKEN }}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test with compiler sanitizers (Linux)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- maintenance/**
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
env:
14+
PYTHON_VERSION: 3.11
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read # to fetch code (actions/checkout)
22+
23+
jobs:
24+
gcc_sanitizers:
25+
if: "github.repository == 'numpy/numpy'"
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
29+
with:
30+
submodules: recursive
31+
fetch-depth: 0
32+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
33+
with:
34+
python-version: ${{ env.PYTHON_VERSION }}
35+
- name: Install dependencies
36+
run: |
37+
pip install -r build_requirements.txt
38+
sudo apt-get install -y libopenblas-serial-dev
39+
- name: Build
40+
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
41+
env:
42+
TERM: xterm-256color
43+
run:
44+
spin build -- --werror -Db_sanitize=address,undefined
45+
- name: Test
46+
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
47+
env:
48+
TERM: xterm-256color
49+
run: |
50+
pip install pytest pytest-xdist hypothesis typing_extensions
51+
ASAN_OPTIONS=detect_leaks=0:symbolize=1:strict_init_order=true:allocator_may_return_null=1:halt_on_error=1 \
52+
LD_PRELOAD=$(gcc --print-file-name=libasan.so) \
53+
python -m spin test -- -v -s
54+
55+

.github/workflows/wheels.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
python-version: "3.x"
112112

113113
- name: Build wheels
114-
uses: pypa/cibuildwheel@66b46d086804a9e9782354100d96a3a445431bca # v2.14.0
114+
uses: pypa/cibuildwheel@f21bb8376a051ffb6cb5604b28ccaef7b90e8ab7 # v2.14.1
115115
env:
116116
CIBW_PRERELEASE_PYTHONS: True
117117
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
@@ -186,12 +186,13 @@ jobs:
186186
python-version: "3.9"
187187
- name: Build sdist
188188
run: |
189-
python setup.py sdist
189+
python -m pip install -U pip build
190+
python -m build --sdist -Csetup-args=-Dallow-noblas=true
190191
- name: Test the sdist
191192
run: |
192193
# TODO: Don't run test suite, and instead build wheels from sdist
193194
# Depends on pypa/cibuildwheel#1020
194-
python -m pip install dist/*.gz
195+
python -m pip install dist/*.gz -Csetup-args=-Dallow-noblas=true
195196
pip install ninja
196197
pip install -r test_requirements.txt
197198
cd .. # Can't import numpy within numpy src directory

.github/workflows/windows_meson.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ permissions:
1717
contents: read # to fetch code (actions/checkout)
1818

1919
jobs:
20-
meson:
21-
name: Meson windows build/test
20+
msvc_64bit_python_openblas:
21+
name: MSVC, x86-64, LP64 OpenBLAS
2222
runs-on: windows-2019
23-
# if: "github.repository == 'numpy/numpy'"
23+
if: "github.repository == 'numpy/numpy'"
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -86,3 +86,38 @@ jobs:
8686
echo "LASTEXITCODE is '$LASTEXITCODE'"
8787
python -c "import numpy, sys; sys.exit(numpy.test(verbose=3) is False)"
8888
echo "LASTEXITCODE is '$LASTEXITCODE'"
89+
90+
msvc_32bit_python_openblas:
91+
name: MSVC, 32-bit Python, no BLAS
92+
runs-on: windows-2019
93+
if: "github.repository == 'numpy/numpy'"
94+
steps:
95+
- name: Checkout
96+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
97+
with:
98+
submodules: recursive
99+
fetch-depth: 0
100+
101+
- name: Setup Python (32-bit)
102+
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
103+
with:
104+
python-version: '3.10'
105+
architecture: 'x86'
106+
107+
- name: Setup MSVC (32-bit)
108+
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
109+
with:
110+
architecture: 'x86'
111+
112+
- name: Build and install
113+
run: |
114+
python -m pip install . -v -Ccompile-args="-j2" -Csetup-args="-Dallow-noblas=true"
115+
116+
- name: Install test dependencies
117+
run: |
118+
python -m pip install -r test_requirements.txt
119+
120+
- name: Run test suite (fast)
121+
run: |
122+
cd tools
123+
python -m pytest --pyargs numpy -m "not slow" -n2

.spin/cmds.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -425,25 +425,12 @@ def ipython(ctx, ipython_args):
425425

426426
ppath = meson._set_pythonpath()
427427

428-
# Get NumPy version
429-
p = util.run([
430-
sys.executable, '-c',
431-
'import sys; sys.path.pop(0); import numpy; print(numpy.__version__)'],
432-
output=False, echo=False
433-
)
434-
np_ver = p.stdout.strip().decode('ascii')
435-
436-
with tempfile.TemporaryDirectory() as d:
437-
profile_dir = os.path.join(d, f'numpy_{np_ver}')
438-
startup_dir = os.path.join(profile_dir, 'startup')
439-
440-
pathlib.Path(startup_dir).mkdir(parents=True)
441-
with open(os.path.join(startup_dir, '00_numpy.py'), 'w') as f:
442-
f.write('import numpy as np\n')
443-
444-
print(f'💻 Launching IPython with PYTHONPATH="{ppath}"')
445-
util.run(["ipython", "--profile-dir", profile_dir, "--ignore-cwd"] +
446-
list(ipython_args))
428+
print(f'💻 Launching IPython with PYTHONPATH="{ppath}"')
429+
preimport = (r"import numpy as np; "
430+
r"print(f'\nPreimported NumPy {np.__version__} as np')")
431+
util.run(["ipython", "--ignore-cwd",
432+
f"--TerminalIPythonApp.exec_lines={preimport}"] +
433+
list(ipython_args))
447434

448435

449436
@click.command(context_settings={"ignore_unknown_options": True})

INSTALL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Building NumPy requires the following installed software:
2020
e.g., on Debian/Ubuntu one needs to install both `python3` and
2121
`python3-dev`. On Windows and macOS this is normally not an issue.
2222

23-
2) Cython >= 0.29.30 but < 3.0
23+
2) Cython >= 0.29.35
2424

2525
3) pytest__ (optional)
2626

azure-pipelines.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,15 @@ stages:
220220
PYTHON_ARCH: 'x64'
221221
TEST_MODE: full
222222
BITS: 64
223-
# NPY_USE_BLAS_ILP64: '1'
224-
# TODO: failing because of an issue with ILP64 BLAS being downloaded,
225-
# and that not being handled automatically yet
226-
# PyPy39-64bit-fast:
227-
# PYTHON_VERSION: 'pypy3.9'
228-
# PYTHON_ARCH: 'x64'
229-
# TEST_MODE: fast
230-
# BITS: 64
231-
# NPY_USE_BLAS_ILP64: '1'
223+
NPY_USE_BLAS_ILP64: '1'
224+
PyPy39-64bit-fast:
225+
PYTHON_VERSION: 'pypy3.9'
226+
PYTHON_ARCH: 'x64'
227+
TEST_MODE: fast
228+
BITS: 64
229+
NPY_USE_BLAS_ILP64: '1'
230+
# Broken - it builds but _multiarray_umath doesn't import - needs investigating
231+
DISABLE_BLAS: '1'
232232

233233
steps:
234234
- template: azure-steps-windows.yml

0 commit comments

Comments
 (0)