GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #23991 from rgommers/py312-wheels · numpy/numpy@dbc454a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • wheels.yml
  • numpy
    • __init__.py
    • _pytesttester.py
    • core/tests
      • test_array_interface.py
      • test_dtype.py
      • test_mem_policy.py
      • test_regression.py
    • lib/tests
      • test_format.py
    • meson.build
    • random/tests
      • test_extending.py
    • tests
      • test_ctypeslib.py
      • test_public_api.py
    • typing/tests
      • test_isfile.py
  • test_requirements.txt
  • tools/ci
    • cirrus_wheels.yml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/wheels.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/wheels.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ jobs:
7878
- [ubuntu-20.04, musllinux_x86_64]
7979
- [macos-12, macosx_x86_64]
8080
- [windows-2019, win_amd64]
81-
python: ["cp39", "cp310", "cp311"]
82-
# python: ["cp39", "cp310", "cp311", "pp39"]
81+
python: ["cp39", "cp310", "cp311", "cp312"] # "pp39"
8382
exclude:
8483
# Don't build PyPy 32-bit windows
8584
- buildplat: [windows-2019, win32]
@@ -114,6 +113,7 @@ jobs:
114113
- name: Build wheels
115114
uses: pypa/cibuildwheel@0ecddd92b62987d7a2ae8911f4bb8ec9e2e4496a # v2.13.1
116115
env:
116+
CIBW_PRERELEASE_PYTHONS: True
117117
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
118118

119119
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
Collapse file

‎numpy/__init__.py‎

Copy file name to clipboardExpand all lines: numpy/__init__.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
NumPy testing tools
6767
distutils
6868
Enhancements to distutils with support for
69-
Fortran compilers support and more.
69+
Fortran compilers support and more (for Python <= 3.11)
7070
7171
Utilities
7272
---------
Collapse file

‎numpy/_pytesttester.py‎

Copy file name to clipboardExpand all lines: numpy/_pytesttester.py
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,13 @@ def __call__(self, label='fast', verbose=1, extra_argv=None,
135135
# offset verbosity. The "-q" cancels a "-v".
136136
pytest_args += ["-q"]
137137

138-
with warnings.catch_warnings():
139-
warnings.simplefilter("always")
140-
# Filter out distutils cpu warnings (could be localized to
141-
# distutils tests). ASV has problems with top level import,
142-
# so fetch module for suppression here.
143-
from numpy.distutils import cpuinfo
138+
if sys.version_info < (3, 12):
139+
with warnings.catch_warnings():
140+
warnings.simplefilter("always")
141+
# Filter out distutils cpu warnings (could be localized to
142+
# distutils tests). ASV has problems with top level import,
143+
# so fetch module for suppression here.
144+
from numpy.distutils import cpuinfo
144145

145146
with warnings.catch_warnings(record=True):
146147
# Ignore the warning from importing the array_api submodule. This
Collapse file

‎numpy/core/tests/test_array_interface.py‎

Copy file name to clipboardExpand all lines: numpy/core/tests/test_array_interface.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ def get_module(tmp_path):
128128
more_init=more_init)
129129

130130

131+
# FIXME: numpy.testing.extbuild uses `numpy.distutils`, so this won't work on
132+
# Python 3.12 and up.
133+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
131134
@pytest.mark.slow
132135
def test_cstruct(get_module):
133136

Collapse file

‎numpy/core/tests/test_dtype.py‎

Copy file name to clipboardExpand all lines: numpy/core/tests/test_dtype.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,11 @@ def iter_struct_object_dtypes():
755755
yield pytest.param(dt, p, 12, obj, id="<structured subarray 2>")
756756

757757

758+
@pytest.mark.skipif(
759+
sys.version_info >= (3, 12),
760+
reason="Python 3.12 has immortal refcounts, this test will no longer "
761+
"work. See gh-23986"
762+
)
758763
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
759764
class TestStructuredObjectRefcounting:
760765
"""These tests cover various uses of complicated structured types which
Collapse file

‎numpy/core/tests/test_mem_policy.py‎

Copy file name to clipboardExpand all lines: numpy/core/tests/test_mem_policy.py
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
import sys
1010

1111

12+
# FIXME: numpy.testing.extbuild uses `numpy.distutils`, so this won't work on
13+
# Python 3.12 and up. It's an internal test utility, so for now we just skip
14+
# these tests.
15+
16+
1217
@pytest.fixture
1318
def get_module(tmp_path):
1419
""" Add a memory policy that returns a false pointer 64 bytes into the
@@ -213,6 +218,7 @@ def get_module(tmp_path):
213218
more_init=more_init)
214219

215220

221+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
216222
def test_set_policy(get_module):
217223

218224
get_handler_name = np.core.multiarray.get_handler_name
@@ -241,6 +247,7 @@ def test_set_policy(get_module):
241247
assert get_handler_name() == orig_policy_name
242248

243249

250+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
244251
def test_default_policy_singleton(get_module):
245252
get_handler_name = np.core.multiarray.get_handler_name
246253

@@ -262,6 +269,7 @@ def test_default_policy_singleton(get_module):
262269
assert def_policy_1 is def_policy_2 is get_module.get_default_policy()
263270

264271

272+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
265273
def test_policy_propagation(get_module):
266274
# The memory policy goes hand-in-hand with flags.owndata
267275

@@ -320,6 +328,7 @@ async def async_test_context_locality(get_module):
320328
assert np.core.multiarray.get_handler_name() == orig_policy_name
321329

322330

331+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
323332
def test_context_locality(get_module):
324333
if (sys.implementation.name == 'pypy'
325334
and sys.pypy_version_info[:3] < (7, 3, 6)):
@@ -341,6 +350,7 @@ def concurrent_thread2(get_module, event):
341350
get_module.set_secret_data_policy()
342351

343352

353+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
344354
def test_thread_locality(get_module):
345355
orig_policy_name = np.core.multiarray.get_handler_name()
346356

@@ -359,6 +369,7 @@ def test_thread_locality(get_module):
359369
assert np.core.multiarray.get_handler_name() == orig_policy_name
360370

361371

372+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
362373
@pytest.mark.skip(reason="too slow, see gh-23975")
363374
def test_new_policy(get_module):
364375
a = np.arange(10)
@@ -388,6 +399,8 @@ def test_new_policy(get_module):
388399
c = np.arange(10)
389400
assert np.core.multiarray.get_handler_name(c) == orig_policy_name
390401

402+
403+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
391404
@pytest.mark.xfail(sys.implementation.name == "pypy",
392405
reason=("bad interaction between getenv and "
393406
"os.environ inside pytest"))
@@ -420,6 +433,8 @@ def test_switch_owner(get_module, policy):
420433
else:
421434
os.environ['NUMPY_WARN_IF_NO_MEM_POLICY'] = oldval
422435

436+
437+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils")
423438
def test_owner_is_base(get_module):
424439
a = get_module.get_array_with_base()
425440
with pytest.warns(UserWarning, match='warn_on_free'):
Collapse file

‎numpy/core/tests/test_regression.py‎

Copy file name to clipboardExpand all lines: numpy/core/tests/test_regression.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,10 @@ def test_structured_arrays_with_objects1(self):
14651465
x[x.nonzero()] = x.ravel()[:1]
14661466
assert_(x[0, 1] == x[0, 0])
14671467

1468+
@pytest.mark.skipif(
1469+
sys.version_info >= (3, 12),
1470+
reason="Python 3.12 has immortal refcounts, this test no longer works."
1471+
)
14681472
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
14691473
def test_structured_arrays_with_objects2(self):
14701474
# Ticket #1299 second test
Collapse file

‎numpy/lib/tests/test_format.py‎

Copy file name to clipboardExpand all lines: numpy/lib/tests/test_format.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ def test_load_padded_dtype(tmpdir, dt):
527527
assert_array_equal(arr, arr1)
528528

529529

530+
@pytest.mark.skipif(sys.version_info >= (3, 12), reason="see gh-23988")
530531
@pytest.mark.xfail(IS_WASM, reason="Emscripten NODEFS has a buggy dup")
531532
def test_python2_python3_interoperability():
532533
fname = 'win64python2.npy'
Collapse file

‎numpy/meson.build‎

Copy file name to clipboardExpand all lines: numpy/meson.build
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ pure_subdirs = [
150150
'_utils',
151151
'array_api',
152152
'compat',
153-
'distutils',
154153
'doc',
155154
'f2py',
156155
'lib',
@@ -161,6 +160,9 @@ pure_subdirs = [
161160
'tests',
162161
'typing',
163162
]
163+
if py.version().version_compare('<3.12')
164+
pure_subdirs += 'distutils'
165+
endif
164166

165167
np_dir = py.get_install_dir() / 'numpy'
166168

Collapse file

‎numpy/random/tests/test_extending.py‎

Copy file name to clipboardExpand all lines: numpy/random/tests/test_extending.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import subprocess
55
import sys
66
import warnings
7+
78
import numpy as np
8-
from numpy.distutils.misc_util import exec_mod_from_location
99
from numpy.testing import IS_WASM
1010

1111

@@ -45,10 +45,13 @@
4545
cython = None
4646

4747

48+
@pytest.mark.skipif(sys.version_info >= (3, 12),
49+
reason="numpy.distutils not supported anymore")
4850
@pytest.mark.skipif(IS_WASM, reason="Can't start subprocess")
4951
@pytest.mark.skipif(cython is None, reason="requires cython")
5052
@pytest.mark.slow
5153
def test_cython(tmp_path):
54+
from numpy.distutils.misc_util import exec_mod_from_location
5255
srcdir = os.path.join(os.path.dirname(__file__), '..')
5356
shutil.copytree(srcdir, tmp_path / 'random')
5457
# build the examples and "install" them into a temporary directory

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.