Skip to content

Commit ab024d2

Browse files
committed
debug
1 parent 120ac53 commit ab024d2

File tree

6 files changed

+52
-39
lines changed

6 files changed

+52
-39
lines changed

.github/meson_actions/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ runs:
99
TERM: xterm-256color
1010
PKG_CONFIG_PATH: ./.openblas
1111
run: |
12+
echo $PATH
13+
which python
14+
python --version
15+
ls /home/runner/work/numpy/numpy/.venv/bin
1216
echo "::group::Installing Build Dependencies"
1317
pip install -r requirements/build_requirements.txt
1418
echo "::endgroup::"
@@ -30,7 +34,8 @@ runs:
3034
TERM: xterm-256color
3135
run: |
3236
echo "::group::Installing Test Dependencies"
33-
pip install pytest pytest-xdist pytest-timeout hypothesis typing_extensions setuptools
37+
pip install pytest pytest-xdist pytest-timeout hypothesis typing_extensions
38+
pip install -r requirements/setuptools_requirement.txt
3439
echo "::endgroup::"
3540
echo "::group::Test NumPy"
3641
spin test -- --durations=10 --timeout=600

.github/workflows/linux.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
smoke_test:
5454
# To enable this job on a fork, comment out:
55-
if: github.repository == 'numpy/numpy'
55+
# if: github.repository == 'numpy/numpy'
5656
runs-on: ubuntu-latest
5757
env:
5858
MESON_ARGS: "-Dallow-noblas=true -Dcpu-baseline=none -Dcpu-dispatch=none"
@@ -69,6 +69,8 @@ jobs:
6969
with:
7070
python-version: ${{ matrix.version }}
7171
enable-cache: false
72+
- run:
73+
uv pip install --python=${{ matrix.version }} pip
7274
# TODO: remove cython nightly install when cython does a release
7375
- name: Install nightly Cython
7476
if: matrix.version == '3.13t'

.github/workflows/macos.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: macOS tests
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
58
branches:
69
- main
710
- maintenance/**
11+
812

913
permissions:
1014
contents: read # to fetch code (actions/checkout)
@@ -106,7 +110,7 @@ jobs:
106110
accelerate:
107111
name: Accelerate - ${{ matrix.build_runner[1] }} - ${{ matrix.version }}
108112
# To enable this workflow on a fork, comment out:
109-
if: github.repository == 'numpy/numpy'
113+
# if: github.repository == 'numpy/numpy'
110114
runs-on: ${{ matrix.build_runner[0] }}
111115
strategy:
112116
fail-fast: false
@@ -128,6 +132,9 @@ jobs:
128132
python-version: ${{ matrix.version }}
129133
enable-cache: false
130134

135+
- run:
136+
uv pip install --python=${{ matrix.version }} pip
137+
131138
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
132139
if: ${{ matrix.build_runner[0] == 'macos-13' }}
133140
with:
@@ -142,6 +149,7 @@ jobs:
142149
- name: Install dependencies
143150
run: |
144151
pip install -r requirements/build_requirements.txt
152+
pip install -r requirements/setuptools_requirement.txt
145153
pip install pytest pytest-xdist pytest-timeout hypothesis
146154
147155
- name: Build against Accelerate (LP64)
@@ -152,7 +160,7 @@ jobs:
152160

153161
- name: Build NumPy against Accelerate (ILP64)
154162
run: |
155-
git clean -xdf
163+
rm -r build build-install
156164
spin build -- -Duse-ilp64=true -Ddisable-optimization=true -Dallow-noblas=false
157165
158166
- name: Test (fast tests)

.github/workflows/windows.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Windows tests
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
58
branches:
69
- main
@@ -18,7 +21,7 @@ jobs:
1821
name: x86-64, LP64 OpenBLAS
1922
runs-on: windows-2019
2023
# To enable this job on a fork, comment out:
21-
if: github.repository == 'numpy/numpy'
24+
# if: github.repository == 'numpy/numpy'
2225
strategy:
2326
fail-fast: false
2427
matrix:
@@ -40,20 +43,18 @@ jobs:
4043
python-version: ${{ matrix.compiler-pyversion[1] }}
4144
enable-cache: false
4245

43-
- name: Ensure pip is installed
44-
run: |
45-
python -m ensurepip
46-
python -m pip install -U pip setuptools
46+
- run:
47+
uv pip install --python=${{ matrix.version }} pip
4748

4849
# TODO: remove cython nightly install when cython does a release
4950
- name: Install nightly Cython
5051
if: matrix.compiler-pyversion[1] == '3.13t'
5152
run: |
52-
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython
53+
pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython
5354
5455
- name: Install build dependencies from PyPI
5556
run: |
56-
python -m pip install -r requirements/build_requirements.txt
57+
pip install -r requirements/build_requirements.txt
5758
5859
- name: Install pkg-config
5960
run: |
@@ -72,15 +73,15 @@ jobs:
7273
- name: Install NumPy (MSVC)
7374
if: matrix.compiler-pyversion[0] == 'MSVC'
7475
run: |
75-
python -m pip install -r requirements/ci_requirements.txt
76-
python -m spin build --with-scipy-openblas=32 -j2 -- --vsenv
76+
pip install -r requirements/ci_requirements.txt
77+
spin build --with-scipy-openblas=32 -j2 -- --vsenv
7778
7879
- name: Install NumPy (Clang-cl)
7980
if: matrix.compiler-pyversion[0] == 'Clang-cl'
8081
run: |
8182
"[binaries]","c = 'clang-cl'","cpp = 'clang-cl'","ar = 'llvm-lib'","c_ld = 'lld-link'","cpp_ld = 'lld-link'" | Out-File $PWD/clang-cl-build.ini -Encoding ascii
82-
python -m pip install -r requirements/ci_requirements.txt
83-
python -m spin build --with-scipy-openblas=32 -j2 -- --vsenv --native-file=$PWD/clang-cl-build.ini
83+
pip install -r requirements/ci_requirements.txt
84+
spin build --with-scipy-openblas=32 -j2 -- --vsenv --native-file=$PWD/clang-cl-build.ini
8485
8586
- name: Meson Log
8687
shell: bash
@@ -90,8 +91,8 @@ jobs:
9091
9192
- name: Install test dependencies
9293
run: |
93-
python -m pip install -r requirements/test_requirements.txt
94-
python -m pip install threadpoolctl
94+
pip install -r requirements/test_requirements.txt
95+
pip install threadpoolctl
9596
9697
- name: Run test suite
9798
run: |
@@ -123,11 +124,11 @@ jobs:
123124

124125
- name: Build and install
125126
run: |
126-
python -m pip install . -v -Ccompile-args="-j2" -Csetup-args="-Dallow-noblas=true"
127+
pip install . -v -Ccompile-args="-j2" -Csetup-args="-Dallow-noblas=true"
127128
128129
- name: Install test dependencies
129130
run: |
130-
python -m pip install -r requirements/test_requirements.txt
131+
pip install -r requirements/test_requirements.txt
131132
132133
- name: Run test suite (fast)
133134
run: |

numpy/tests/test_public_api.py

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -398,36 +398,31 @@ def check_importable(module_name):
398398

399399
return True
400400

401-
module_names = []
402401
for module_name in PUBLIC_MODULES:
403-
if not check_importable(module_name):
404-
module_names.append(module_name)
405-
406-
if module_names:
407-
raise AssertionError("Modules in the public API that cannot be "
408-
"imported: {}".format(module_names))
402+
try:
403+
importlib.import_module(module_name)
404+
except (ImportError, AttributeError) as e:
405+
raise AssertionError("Modules in the public API that cannot be "
406+
"imported") from e
409407

408+
module_names = []
410409
for module_name in PUBLIC_ALIASED_MODULES:
411410
try:
412411
eval(module_name)
413-
except AttributeError:
414-
module_names.append(module_name)
415-
416-
if module_names:
417-
raise AssertionError("Modules in the public API that were not "
418-
"found: {}".format(module_names))
412+
except AttributeError as e:
413+
raise AssertionError("Modules in the public API that were not "
414+
"found") from e
419415

420416
with warnings.catch_warnings(record=True) as w:
421417
warnings.filterwarnings('always', category=DeprecationWarning)
422418
warnings.filterwarnings('always', category=ImportWarning)
423419
for module_name in PRIVATE_BUT_PRESENT_MODULES:
424-
if not check_importable(module_name):
425-
module_names.append(module_name)
426-
427-
if module_names:
428-
raise AssertionError("Modules that are not really public but looked "
429-
"public and can not be imported: "
430-
"{}".format(module_names))
420+
try:
421+
importlib.import_module(module_name)
422+
except (ImportError, AttributeError) as e:
423+
raise AssertionError(
424+
"Modules that are not really public but looked "
425+
"public and can not be imported") from e
431426

432427

433428
@pytest.mark.xfail(
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
setuptools==65.5.1 ; python_version < '3.12'
2+
setuptools ; python_version >= '3.12'

0 commit comments

Comments
 (0)