Commit Graph

1686 Commits

Author SHA1 Message Date
Adam Turner e6f8e0a035
GH-132983: Build ``_zstd`` on Windows (#133366) 2025-05-06 00:58:47 +01:00
Adam Turner 3f80165a26
GH-91048: Minor fixes for ``_remotedebugging`` & rename to ``_remote_debugging`` (#133398) 2025-05-05 02:30:14 +02:00
Adam Turner 40be123499
Regenerate pcbuild.sln in Visual Studio 2022 (#133394)
* Regenerate pcbuild.sln in Visual Studio 2022
* Move _remotedebugging to the end
2025-05-04 21:10:19 +01: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
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
Brandt Bucher bfcbb28223
GH-113464: Get LLVM from cpython-bin-deps on Windows (GH-133278) 2025-05-02 11:17:15 -07:00
Brandt Bucher 2da48e32f6
GH-133171: Prevent combinations of --disable-gil and --enable-experimental-jit... for now (GH-133179) 2025-05-02 09:26:03 -07:00
Lysandros Nikolaou 60202609a2
gh-132661: Implement PEP 750 (#132662)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wingy <git@wingysam.xyz>
Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Paul Everitt <pauleveritt@me.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-30 11:46:41 +02:00
Wulian233 995b1a72f2
Fixed a typo in the `PCbuild/readme.txt` about PGO clang-cl (#133083)
Fixed a typo in the readme.txt section about PGO clang-cl
2025-04-28 13:39:16 +00:00
Pablo Galindo Salgado e8cf3a1a64
gh-91048: Refactor _testexternalinspection and add Windows support (#132852) 2025-04-25 14:12:16 +01:00
Sergey B Kirpichev 79f7c67bf6
gh-128813: hide mixed-mode functions for complex arithmetic from C-API (#131703) 2025-04-22 14:18:18 +02:00
Chris Eibl e5f68fd29b
GH-131296: Suppress "unused label" warning for clang-cl closer to actual occurrence (GH-131900) 2025-04-10 23:17:33 +01:00
Neil Schemenauer d687900f98
gh-128384: Use a context variable for warnings.catch_warnings (gh-130010)
Make `warnings.catch_warnings()` use a context variable for holding
the warning filtering state if the `sys.flags.context_aware_warnings`
flag is set to true.  This makes using the context manager thread-safe in
multi-threaded programs.

Add the `sys.flags.thread_inherit_context` flag.  If true, starting a new
thread with `threading.Thread` will use a copy of the context
from the caller of `Thread.start()`.

Both these flags are set to true by default for the free-threaded build
and false for the default build.

Move the Python implementation of warnings.py into _py_warnings.py.

Make _contextvars a builtin module.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-04-09 16:18:54 -07:00
Adam Turner 231a50fa9a
gh-109599: Expose `CapsuleType` via the `_types` module (#131969) 2025-04-04 23:37:41 +01:00
Bénédikt Tran 0a97427ee5
gh-99108: Implement HACL* HMAC (#130157)
A new extension module, `_hmac`, now exposes the HACL* HMAC (formally verified) implementation.

The HACL* implementation is used as a fallback implementation when the OpenSSL implementation of HMAC
is not available or disabled. For now, only named hash algorithms are recognized and SIMD support provided
by HACL* for the BLAKE2 hash functions is not yet used.
2025-04-04 19:04:00 +02:00
Steve Dower 24decb05dd
gh-131423: Update OpenSSL build tag to 3.0.16.2 to fix ARM64 crash (GH-132051) 2025-04-03 17:35:21 +01:00
Pablo Galindo Salgado 943cc1431e
gh-131591: Implement PEP 768 (#131937)
Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
2025-04-03 16:20:01 +01:00
Erlend E. Aasland 45a3ab5a81
gh-129917: Update installers to use SQLite 3.49.1 (#131025)
Co-authored-by: Ned Deily <nad@python.org>
2025-03-31 23:13:17 +02:00
Chris Eibl 4940d96135
GH-131296: Fix clang-cl warnings on Windows in sqlite3 (GH-131906) 2025-03-31 16:15:31 +01:00
Chris Eibl cf839c3373
GH-131296: Fix clang-cl warning on Windows in liblzma (GH-131897)
Also removes warnings suppression for MSVC that no longer need to be suppressed.
2025-03-31 15:50:44 +01:00
Steve Dower d260631be0
gh-131423: Update to OpenSSL 3.0.16. (GH-131839)
The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804.
This PR also prevents making calls that are now unsafe without uplink, and updates
the tests to property interpret these failures as unsupported.
2025-03-28 15:07:57 +00:00
Chris Eibl 488174dc68
GH-131691: Fix exception handling setting for clang-cl on Windows (GH-131730)
The /EHa option for Clang-CL behaves differently than the same option for MSVC, which is why we don't use it for both compilers.
2025-03-25 23:07:52 +00:00
Chris Eibl c3b8d73208
GH-131473: Override PreferredToolArchitecture when using Visual Studio bundled clang-cl (GH-131689)
tweak PreferredToolArchitecture for bundled clang-cl
2025-03-24 23:15:51 +00:00
Chris Eibl d16f455cd8
GH-131521: Uses correct build flags for zlib-ng on Windows (GH-131526)
Do not enable AdvancedVectorExtensions2 for all *.c files, so that the resulting binary can be executed on older CPUs, too. Also enable AdvancedVectorExtensions512 where necessary, and add the ClangCL flags required to enable vector extensions.
2025-03-24 16:21:57 +00:00
Victor Stinner 7101cba6bf
gh-131238: Move _Py_VISIT_STACKREF() to pycore_stackref.h (#131560)
* Move _Py_VISIT_STACKREF() from pycore_gc.h to pycore_stackref.h.
* Remove pycore_interpframe.h include from pycore_genobject.h.
* Remove now useless includes from C files.
* Add pycore_interpframe_structs.h to Makefile.pre.in and
  pythoncore.vcxproj.
2025-03-21 23:24:14 +01:00
Victor Stinner 3a09986553
gh-131238: Add pycore_interpframe.h to PYTHON_HEADERS (#131545)
Add pycore_interpframe.h to Makefile.pre.in and pythoncore.vcxproj.
2025-03-21 16:24:15 +01:00
Chris Eibl 54efe296bc
GH-131473: Add missing %(AdditionalOptions) reference to pythoncore.vcxproj (GH-131475) 2025-03-19 19:50:04 +00:00
Steve Dower 63a638c43f
gh-91349: Replace zlib with zlib-ng in Windows build (GH-131438) 2025-03-19 19:03:25 +00:00
Victor Stinner 4b54031323
gh-131238: Remove pycore_runtime.h from pycore_pystate.h (#131356)
* Remove includes from pycore_pystate.h:

  * pycore_runtime_structs.h
  * pycore_runtime.h
  * pycore_tstate.h
  * pycore_interp.h

* Reorganize internal headers. Move _gc_thread_state from
  pycore_interp_structs.h to pycore_tstate.h.
* Add 3 new header files to PCbuild/pythoncore.vcxproj.
2025-03-19 17:33:24 +01:00
Victor Stinner b8367e7cf3
gh-130931: Add pycore_typedefs.h internal header (#131396)
Declare _PyInterpreterFrame and _PyRuntimeState types before
declaring their structure members. Break reference cycles between
header files.
2025-03-19 15:23:32 +01:00
Chris Eibl 468a7aaeb4
GH-131278: Add option to build with computed gotos on Windows with clang-cl (GH-131279) 2025-03-17 20:32:23 +00:00
Mark Shannon a45f25361d
GH-131238: More refactoring of core header files (GH-131351)
Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
2025-03-17 14:41:05 +00:00
Chris Eibl 0ce056d265
gh-130213: update hacl_star_rev to 322f6d58290e0ed7f4ecb84fcce12917aa0f594b (GH-130960)
Updates the HACL* implementation used by hashlib from upstream sources.
2025-03-15 10:42:27 -07:00
Ken Jin a8ee1e16f5
gh-130039: Tailcall for windows builds (GH-130040)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-11 10:52:56 +08:00
Chris Eibl 91d6db7ee0
GH-131035: Use -flto=thin for clang-cl on Windows (GH-131036) 2025-03-10 16:47:45 +00:00
Burkov Egor 2904ec2273
gh-130878: Add extra check to prepare_ssl.py (GH-130879) 2025-03-05 17:08:30 +00:00
Chris Eibl d8a1cf469e
gh-130090: Support PGO for clang-cl on Windows (GH-129907) 2025-03-04 19:29:03 +00:00
Chris Eibl 3a555f09f3
gh-130419: Do not build the _freeze_module project twice in Windows PGO builds (GH-130420) 2025-02-24 21:35:00 +00:00
Julian Waters c26bed1160
gh-128345: properly disable gil for `_freeze_module.vcxproj` (#128344) 2025-02-15 14:05:54 +00:00
Ken Jin 247b50dec8
gh-130004: Revert commit 9e52e55 (GH-130005)
Revert commit 9e52e55
2025-02-11 23:23:58 +08:00
Victor Stinner 60a85415ae
gh-93649: Add Modules/_testcapi/function.c file (#129521)
* Move PyFunction C API tests to a new file.
* Add Lib/test/test_capi/test_function.py.
* Move tests from test_capi.test_misc to test_capi.test_function.
2025-01-31 16:02:50 +01:00
Victor Stinner 5424e3b034
gh-93649: Add Modules/_testcapi/type.c file (#129516)
Move PyType C API tests to a new file.

Move following tests from test_capi.test_misc to test_capi.test_type:

* BuiltinStaticTypesTests
* test_get_type_name()
* test_get_base_by_token()
2025-01-31 15:03:54 +01:00
Victor Stinner 8b70ff5872
gh-93649: Move PyFrame C API tests to test_capi (#129512)
* Add Lib/test/test_capi/test_frame.py file.
* Move C API tests from test_frame to test_capi.test_frame.
* Add Modules/_testcapi/frame.c file.
* Move C API tests from _testcapimodule.c to frame.c
2025-01-31 13:51:58 +01:00
Victor Stinner 4ca9fc08f8
gh-111495: Add PyFile tests (#129449)
Add tests for the following functions in test_capi.test_file:

* PyFile_FromFd()
* PyFile_GetLine()
* PyFile_NewStdPrinter()
* PyFile_WriteObject()
* PyFile_WriteString()
* PyObject_AsFileDescriptor()

Add Modules/_testlimitedcapi/file.c file.

Remove test_embed.StdPrinterTests which became redundant.
2025-01-30 18:05:32 +01:00
Victor Stinner 3bebe46d34
gh-128911: Add PyImport_ImportModuleAttr() function (#128912)
Add PyImport_ImportModuleAttr() and
PyImport_ImportModuleAttrString() functions.

* Add unit tests.
* Replace _PyImport_GetModuleAttr()
  with PyImport_ImportModuleAttr().
* Replace _PyImport_GetModuleAttrString()
  with PyImport_ImportModuleAttrString().
* Remove "pycore_import.h" includes, no longer needed.
2025-01-30 11:17:29 +00:00
Michael Droettboom 9e52e553f4
gh-129244: Remove workaround for MSVC compiler crash (#129263)
* Remove compiler workaround

* Remote _Py_USING_PGO
2025-01-25 07:56:13 -05:00
Victor Stinner d95ba9fa11
gh-128911: Add tests on the PyImport C API (#128915)
* Add Modules/_testlimitedcapi/import.c
* Add Lib/test/test_capi/test_import.py
* Remove _testcapi.check_pyimport_addmodule(): tests already covered
  by newly added tests.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-01-17 17:52:18 +00:00
Petr Viktorin 1439b81928
gh-128629: Add Py_PACK_VERSION and Py_PACK_FULL_VERSION (GH-128630) 2025-01-09 11:10:28 +01:00
Pieter Eendebak b9b3e4a076
gh-127951: Add build option to enable pystats on Windows (GH-127952) 2024-12-19 14:45:34 +00:00
Sergey Muraviov 6da9d252ac
gh-127285: Update PCbuild files for a number of missed changes (GH-127286) 2024-11-26 16:39:33 +00:00