Skip to content

Commit a3902d9

Browse files
pypy: 7.3.17 -> 7.3.19 (#393847)
2 parents 8026644 + 214357a commit a3902d9

File tree

8 files changed

+198
-29
lines changed

8 files changed

+198
-29
lines changed

pkgs/by-name/me/meson/package.nix

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
pkg-config,
1111
python3,
1212
replaceVars,
13+
writeShellScriptBin,
1314
zlib,
1415
}:
1516

@@ -66,12 +67,34 @@ python3.pkgs.buildPythonApplication rec {
6667
./007-freebsd-pkgconfig-path.patch
6768
];
6869

70+
postPatch =
71+
if python3.isPyPy then
72+
''
73+
substituteInPlace mesonbuild/modules/python.py \
74+
--replace-fail "PythonExternalProgram('python3', mesonlib.python_command)" \
75+
"PythonExternalProgram('${python3.meta.mainProgram}', mesonlib.python_command)"
76+
substituteInPlace mesonbuild/modules/python3.py \
77+
--replace-fail "state.environment.lookup_binary_entry(mesonlib.MachineChoice.HOST, 'python3')" \
78+
"state.environment.lookup_binary_entry(mesonlib.MachineChoice.HOST, '${python3.meta.mainProgram}')"
79+
substituteInPlace "test cases"/*/*/*.py "test cases"/*/*/*/*.py \
80+
--replace-quiet '#!/usr/bin/env python3' '#!/usr/bin/env pypy3' \
81+
--replace-quiet '#! /usr/bin/env python3' '#!/usr/bin/env pypy3'
82+
chmod +x "test cases"/*/*/*.py "test cases"/*/*/*/*.py
83+
''
84+
else
85+
null;
86+
6987
nativeBuildInputs = [ installShellFiles ];
7088

71-
nativeCheckInputs = [
72-
ninja
73-
pkg-config
74-
];
89+
nativeCheckInputs =
90+
[
91+
ninja
92+
pkg-config
93+
]
94+
++ lib.optionals python3.isPyPy [
95+
# Several tests hardcode python3.
96+
(writeShellScriptBin "python3" ''exec pypy3 "$@"'')
97+
];
7598

7699
checkInputs =
77100
[
@@ -116,9 +139,15 @@ python3.pkgs.buildPythonApplication rec {
116139
# pch doesn't work quite right on FreeBSD, I think
117140
''test cases/common/13 pch''
118141
]
142+
++ lib.optionals python3.isPyPy [
143+
# fails for unknown reason
144+
''test cases/python/4 custom target depends extmodule''
145+
]
119146
))
120147
++ [
121-
''HOME="$TMPDIR" python ./run_project_tests.py''
148+
''HOME="$TMPDIR" ${
149+
if python3.isPyPy then python3.interpreter else "python"
150+
} ./run_project_tests.py''
122151
"runHook postCheck"
123152
]
124153
);

pkgs/development/interpreters/python/default.nix

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@
138138
sourceVersion = {
139139
major = "7";
140140
minor = "3";
141-
patch = "17";
141+
patch = "19";
142142
};
143143

144-
hash = "sha256-UOBoQPS73pFEgICkEYBoqJuPvK4l/42h4rsUAtyaA0Y=";
144+
hash = "sha256-hwPNywH5+Clm3UO2pgGPFAOZ21HrtDwSXB+aIV57sAM=";
145145
pythonVersion = "2.7";
146146
db = db.override { dbmSupport = !stdenv.hostPlatform.isDarwin; };
147147
python = __splicedPackages.pythonInterpreters.pypy27_prebuilt;
@@ -153,31 +153,46 @@
153153
sourceVersion = {
154154
major = "7";
155155
minor = "3";
156-
patch = "17";
156+
patch = "19";
157157
};
158158

159-
hash = "sha256-atdLxXjpxtOoocUVAzEwWOPFjDXfhvdIVFPEvmqyS/c=";
159+
hash = "sha256-p8IpMLkY9Ahwhl7Yp0FH9ENO+E09bKKzweupNV1JKcg=";
160160
pythonVersion = "3.10";
161161
db = db.override { dbmSupport = !stdenv.hostPlatform.isDarwin; };
162162
python = __splicedPackages.pypy27;
163163
inherit passthruFun;
164164
};
165165

166+
pypy311 = callPackage ./pypy {
167+
self = __splicedPackages.pypy311;
168+
sourceVersion = {
169+
major = "7";
170+
minor = "3";
171+
patch = "19";
172+
};
173+
174+
hash = "sha256-SBfARLtGmjJ05gqjZFdw+B60+RZup/3E5sNRNFVUyNg=";
175+
pythonVersion = "3.11";
176+
db = db.override { dbmSupport = !stdenv.hostPlatform.isDarwin; };
177+
python = __splicedPackages.pypy27;
178+
inherit passthruFun;
179+
};
180+
166181
pypy27_prebuilt = callPackage ./pypy/prebuilt_2_7.nix {
167182
# Not included at top-level
168183
self = __splicedPackages.pythonInterpreters.pypy27_prebuilt;
169184
sourceVersion = {
170185
major = "7";
171186
minor = "3";
172-
patch = "17";
187+
patch = "19";
173188
};
174189

175190
hash =
176191
{
177-
aarch64-linux = "sha256-qN9c4WUPR1aTP4eAhwyRoKQOfJhw10YpvyQTkry1wuM=";
178-
x86_64-linux = "sha256-nzSX+HszctF+RHNp4AFqS+yZprTSpZq6d0olv+Q1NHQ=";
179-
aarch64-darwin = "sha256-gCJIc5sqzIwb5tlH8Zsy/A44wI4xKzXAXMf7IvEHCeQ=";
180-
x86_64-darwin = "sha256-gtRgQhRmyBraSh2Z3y3xuLNTQbOXyF///lGkwwItCDM=";
192+
aarch64-linux = "sha256-/onU/UrxP3bf5zFZdQA1GM8XZSDjzOwVRKiNF09QkQ4=";
193+
x86_64-linux = "sha256-04RFUIwurxTrs4DZwd7TIcXr6uMcfmaAAXPYPLjd9CM=";
194+
aarch64-darwin = "sha256-KHgOC5CK1ttLTglvQjcSS+eezJcxlG2EDZyHSetnp1k=";
195+
x86_64-darwin = "sha256-a+KNRI2OZP/8WG2bCuTQkGSoPMrrW4BgxlHFzZrgaHg=";
181196
}
182197
.${stdenv.system};
183198
pythonVersion = "2.7";
@@ -190,19 +205,39 @@
190205
sourceVersion = {
191206
major = "7";
192207
minor = "3";
193-
patch = "17";
208+
patch = "19";
194209
};
195210
hash =
196211
{
197-
aarch64-linux = "sha256-v79JVJirwv53G2C/ZOXDwHLgr7z8pprHKCxP9Dd/9BY=";
198-
x86_64-linux = "sha256-NA2kGWYGsiRQmhuLMa/SAYE/CCYB3xicE46QXB1g4K8=";
199-
aarch64-darwin = "sha256-KPKf/JxcyQbo6QgT/BRPA34js4TwUuGE4kIzL3tgqwY=";
200-
x86_64-darwin = "sha256-I/8mS3PlvFt8OhufrHdosj35bH1mDLZBLxxSNSGjNL8=";
212+
aarch64-linux = "sha256-ryeliRePERmOIkSrZcpRBjC6l8Ex18zEAh61vFjef1c=";
213+
x86_64-linux = "sha256-xzrCzCOArJIn/Sl0gr8qPheoBhi6Rtt1RNU1UVMh7B4=";
214+
aarch64-darwin = "sha256-PbigP8SWFkgBZGhE1/OxK6oK2zrZoLfLEkUhvC4WijY=";
215+
x86_64-darwin = "sha256-LF5cKjOsiCVR1/KLmNGdSGuJlapQgkpztO3Mau7DXGM=";
201216
}
202217
.${stdenv.system};
203218
pythonVersion = "3.10";
204219
inherit passthruFun;
205220
};
221+
222+
pypy311_prebuilt = callPackage ./pypy/prebuilt.nix {
223+
# Not included at top-level
224+
self = __splicedPackages.pythonInterpreters.pypy311_prebuilt;
225+
sourceVersion = {
226+
major = "7";
227+
minor = "3";
228+
patch = "19";
229+
};
230+
hash =
231+
{
232+
aarch64-linux = "sha256-EyB9v4HOJOltp2CxuGNie3e7ILH7TJUZHgKgtyOD33Q=";
233+
x86_64-linux = "sha256-kXfZ4LuRsF+SHGQssP9xoPNlO10ppC1A1qB4wVt1cg8=";
234+
aarch64-darwin = "sha256-dwTg1TAuU5INMtz+mv7rEENtTJQjPogwz2A6qVWoYcE=";
235+
x86_64-darwin = "sha256-okOfnTDf2ulqXpEBx9xUqKaLVsnXMU6jmbCiXT6H67I=";
236+
}
237+
.${stdenv.system};
238+
pythonVersion = "3.11";
239+
inherit passthruFun;
240+
};
206241
}
207242
// lib.optionalAttrs config.allowAliases {
208243
pypy39_prebuilt = throw "pypy 3.9 has been removed, use pypy 3.10 instead"; # Added 2025-01-03

pkgs/development/interpreters/python/pypy/default.nix

Lines changed: 101 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ stdenv.mkDerivation rec {
121121
dontPatchShebangs = true;
122122
disallowedReferences = [ python ];
123123

124+
# fix compiler error in curses cffi module, where char* != const char*
125+
NIX_CFLAGS_COMPILE =
126+
if stdenv.cc.isClang then "-Wno-error=incompatible-function-pointer-types" else null;
124127
C_INCLUDE_PATH = lib.makeSearchPathOutput "dev" "include" buildInputs;
125128
LIBRARY_PATH = lib.makeLibraryPath buildInputs;
126129
LD_LIBRARY_PATH = lib.makeLibraryPath (
@@ -192,13 +195,18 @@ stdenv.mkDerivation rec {
192195
mkdir -p $out/${executable}-c/pypy/bin
193196
mv $out/bin/${executable} $out/${executable}-c/pypy/bin/${executable}
194197
ln -s $out/${executable}-c/pypy/bin/${executable} $out/bin/${executable}
198+
''
199+
# _testcapi is compiled dynamically, into the store.
200+
# This would fail if we don't do it here.
201+
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
202+
pushd /
203+
$out/bin/${executable} -c "from test import support"
204+
popd
195205
'';
196206

197207
setupHook = python-setup-hook sitePackages;
198208

199-
# TODO: A bunch of tests are failing as of 7.1.1, please feel free to
200-
# fix and re-enable if you have the patience and tenacity.
201-
doCheck = false;
209+
# TODO: Investigate why so many tests are failing.
202210
checkPhase =
203211
let
204212
disabledTests =
@@ -213,6 +221,9 @@ stdenv.mkDerivation rec {
213221
"test_urllib2net"
214222
"test_urllibnet"
215223
"test_urllib2_localnet"
224+
# test_subclass fails with "internal error"
225+
# test_load_default_certs_env fails for unknown reason
226+
"test_ssl"
216227
]
217228
++ lib.optionals isPy3k [
218229
# disable asyncio due to https://github.com/NixOS/nix/issues/1238
@@ -226,6 +237,88 @@ stdenv.mkDerivation rec {
226237
# disable __all__ because of spurious imp/importlib warning and
227238
# warning-to-error test policy
228239
"test___all__"
240+
# fail for multiple reasons, TODO: investigate
241+
"test__opcode"
242+
"test_ast"
243+
"test_audit"
244+
"test_builtin"
245+
"test_c_locale_coercion"
246+
"test_call"
247+
"test_class"
248+
"test_cmd_line"
249+
"test_cmd_line_script"
250+
"test_code"
251+
"test_code_module"
252+
"test_codeop"
253+
"test_compile"
254+
"test_coroutines"
255+
"test_cprofile"
256+
"test_ctypes"
257+
"test_embed"
258+
"test_exceptions"
259+
"test_extcall"
260+
"test_frame"
261+
"test_generators"
262+
"test_grammar"
263+
"test_idle"
264+
"test_iter"
265+
"test_itertools"
266+
"test_list"
267+
"test_marshal"
268+
"test_memoryio"
269+
"test_memoryview"
270+
"test_metaclass"
271+
"test_mmap"
272+
"test_multibytecodec"
273+
"test_opcache"
274+
"test_pdb"
275+
"test_peepholer"
276+
"test_positional_only_arg"
277+
"test_print"
278+
"test_property"
279+
"test_pyclbr"
280+
"test_range"
281+
"test_re"
282+
"test_readline"
283+
"test_regrtest"
284+
"test_repl"
285+
"test_rlcompleter"
286+
"test_signal"
287+
"test_sort"
288+
"test_source_encoding"
289+
"test_ssl"
290+
"test_string_literals"
291+
"test_structseq"
292+
"test_subprocess"
293+
"test_super"
294+
"test_support"
295+
"test_syntax"
296+
"test_sys"
297+
"test_sys_settrace"
298+
"test_tcl"
299+
"test_termios"
300+
"test_threading"
301+
"test_trace"
302+
"test_tty"
303+
"test_unpack_ex"
304+
"test_utf8_mode"
305+
"test_weakref"
306+
"test_capi"
307+
"test_concurrent_futures"
308+
"test_dataclasses"
309+
"test_doctest"
310+
"test_future_stmt"
311+
"test_importlib"
312+
"test_inspect"
313+
"test_pydoc"
314+
"test_warnings"
315+
]
316+
++ lib.optionals isPy310 [
317+
"test_contextlib_async"
318+
"test_future"
319+
"test_lzma"
320+
"test_module"
321+
"test_typing"
229322
];
230323
in
231324
''
@@ -264,6 +357,7 @@ stdenv.mkDerivation rec {
264357

265358
meta = with lib; {
266359
homepage = "https://www.pypy.org/";
360+
changelog = "https://doc.pypy.org/en/stable/release-v${version}.html";
267361
description = "Fast, compliant alternative implementation of the Python language (${pythonVersion})";
268362
mainProgram = "pypy";
269363
license = licenses.mit;
@@ -274,6 +368,9 @@ stdenv.mkDerivation rec {
274368
"x86_64-darwin"
275369
];
276370
broken = optimizationLevel == "0"; # generates invalid code
277-
maintainers = with maintainers; [ andersk ];
371+
maintainers = with maintainers; [
372+
andersk
373+
fliegendewurst
374+
];
278375
};
279376
}

pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ stdenv.mkDerivation {
100100
mv -t $out bin include lib-python lib_pypy site-packages
101101
mv $out/bin/libpypy*-c${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/
102102
${lib.optionalString stdenv.hostPlatform.isLinux ''
103-
mv lib/libffi.so.6* $out/lib/
104103
rm $out/bin/*.debug
105104
''}
106105

pkgs/development/interpreters/python/tests.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ let
237237
}
238238
);
239239

240-
condaTests =
240+
# depends on mypy, which depends on CPython internals
241+
condaTests = lib.optionalAttrs (!python.isPyPy) (
241242
let
242243
requests = callPackage (
243244
{
@@ -276,7 +277,8 @@ let
276277
condaExamplePackage = runCommand "import-requests" { } ''
277278
${pythonWithRequests.interpreter} -c "import requests" > $out
278279
'';
279-
};
280+
}
281+
);
280282

281283
in
282284
lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform) (

pkgs/development/python-modules/cython/default.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
buildPythonPackage,
44
fetchFromGitHub,
55
gdb,
6+
isPyPy,
67
ncurses,
78
numpy,
89
pkg-config,
@@ -36,7 +37,9 @@ buildPythonPackage rec {
3637
ncurses
3738
];
3839

39-
env.LC_ALL = "en_US.UTF-8";
40+
env = lib.optionalAttrs (!isPyPy) {
41+
LC_ALL = "en_US.UTF-8";
42+
};
4043

4144
# https://github.com/cython/cython/issues/2785
4245
# Temporary solution

pkgs/development/python-modules/mypy/default.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
gitUpdater,
77
pythonAtLeast,
88
pythonOlder,
9+
isPyPy,
910

1011
# build-system
1112
setuptools,
@@ -35,7 +36,8 @@ buildPythonPackage rec {
3536
version = "1.15.0";
3637
pyproject = true;
3738

38-
disabled = pythonOlder "3.8";
39+
# relies on several CPython internals
40+
disabled = pythonOlder "3.8" || isPyPy;
3941

4042
src = fetchFromGitHub {
4143
owner = "python";

0 commit comments

Comments
 (0)