Commit graph

4748 commits

Author SHA1 Message Date
Miss Islington (bot)
4af1b72b31
[3.14] gh-133600: Move config.site-wasm32-emscripten into the emscripten folder (GH-136934) (#136956)
Reorganises the large Emscripten-specific file into the Emscripten folder.
(cherry picked from commit bbe589f93c)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-22 00:22:57 +00:00
Miss Islington (bot)
4f6f3ee8d3
[3.14] gh-136852: Emscripten: Add PYTHON_NODE_VERSION environment variable (GH-136853) (GH-136907)
To choose the node version we use. Together with:
https://github.com/python/buildmaster-config/pull/614
closes GH-136852.
(cherry picked from commit aec7f5f8b2)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-21 11:58:57 +02:00
Miss Islington (bot)
81aab6d51c
[3.14] parser_generator.py typo - keywods -> keywords (GH-135014) (#136772)
Co-authored-by: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com>
2025-07-19 09:18:55 +00:00
Miss Islington (bot)
cdf98c3b7e
[3.14] gh-127146: Report uid in Emscripten + node as native uid (GH-136509) (#136699)
Corrects the handling of getuid on emscripten, which was consistently reporting as 0.
(cherry picked from commit e81c4e84b3)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-16 06:50:51 +02:00
Miss Islington (bot)
55eaaab8a4
[3.14] gh-116738: Make grp module thread-safe (GH-135434) (#136658)
gh-116738: Make grp module thread-safe (GH-135434)

Make grp module methods getgrgid() and getgrnam() thread-safe when the GIL is disabled and getgrgid_r()/getgrnam_r() C APIs are not available.
---------
(cherry picked from commit 9363703bd3)

Co-authored-by: Alper <alperyoney@fb.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-15 11:03:33 +05:30
Miss Islington (bot)
ba070b6b07
[3.14] gh-135256: Simplify parsing parameters in Argument Clinic (GH-135257) (121914136635)
(cherry picked from commit b74fb8e220)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-13 20:52:02 +00:00
Miss Islington (bot)
145c08629b
[3.14] gh-136297: Fix hypothesis and subTest usage in test_zoneinfo_property.py (GH-136384) (#136407)
gh-136297: Fix `hypothesis` and `subTest` usage in `test_zoneinfo_property.py` (GH-136384)
(cherry picked from commit db699db99d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-08 08:16:51 +00:00
Miss Islington (bot)
3bc42942af
[3.14] GH-134273: Allow setting JIT compiler flags at build time with CFLAGS_JIT (GH-135792)
(cherry picked from commit 2b0c684e07)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-07-01 14:34:59 -07:00
Miss Islington (bot)
5e65cbbe64
[3.14] Doc: fix duplicated words (GH-136086) (#136108)
Doc: fix duplicated words (GH-136086)

---------
(cherry picked from commit 698bab5a40)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-29 18:45:26 -04:00
Brett Cannon
4ba18128f9
[3.14] GH-133600: Backport file reorg of Tools/wasm/wasi (GH-135950)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-26 19:24:33 +00:00
Miss Islington (bot)
148f31f2d8
[3.14] gh-135648: Document that shutil.copyfileobj doesn't flush (GH-135737) (#135873)
Adds a note about flush/close on copyfileobj, and updates
the Emscripten build script to follow documented advice.
(cherry picked from commit 34393cbdd4)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-06-24 01:22:07 +00:00
Miss Islington (bot)
aad47c1e0b
[3.14] Bump mypy to 1.16.1 (GH-135720) (#135848)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-06-23 13:09:24 +00:00
Miss Islington (bot)
a843fece61
[3.14] patchcheck: use URL paths to identify upstream remote (GH-135806) (#135808)
Co-authored-by: Kattni <kattni@kattni.com>
2025-06-23 12:56:06 +03:00
Miss Islington (bot)
91d9e9e64e
[3.14] gh-134262: Catch both URLError and ConnectionError in retries (GH-135365) (#135611)
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-06-17 12:16:17 +00:00
Emma Smith
3233cff84e
[3.14] gh-134262: increase retries in Tools/build/generate_sbom.py … (#135596) 2025-06-17 14:50:15 +03:00
Miss Islington (bot)
1bd034de9d
[3.14] gh-134632: Fix build-details.json to use INCLUDEPY path (GH-134633) (#135605)
gh-134632: Fix `build-details.json` to use `INCLUDEPY` path (GH-134633)

* gh-134632: Fix `build-details.json` to use `INCLUDEPY` path

Fix ``build-details.json`` generation to use ``INCLUDEPY``, in order to
reference the ``pythonX.Y`` subdirectory of the include directory, as
required in :pep:`739`, instead of the top-level include directory.

* test_build_details: Add tests for the c_api section

* test_build_details: Expect pkgconfig for CPython unconditionally
(cherry picked from commit 0d582def34)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
2025-06-17 08:31:10 +00:00
Miss Islington (bot)
30494cc72c
[3.14] gh-133967: Do not normalize locale name 'C.UTF-8' to 'en_US.UTF-8' (GH-135347) (GH-135349)
(cherry picked from commit 0f866cbfef)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-11 12:43:20 +03:00
Miss Islington (bot)
904685f90f
[3.14] gh-133157: remove usage of _Py_NO_SANITIZE_UNDEFINED in Parser/pegen.c (GH-134048) (#135320)
gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `Parser/pegen.c` (GH-134048)
(cherry picked from commit 754e7c9b51)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-10 00:34:49 +00:00
Miss Islington (bot)
169cdfefce
[3.14] gh-135144: Add _remote_debugging to the MSI (legacy) Windows installers. (GH-135145) (#135150)
(cherry picked from commit e598eecf4c)

Co-authored-by: T. Wouters <thomas@python.org>
2025-06-04 20:08:52 +00:00
Miss Islington (bot)
89df01bd27
[3.14] gh-135028: Increase parser MAXSTACK for nested parenthesis (GH-135031) (#135059)
gh-135028: Increase parser MAXSTACK for nested parenthesis (GH-135031)
(cherry picked from commit 6e80f11eb5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-03 12:23:06 +00:00
Miss Islington (bot)
7dc4496655
[3.14] gh-134262: Add retries to generate_sbom.py (GH-134460)
(cherry picked from commit 0c5a8b0b55)

Includes fix for off-by-one error from GH-134867
(cherry-picked from commit e64395e8eb)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-28 23:52:31 +00:00
Miss Islington (bot)
ebfd18b3f0
[3.14] gh-127833: lexical analysis: Improve section on Names (GH-131474) (#134423)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-26 11:00:17 +03:00
Brett Cannon
8f4bf1538d
[3.14] GH-131769: fix detecting a pydebug build of the build Python when building for WASI (GH-133219) 2025-05-22 22:07:21 +00:00
Miss Islington (bot)
59cb829eb9
[3.14] gh-134455: Fix build-details.json to use the `c_api.headers` key (GH-134456) (#134504)
Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-05-22 15:26:26 +03:00
Miss Islington (bot)
6ce2045139
[3.14] GH-133779: Fix finding pyconfig.h on Windows JIT builds (GH-134359)
(cherry picked from commit 7ad90463df)
2025-05-20 13:22:24 -04:00
Steve Dower
7686c752b3
[3.14] gh-133779: Revert Windows generation of pyconfig.h and go back to a static header. (GH-133966)
Extension builders must specify Py_GIL_DISABLED if they want to link to the free-threaded builds.
This was usually the case already, but this change guarantees it in all circumstances.
2025-05-19 21:24:53 +01:00
Miss Islington (bot)
c869898f39
[3.14] gh-128045: Mark unknown opcodes as deopting to themselves (GH-128044) (#134228)
* gh-128045: Mark unknown opcodes as deopting to themselves (GH-128044)
2025-05-19 11:09:15 -04:00
Miss Islington (bot)
31deafb8ee
[3.14] gh-133410: Fix PR detection in build workflow (GH-133671) (#134055)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-15 13:37:41 +00:00
Miss Islington (bot)
620065c33e
[3.14] gh-133403: Check Tools/build/deepfreeze.py with mypy (GH-133802) (#134038)
gh-133403: Check `Tools/build/deepfreeze.py` with mypy (GH-133802)
(cherry picked from commit 7eaa097390)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-15 09:39:20 +00:00
Miss Islington (bot)
bd6aad0ec4
[3.14] gh-133403: Check Tools/build/generate-build-details.py with mypy (GH-133735) (#133764)
gh-133403: Check `Tools/build/generate-build-details.py` with mypy (GH-133735)
(cherry picked from commit cd2f234ad2)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-09 14:48:05 +00:00
Miss Islington (bot)
47d4947823
[3.14] gh-133412: amend docs for the inst definition (GH-133708) (#133729)
gh-133412: amend docs for the `inst` definition (GH-133708)

The `stack_effect` is incorrectly documented as being allowed to be optional.
(cherry picked from commit f77dac66e1)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
2025-05-09 07:12:41 +00:00
Miss Islington (bot)
4c6fa89216
[3.14] gh-133467: Add TSAN suppressions for races in typeobject (gh-133534) (gh-133717)
(cherry picked from commit 8679c8d5cc)
2025-05-08 16:37:08 -07:00
Miss Islington (bot)
add970f08e
gh-133626: Ensure the traditional Windows installer doesn't accidentally pick up site-packages (GH-133693)
(cherry picked from commit 6ce469dcba)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-08 20:17:11 +00:00
Miss Islington (bot)
cc6cf8a928
[3.14] gh-133403: Check Tools/build/verify_ensurepip_wheels.py with mypy (GH-133453) (#133689)
gh-133403: Check `Tools/build/verify_ensurepip_wheels.py` with mypy (GH-133453)
(cherry picked from commit 5f3d3f2a6c)

Co-authored-by: Flosckow <66554425+Flosckow@users.noreply.github.com>
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-08 18:20:13 +00:00
Miss Islington (bot)
0f7046b187
[3.14] gh-133583: Add support for fixed size unsigned integers in argument parsing (GH-133584) (GH-133650)
* Add Argument Clinic converters: uint8, uint16, uint32, uint64.
* Add private C API: _PyLong_UInt8_Converter(),
  _PyLong_UInt16_Converter(), _PyLong_UInt32_Converter(),
  _PyLong_UInt64_Converter().
(cherry picked from commit 4c914e7a36)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-08 09:54:44 +00:00
Miss Islington (bot)
e8c279f394
[3.14] gh-133403: Type Tools/build/update_file.py and check it with mypy (GH-133404) (#133603)
gh-133403: Type `Tools/build/update_file.py` and check it with `mypy` (GH-133404)
(cherry picked from commit 50b52cba2d)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Zachary Ware <zach@python.org>
2025-05-08 09:32:05 +03:00
Miss Islington (bot)
aadfc2cbc7
[3.14] gh-133555: Allow regenerating the parser with Python < 3.14 (GH-133557) (#133630)
gh-133555: Allow regenerating the parser with Python < 3.14 (GH-133557)
(cherry picked from commit b48599b801)

Co-authored-by: Alex Prengère <2138730+alexprengere@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 01:54:42 +00:00
Brandt Bucher
57c9810ba4
GH-113464: Add the JIT to What's New (GH-133486) 2025-05-05 20:06:41 -07:00
Adam Turner
e6f8e0a035
GH-132983: Build `_zstd` on Windows (#133366) 2025-05-06 00:58:47 +01:00
sobolevn
8467026ed6
Bump mypy to 1.15 (#133405) 2025-05-05 13:29:48 +03:00
Adam Turner
d530e74e44
GH-133410: Use commit hashes for change detection (gh-133416) 2025-05-05 10:49:12 +02:00
Adam Turner
3f80165a26
GH-91048: Minor fixes for `_remotedebugging & rename to _remote_debugging` (#133398) 2025-05-05 02:30:14 +02:00
Yan Yanchii
0a1fedb70b
gh-126835: Rename ast_opt.c to ast_preprocess.c and related stuff after moving const folding to the peephole optimizier (#131830) 2025-05-04 21:07:35 +03:00
Mark Shannon
ac7d5ba96e
GH-133231: Changes to executor management to support proposed sys._jit module (GH-133287)
* Track the current executor, not the previous one, on the thread-state. 

* Batch executors for deallocation to avoid having to constantly incref executors; this is an ad-hoc form of deferred reference counting.
2025-05-04 10:05:35 +01:00
Emma Smith
3b4333583f
gh-132983: Introduce _zstd bindings module (GH-133027)
* Add _zstd module for https://peps.python.org/pep-0784/

This commit introduces the `_zstd` module, with bindings to libzstd from
the pyzstd project. It also includes the unix build system configuration.
Windows build system support will be integrated independently as it
depends on integration with cpython-source-deps.

* Add _zstd to modules

* Fix path for compression.zstd module

* Ignore _zstd module like _io

* Expand module state macros to improve code quality

Also removes module state references from the classes in the _zstd
module and instead uses PyType_GetModuleState()

* Remove backticks suggested in review

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

* Use critical sections to lock object state

This should avoid races and deadlocks.

* Remove compress/decompress and mark module as not reliant on the GIL

The `compress`/`decompress` functions will be moved to Python code for simplicity.
C implementations can always be re-added in the future.

Also, mark _zstd as not requiring the GIL.

* Lift critical section to avoid clang warning

* Respond to comments by picnixz

* Call out pyzstd explicitly in license description

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Use a much more robust implementation...

... for `get_zstd_state_from_type`

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Use PyList_GetItemRef for thread safety purposes

* Use a macro for the minimum supported version

* remove const from primivite types

* Use PyMem_New in another spot

* Simplify error handling in _get_frame_size

* Another simplification of error handling in get_frame_info

* Rename _module_state to mod_state

* Rewrite comment explaining the context of the code

* Add link to pyzstd

* Add TODO about refactoring dict training code

* Use PyModule_AddObjectRef over PyModule_AddObject

PyModule_AddObject is soft-deprecated, so we should use PyModule_AddObjectRef

* Check result of OutputBufferGrow

* Simplify return logic in `add_constant_to_type`

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Ignore return value of _zstd_clear()

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Remove redundant comments

* Remove __reduce__ from ZstdDict

We should instead document that to pickle a dictionary a user should use
the `.dict_content` attribute.

* Use PyUnicode_FromFormat instead of a buffer

* Don't use C constants/types in error messages

* Make error messages easier to understand for Python users

* Lower minimum required version 1.4.0

* Use casts and make slot function signatures correct

* Be consistent with CPython on const usage

* Make else clauses in line with PEP 7

* Fix over-indented blocks in argument clinic

* Add critical section around ZSTD_DCtx_setParameter

* Add a TODO about refactoring critical sections

* Use Py_UNREACHABLE

* Move bytes operations out of Py_BEGIN_ALLOW_THREADS

* Add TODO about ensuring a lock is held

* Remove asserts that may not be correct

* Add TODO to make ZstdDict and others GC objects

* Make objects GC tracked

* Remove unused include

* Fix some memory issues

* Fix refleaks on module and in ZstdDict

* Update configure to check for ZDICT_finalizeDictionary

* Properly check version in configure

* exit(1) if check fails

* Use AC_RUN_IFELSE

* Use a define() to re-use version check

* Actually properly set _zstd module status based on version

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-04 01:29:55 +00:00
Pablo Galindo Salgado
2bc8365231
GH-91048: Add utils for printing the call stack for asyncio tasks (#133284) 2025-05-04 00:51:57 +00:00
Adam Turner
49ea8a0b2d
Lint: Use Ruff to format `Tools/build/check_warnings.py` (#133317) 2025-05-02 21:26:32 +01:00
Łukasz Langa
fac41f56d4
gh-131507: Add support for syntax highlighting in PyREPL (GH-133247)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-02 20:22:31 +02:00
Brandt Bucher
bfcbb28223
GH-113464: Get LLVM from cpython-bin-deps on Windows (GH-133278) 2025-05-02 11:17:15 -07:00
Michael Droettboom
c14134020f
gh-133259: Show path to python.sh script on successful build (#133268)
* gh-133259: Show path to python.sh script on successful build

* wasmtime -> (generic) wasm runtime
2025-05-01 18:49:39 +00:00