110 Commits
Author SHA1 Message Date
Russell Keith-Magee ef08833eec gh-131999: Add support for tvOS, visionOS and watchOS. (#159944)
Add support for tvOS, visionOS and watchOS. This is mostly configuration
updates and testbed projects to support deploying to the new platforms.

Also includes a mimalloc change to support arm64_32 that has been contributed 
upstream.
2026-10-23 08:36:57 -07:00
Petr Viktorin eb77b4b2e4 Add os.supports_dir_fd to test.pythoninfo (GH-158605)
Split the attribute lists so the 'supports_*' names don't need
to be repeated twice.

Add 'supports_dir_fd'.
2026-10-08 15:45:24 +02:00
Serhiy StorchakaandClaude Opus 5 dc0b1f8dfb gh-157475: Add structured version info for decimal (GH-157476)
Add constants decimal.LIBMPDEC_VERSION, decimal.libmpdec_version,
decimal.LIBMPDEC_VERSION_INFO, and decimal.libmpdec_version_info in
the C implementation, which provide information about the version of
the libmpdec library in use.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 13:40:33 +00:00
Serhiy StorchakaandClaude Opus 5 89bfac6d43 gh-157480: Add structured version info for dbm.ndbm (GH-157484)
Add constants which provide information about the version of the
underlying library in use: GDBM_VERSION_INFO, gdbm_version_info and
gdbm_version if it is GDBM, or BDB_VERSION, bdb_version,
BDB_VERSION_INFO and bdb_version_info if it is Berkeley DB.

dbm.ndbm.library is now 'ndbm' instead of 'GNU gdbm' for a classic
NDBM library.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 13:20:28 +00:00
Serhiy StorchakaandClaude Opus 5 4a5a7b9f6d gh-157514: Add structured version info for tkinter (GH-157516)
Add constants tkinter.TCL_VERSION_INFO and tkinter.TK_VERSION_INFO,
named tuples with the versions of the Tcl and Tk libraries that were
used for building the module, and _tkinter.TCL_PATCH_LEVEL and
_tkinter.TK_PATCH_LEVEL strings.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 15:55:12 +03:00
Serhiy StorchakaandClaude Opus 5 cbecd5edd9 gh-157473: Add structured version info for pyexpat (GH-157474)
Add constant pyexpat.VERSION_INFO which provides information about the
version of the Expat library that was used for building the module.

Make pyexpat.version_info a named tuple.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 15:54:09 +03:00
Serhiy StorchakaandClaude Opus 5 3b0c39cb8b gh-157513: Add structured version info for ssl (GH-157515)
ssl.OPENSSL_VERSION_INFO is now a named tuple.

Add ssl.OPENSSL_API_VERSION_INFO which provides information about the
version of the OpenSSL library that was used for building the module.
The private name _OPENSSL_API_VERSION is kept as an alias.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 15:53:11 +03:00
Serhiy StorchakaandClaude Opus 5 5d1ab456ba gh-157470: Add structured version info for sqlite3 (GH-157471)
Add constants sqlite3.SQLITE_VERSION and sqlite3.SQLITE_VERSION_INFO
which provide information about the version of the SQLite library that
was used for building the module.

Make sqlite3.sqlite_version_info a named tuple.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 15:48:39 +03:00
Serhiy StorchakaandClaude Opus 5 8b34557537 gh-157485: Add structured version info for readline (GH-157486)
Add constants readline.READLINE_VERSION_INFO,
readline.readline_version_info and readline.readline_version, which
provide information about the version of the Readline library in use.

The private names _READLINE_VERSION, _READLINE_RUNTIME_VERSION and
_READLINE_LIBRARY_VERSION are kept for backward compatibility.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 15:46:51 +03:00
Serhiy StorchakaandClaude Opus 5 0f5abe6d8d gh-157478: Add structured version info for dbm.gnu (GH-157479)
Add constants dbm.gnu.GDBM_VERSION_INFO, dbm.gnu.gdbm_version_info and
dbm.gnu.gdbm_version, which provide information about the version of
the GDBM library in use.

The private constant _gdbm._GDBM_VERSION has been removed.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-29 15:43:01 +03:00
Victor Stinner b71989d657 gh-157649: Merge test_cppext into test_cext (#158176)
* test_cext now uses a single virtual environment for all tests.
  It makes the test way faster since creating a virtual environment
  is quite slow.
* Add Py_TARGET_ABI3T test on C++.
* Move macro tests from module exec function to test_macros().
* Call Py_BEGIN_CRITICAL_SECTION() on a fresh dictionary object,
  rather than on the module.
* Rename some environment variables to always use "CPYTHON_TEST_"
  prefix.
* Replace support.MS_WINDOWS with MSVC to be more explicit.
* Move macro tests to test_macros().
* On macOS, use C++11 by default.
2026-09-25 22:31:44 +00:00
Serhiy StorchakaandClaude Opus 5 da72cc70ca gh-157487: Add structured version info for ctypes (GH-157488)
Add constants ctypes.LIBFFI_VERSION, ctypes.libffi_version,
ctypes.LIBFFI_VERSION_INFO and ctypes.libffi_version_info, which
provide information about the version of the libffi library in use.
They are only available with libffi 3.5 or later.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 18:06:36 +03:00
Serhiy StorchakaandClaude Opus 5 a844747b07 gh-117404: Add structured version info for compression modules (GH-150567)
Add constants which provide information about the version of the
compression library used for building the module and the version
actually loaded:

* zlib: ZLIB_VERSION_INFO, zlib_version_info, ZLIBNG_VERSION_INFO,
  and zlib_version as an alias of ZLIB_RUNTIME_VERSION
* bz2: bzlib_version, bzlib_version_info
* lzma: LZMA_VERSION, lzma_version, LZMA_VERSION_INFO, lzma_version_info
* compression.zstd: ZSTD_VERSION, ZSTD_VERSION_INFO

Make compression.zstd.zstd_version_info a named tuple.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 10:39:11 +03:00
Victor StinnerandStan Ulbrych c700121b15 gh-155742: Add support.built_with_c_assertions() (#156776)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-09-02 11:27:22 +00:00
7961bbf2bb gh-122931: Allow stable abi3 API extensions to include a multiarch tuple in the filename (GH-152461)
This permits stable ABI extensions for multiple architectures to be
co-installed into the same directory, without clashing with each other,
the same way (non-stable ABI) regular extensions can.

It is listed before the current platform-less suffixes since it's more
specific.

The platform is stored in a new pyconfig.h define & sysconfig
variable, SOABI_PLATFORM.
On some known architectures (FreeBSD, Windows), this
will be undefined/zero; these won't have the new tag (yet).

Add SOABI_PLATFORM & ALT_SOABI the info to
`make pythoninfo` as well.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-07-27 15:05:40 +02:00
Victor Stinner 249d5e0a10 gh-153903: Use @ctypes.util.wrap_dll_function() (#154122) 2026-07-19 15:12:07 +00:00
Victor Stinner 4e4869b62f gh-152680: Detect virtualization on Windows in pythoninfo (#152824)
Use WMI to detect virtualization on Windows.

Replace wmic command with _wmi module to get the operating system caption and
version.

The wmic tool is deprecated since January 2024:
https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242

For example, it's no longer installed in Windows images on GitHub
Action.

Fix also run_command(): no longer try to spawn a subprocess if the
platform doesn't support subprocess. It avoids logging run_command()
errors.
2026-07-02 15:00:51 +02:00
Victor Stinner f1c5363721 gh-152680: Detect container/VM in test.pythoninfo (#152668)
On Apple, log the hardware model as "system.hardware".

* Log the "CI", "IMAGE_OS_VERSION" and "container"
  environment variables.
* Add run_command() and first_line() functions.
2026-06-30 15:11:57 +00:00
Victor Stinner b6d89edc4a gh-151929: Get uptime on BSD/macOS in pythoninfo (#152189)
* Check sysctlbyname() function and sys/sysctl.h header in
  configure.
* Add _testcapi.uptime_bsd() function.
2026-06-25 13:11:17 +00:00
Victor Stinner f9910519af gh-151929: Get machine ID and uptime on Windows in pythoninfo (#152146)
* Replace "linux." prefix with "system." in pythoninfo.
* Add _winapi.GetTickCount64() function.
2026-06-25 12:02:53 +00:00
Victor Stinner 3db3bba4d1 gh-151929: Get boot ID, machine ID and uptime in test.pythoninfo (#152127)
GHA: Run test.pythoninfo on the "Cross build Linux" job.
2026-06-24 23:30:51 +00:00
Victor Stinner b5a27bdcf0 gh-146410: Add --pythoninfo option to regrtest (#146413)
* Android now runs tests with --pythoninfo to dump build information.
* Add display_title() function.
2026-03-26 10:56:38 +01:00
Victor Stinner 6c8c72f7fe gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (#145589)
Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
2026-03-06 16:51:36 +01:00
Filipe Laíns f739e2ca62 Add sysconfig[VPATH] to test.pythoninfo (#145434) 2026-03-02 20:48:07 +00:00
4e45c9c309 gh-136677: Introduce executable specific linker flags to configure (#137296)
* introduce executable specific linker flags

Add PY_CORE_EXE_LDFLAGS and EXE_LDFLAGS which stores executable specific
LDFLAGS, replacing PY_CORE_LDFLAGS for building
executable targets.

If PY_CORE_EXE_LDFLAGS / EXE_LDFLAGS is not provided, then it defaults
to the value of PY_CORE_LDFLAGS which is the existing behaviour.

If both flags are supplied, and there is a need
to distinguish between executable and shared specific LDFLAGS,
in particular, PY_CORE_LDFLAGS should contain the shared specific LDFLAGS.

* documentation for new linker flags

* update Misc folder documentation

* Update Makefile.pre.in

Co-authored-by: Victor Stinner <vstinner@python.org>

---------

Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Filipe Laíns <lains@riseup.net>
2026-02-24 22:52:02 +00:00
Victor Stinner 376559bf54 gh-140702: Log color and GHA env vars in test.pythoninfo (#140747) 2025-10-29 13:29:10 +01:00
AniandBrett Cannon aafb1435d8 Use test.support.is_wasm32 flag for is_emscripten or is_wasi for generic checks (GH-136815)
Co-authored-by: Brett Cannon <brett@python.org>
2025-07-22 12:50:13 -07:00
Victor Stinner d9ec0ee733 gh-133711: Log Windows OEM code page in test.pythoninfo (#134840)
Add _winapi.GetOEMCP() function.
2025-05-28 17:41:11 +02:00
Stan UlbrychandVictor Stinner 46d7c114d8 gh-132983: Add zstd version info to test.pythoninfo (#134230)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-20 00:06:04 +02:00
Victor Stinner f0485de43a gh-132950: Log is_remote_debug_enabled() in pythoninfo (#132965)
Log also the Py_REMOTE_DEBUG macro.
2025-04-25 18:13:47 +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
Mark Shannon 014223649c GH-130396: Use computed stack limits on linux (GH-130398)
* Implement C recursion protection with limit pointers for Linux, MacOS and Windows

* Remove calls to PyOS_CheckStack

* Add stack protection to parser

* Make tests more robust to low stacks

* Improve error messages for stack overflow
2025-02-25 09:24:48 +00:00
Petr Viktorin ef29104f7d GH-91079: Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now (GH130413)
Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now

Unfortunatlely, the change broke some buildbots.

This reverts commit 2498c22fa0.
2025-02-24 11:16:08 +01:00
Mark Shannon 2498c22fa0 GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)
* Implement C recursion protection with limit pointers

* Remove calls to PyOS_CheckStack

* Add stack protection to parser

* Make tests more robust to low stacks

* Improve error messages for stack overflow
2025-02-19 11:44:57 +00:00
Vincent FazioandErlend E. Aasland aecbc2e6f4 gh-115382: Fix cross compiles when host and target use same SOABI
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-10-16 23:01:42 +01:00
Donghee Na ad7c778546 gh-123990: Good bye WITH_FREELISTS macro (gh-124358) 2024-09-24 01:28:59 +00:00
Victor Stinner 74072a3ffc gh-119132: Log sys._is_gil_enabled() in test.pythoninfo (#119140) 2024-05-18 09:24:22 -04:00
Victor Stinner 64cd6fc9a6 gh-117889: Fix PGO test in test_peg_generator (#117893)
Reuse support.check_cflags_pgo() in test_peg_generator to check for
PGO build.

Log PGO_PROF_USE_FLAG in test.pythoninfo.
2024-04-15 13:59:34 +00:00
Erlend E. Aasland 6c8ac8a32f gh-116303: Handle disabled test modules in test.support helpers (#116482)
Make sure test.support helpers skip iso. failing if test extension
modules are disabled. Also log TEST_MODULES in test.pythoninfo.
2024-03-28 08:40:37 +00:00
f006338017 gh-114099: Additions to standard library to support iOS (GH-117052)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Ned Deily <nad@python.org>
2024-03-28 03:59:33 -04:00
Malcolm Smith 74c8568d07 gh-71042: Add platform.android_ver (#116674) 2024-03-27 17:53:27 +01:00
Victor Stinner c77f552ec0 gh-114107: test.pythoninfo logs Windows Developer Mode (#114121)
Also, don't skip the whole collect_windows() if ctypes is missing.

Log also ctypes.windll.shell32.IsUserAnAdmin().
2024-01-16 17:23:46 +01:00
Serhiy Storchaka 53330f1677 gh-113440: Ignore the "ver" command failure with exit code 0xc0000142 (GH-113435) 2023-12-24 12:31:23 +02:00
Hugo van Kemenade 3b3ec0d77f gh-111863: Rename Py_NOGIL to Py_GIL_DISABLED (#111864)
Rename Py_NOGIL to Py_GIL_DISABLED
2023-11-20 15:52:00 +02:00
05f2f0ac92 gh-90815: Add mimalloc memory allocator (#109914)
* Add mimalloc v2.12

Modified src/alloc.c to remove include of alloc-override.c and not
compile new handler.

Did not include the following files:

 - include/mimalloc-new-delete.h
 - include/mimalloc-override.h
 - src/alloc-override-osx.c
 - src/alloc-override.c
 - src/static.c
 - src/region.c

mimalloc is thread safe and shares a single heap across all runtimes,
therefore finalization and getting global allocated blocks across all
runtimes is different.

* mimalloc: minimal changes for use in Python:

 - remove debug spam for freeing large allocations
 - use same bytes (0xDD) for freed allocations in CPython and mimalloc
   This is important for the test_capi debug memory tests

* Don't export mimalloc symbol in libpython.
* Enable mimalloc as Python allocator option.
* Add mimalloc MIT license.
* Log mimalloc in Lib/test/pythoninfo.py.
* Document new mimalloc support.
* Use macro defs for exports as done in:
  https://github.com/python/cpython/pull/31164/

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-30 15:43:11 +00:00
Victor Stinner e0c4437793 Add support.MS_WINDOWS constant (#110446) 2023-10-06 02:37:28 +02:00
Victor Stinner a46e960768 gh-109649: Use os.process_cpu_count() (#110165)
Replace os.cpu_count() with os.process_cpu_count() in modules:

* compileall
* concurrent.futures
* multiprocessing

Replace os.cpu_count() with os.process_cpu_count() in programs:

* _decimal deccheck.py test
* freeze.py
* multissltests.py
* python -m test (regrtest)
* wasm_build.py

Other changes:

* test.pythoninfo logs os.process_cpu_count().
* regrtest gets os.process_cpu_count() / os.cpu_count() in headers.
2023-10-01 03:14:57 +02:00
Victor Stinner b89ed9df39 gh-109615: Fix support test_copy_python_src_ignore() (#109958)
Fix the test when run on an installed Python: use "abs_srcdir" of
sysconfig, and skip the test if the Python source code cannot be
found.

* Tools/patchcheck/patchcheck.py, Tools/freeze/test/freeze.py and
  Lib/test/libregrtest/utils.py now first try to get "abs_srcdir"
  from sysconfig, before getting "srcdir" from sysconfig.
* test.pythoninfo logs sysconfig "abs_srcdir".
2023-09-27 12:32:12 +02:00
Victor Stinner 81cd1bd713 gh-103053: Skip test_freeze_simple_script() on PGO build (#109591)
Skip test_freeze_simple_script() of test_tools.test_freeze if Python
is built with "./configure --enable-optimizations", which means with
Profile Guided Optimization (PGO): it just makes the test too slow.
The freeze tool is tested by many other CIs with other (faster)
compiler flags.

test.pythoninfo now gets also get_build_info() of
test.libregrtests.utils.
2023-09-20 01:58:34 +00:00
Victor Stinner 715f663258 gh-109276: libregrtest: WASM use stdout for JSON (#109355)
On Emscripten and WASI, or if --python command line is used,
libregrtest now writes JSON into stdout, instead of using a name
file.

* Add JsonFileType.STDOUT.
* Remove JsonFileType.FILENAME.
* test.pythoninfo logs environment variables related to
  cross-compilation and running Python on Emscripten/WASI.
2023-09-13 02:24:43 +02:00