Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59f95a3

Browse files
authored
MAINT: drop pypy (#30764)
1 parent 26224e9 commit 59f95a3

50 files changed

Lines changed: 90 additions & 310 deletions

Some content is hidden

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

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Linux tests
22

33
# This file is meant for testing across supported Python versions, build types
4-
# and interpreters (PyPy, python-dbg, a pre-release Python in summer time),
4+
# and interpreters (python-dbg, a pre-release Python in summer time),
55
# build-via-sdist, run benchmarks, measure code coverage, and other build
66
# options.
77

.spin/cmds.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import spin
1010
from spin.cmds import meson
1111

12-
IS_PYPY = (sys.implementation.name == 'pypy')
13-
1412
# Check that the meson git submodule is present
1513
curdir = pathlib.Path(__file__).parent
1614
meson_import_dir = curdir.parent / 'vendored-meson' / 'meson' / 'mesonbuild'
@@ -129,10 +127,7 @@ def docs(*, parent_callback, **kwargs):
129127
jobs_param = next(p for p in docs.params if p.name == 'jobs')
130128
jobs_param.default = 1
131129

132-
if IS_PYPY:
133-
default = "not slow and not slow_pypy"
134-
else:
135-
default = "not slow"
130+
default = "not slow"
136131

137132
@click.option(
138133
"-m",

numpy/_core/_add_newdocs.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4174,9 +4174,6 @@ def _array_method_doc(name: str, params: str, doc: str) -> None:
41744174
ValueError
41754175
If `a` does not own its own data or references or views to it exist,
41764176
and the data memory must be changed.
4177-
PyPy only: will always raise if the data memory must be changed, since
4178-
there is no reliable way to determine if references or views to it
4179-
exist.
41804177
41814178
SystemError
41824179
If the `order` keyword argument is specified. This behaviour is a

numpy/_core/_internal.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
except ImportError:
2121
ctypes = None
2222

23-
IS_PYPY = sys.implementation.name == 'pypy'
24-
2523
if sys.byteorder == 'little':
2624
_nbo = '<'
2725
else:
@@ -949,12 +947,8 @@ def npy_ctypes_check(cls):
949947
try:
950948
# ctypes class are new-style, so have an __mro__. This probably fails
951949
# for ctypes classes with multiple inheritance.
952-
if IS_PYPY:
953-
# (..., _ctypes.basics._CData, Bufferable, object)
954-
ctype_base = cls.__mro__[-3]
955-
else:
956-
# # (..., _ctypes._CData, object)
957-
ctype_base = cls.__mro__[-2]
950+
# # (..., _ctypes._CData, object)
951+
ctype_base = cls.__mro__[-2]
958952
# right now, they're part of the _ctypes module
959953
return '_ctypes' in ctype_base.__module__
960954
except Exception:

numpy/_core/_internal.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ _PT_co = TypeVar("_PT_co", bound=int | None, default=None, covariant=True)
1212

1313
###
1414

15-
IS_PYPY: Final[bool] = ...
16-
1715
format_re: Final[re.Pattern[str]] = ...
1816
sep_re: Final[re.Pattern[str]] = ...
1917
space_re: Final[re.Pattern[str]] = ...

numpy/_core/arrayprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ def recurser(index, hanging_indent, curr_width):
964964
finally:
965965
# recursive closures have a cyclic reference to themselves, which
966966
# requires gc to collect (gh-10620). To avoid this problem, for
967-
# performance and PyPy friendliness, we break the cycle:
967+
# performance, we break the cycle:
968968
recurser = None
969969

970970
def _none_or_positive_arg(x, name):

numpy/_core/include/numpy/ndarrayobject.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,6 @@ NPY_TITLE_KEY_check(PyObject *key, PyObject *value)
220220
if (key == title) {
221221
return 1;
222222
}
223-
#ifdef PYPY_VERSION
224-
/*
225-
* On PyPy, dictionary keys do not always preserve object identity.
226-
* Fall back to comparison by value.
227-
*/
228-
if (PyUnicode_Check(title) && PyUnicode_Check(key)) {
229-
return PyUnicode_Compare(title, key) == 0 ? 1 : 0;
230-
}
231-
#endif
232223
return 0;
233224
}
234225

numpy/_core/src/common/gil_utils.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ npy_gil_error(PyObject *type, const char *format, ...)
1616
NPY_ALLOW_C_API_DEF;
1717
NPY_ALLOW_C_API;
1818
if (!PyErr_Occurred()) {
19-
#if !defined(PYPY_VERSION)
20-
PyErr_FormatV(type, format, va);
21-
#else
2219
PyObject *exc_str = PyUnicode_FromFormatV(format, va);
2320
if (exc_str == NULL) {
2421
// no reason to have special handling for this error case, since
@@ -29,7 +26,6 @@ npy_gil_error(PyObject *type, const char *format, ...)
2926
}
3027
PyErr_SetObject(type, exc_str);
3128
Py_DECREF(exc_str);
32-
#endif
3329
}
3430
NPY_DISABLE_C_API;
3531
va_end(va);

numpy/_core/src/common/ufunc_override.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ PyUFuncOverride_GetOutObjects(PyObject *kwds, PyObject **out_kwd_obj, PyObject *
105105
if (PyTuple_CheckExact(*out_kwd_obj)) {
106106
/*
107107
* The C-API recommends calling PySequence_Fast before any of the other
108-
* PySequence_Fast* functions. This is required for PyPy
108+
* PySequence_Fast* functions.
109109
*/
110110
PyObject *seq;
111111
seq = PySequence_Fast(*out_kwd_obj, // noqa: borrowed-ref OK

numpy/_core/src/multiarray/_multiarray_tests.c.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ npy_create_writebackifcopy(PyObject* NPY_UNUSED(self), PyObject* args)
676676
return array;
677677
}
678678

679-
/* used to test WRITEBACKIFCOPY without resolution emits runtime warning */
679+
/* used to test WRITEBACKIFCOPY without resolution, emits runtime warning */
680680
static PyObject*
681681
npy_abuse_writebackifcopy(PyObject* NPY_UNUSED(self), PyObject* args)
682682
{
@@ -690,7 +690,7 @@ npy_abuse_writebackifcopy(PyObject* NPY_UNUSED(self), PyObject* args)
690690
array = PyArray_FromArray((PyArrayObject*)args, NULL, flags);
691691
if (array == NULL)
692692
return NULL;
693-
Py_DECREF(array); /* calls array_dealloc even on PyPy */
693+
Py_DECREF(array); /* calls array_dealloc */
694694
Py_RETURN_NONE;
695695
}
696696

0 commit comments

Comments
 (0)