Commit graph

3782 commits

Author SHA1 Message Date
Miss Islington (bot)
034bb70aaa
[3.12] Bump ruff to 0.2.0 (GH-114932) (#114935)
Bump ruff to 0.2.0 (GH-114932)
(cherry picked from commit 920b89f627)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-02 22:03:25 +00:00
Miss Islington (bot)
d8825c2e76
[3.12] gh-65701: document that freeze doesn't work with framework builds on macOS (GH-113352) (#113362)
gh-65701: document that freeze doesn't work with framework builds on macOS (GH-113352)

* gh-65701: document that freeze doesn't work with framework builds on macOS

The framework install is inherently incompatible with freeze. Document
that that freeze doesn't work with framework builds and bail out
early when trying to run freeze anyway.

(cherry picked from commit df1eec3dae)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-12-22 11:16:30 +01:00
Victor Stinner
34d57d5871
[3.12] gh-106560: Fix redundant declarations in Python/frozen.c (#112612) (#112651)
gh-106560: Fix redundant declarations in Python/frozen.c (#112612)

Avoid duplicated declarations of "extern" functions in
Python/frozen.c.

Compiler warnings seen by building Python with gcc -Wredundant-decls.

(cherry picked from commit d9e444dbb8)
2023-12-03 11:54:59 +00:00
Alex Waygood
4fc010cda2
[3.12] Bump mypy to 1.7.1 (#112581) (#112601) 2023-12-01 17:10:38 +00:00
Eric Snow
4f71f1680d
[3.12] gh-106931: Intern Statically Allocated Strings Globally (gh-107272) (gh-110713)
We tried this before with a dict and for all interned strings.  That ran into problems due to interpreter isolation.  However, exclusively using a per-interpreter cache caused some inconsistency that can eliminate the benefit of interning.  Here we circle back to using a global cache, but only for statically allocated strings.  We also use a more-basic _Py_hashtable_t for that global cache instead of a dict.

Ideally we would only have the global cache, but the optional isolation of each interpreter's allocator means that a non-static string object must not outlive its interpreter.  Thus we would have to store a copy of each such interned string in the global cache, tied to the main interpreter.

(cherry-picked from commit b72947a8d2)
2023-11-27 23:51:12 +00:00
Miss Islington (bot)
8e37445044
[3.12] Remove imp_dummy_def from Tools/c-analyzer/cpython/ignored.tsv (gh-112122) (gh-112177)
It was removed in 3.12, no need to keep the ignore.
(cherry picked from commit 762eb58220)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-16 14:09:34 -07:00
Victor Stinner
a498433df2
[3.12] gh-112088: Run autoreconf in GHA check_generated_files (GH-112090) (#112159)
gh-112088: Run autoreconf in GHA check_generated_files (#112090)

The "Check if generated files are up to date" job of GitHub Actions
now runs the "autoreconf -ivf -Werror" command instead of the "make
regen-configure" command to avoid depending on the external quay.io
server.

Add Tools/build/regen-configure.sh script to regenerate the configure
with an Ubuntu container image. The
"quay.io/tiran/cpython_autoconf:271" container image
(https://github.com/tiran/cpython_autoconf) is no longer used.

(cherry picked from commit d9fd33a869)
2023-11-16 15:55:40 +01:00
Alex Waygood
7313bde84c
[3.12] Bump mypy to 1.7.0 (GH-111961) (#112033) 2023-11-13 13:59:56 +00:00
Artyom Romanov
3d67b69820
[3.12] Sync location of mypy pin with the main branch (#111317) 2023-10-25 12:54:05 +00:00
Artyom Romanov
5e94556f83
[3.12] Bump test deps: ruff and mypy (GH-111288) (#111313)
Bump test deps: `ruff` and `mypy`
2023-10-25 11:04:55 +00:00
Nikita Sobolev
c1e5343928
[3.12] Bump test deps: ruff and pre-commit-hooks (GH-110972) (#110980)
(cherry picked from commit b75b1f389f)
2023-10-17 13:01:57 +00:00
Miss Islington (bot)
c06ac1b4cc
[3.12] gh-109408: Revert pre-commit whitespace checks pending portable solution (GH-110726) (#110730)
gh-109408: Revert pre-commit whitespace checks pending portable solution (GH-110726)
(cherry picked from commit de956b263b)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-11 16:37:41 +00:00
Adam Turner
c9157feeec
[3.12] GH-109408: Move the C file whitespace check from patchcheck to pre-commit (GH-109890) (#110636)
(cherry picked from commit f5edb56328)
2023-10-10 15:00:00 +00:00
Miss Islington (bot)
948576574f
[3.12] GH-109408: Move the Python file whitespace check from patchcheck to pre-commit (GH-109891) (#110633)
GH-109408: Move the Python file whitespace check from patchcheck to pre-commit (GH-109891)
(cherry picked from commit 08ec4a1dbf)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-10 14:06:35 +00:00
Miss Islington (bot)
55d607683f
[3.12] gh-110558: Enable ruff's pyupgrade rules when running on Argument Clinic (GH-110603) (#110609)
gh-110558: Enable ruff's pyupgrade rules when running on Argument Clinic (GH-110603)
(cherry picked from commit fc811c8d20)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-10-10 12:35:21 +02:00
Alex Waygood
36886726a2
[3.12] gh-110558: Run ruff on Argument Clinic in CI (#110559) (#110598) 2023-10-10 08:58:56 +00:00
Miss Islington (bot)
0ffbde4e05
[3.12] gh-109408: Add the docs whitespace check from patchcheck to pre-commit (GH-109854) (#110594)
gh-109408: Add the docs whitespace check from patchcheck to pre-commit (GH-109854)
(cherry picked from commit 7426ed0347)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-10 08:39:55 +00:00
Miss Islington (bot)
eed92e4f7e
[3.12] gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451) (#110456)
gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451)

Fix test_tools.test_freeze on FreeBSD: run "make distclean" instead
of "make clean" in the copied source directory to remove also the
"python" program.

Other test_freeze changes:

* Log executed commands and directories, and the current directory.
* No longer uses make -C option to change the directory, instead use
  subprocess cwd parameter.
(cherry picked from commit a4baa9e8ac)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-06 01:31:30 +00:00
Victor Stinner
8939221e91
[3.12] gh-109615: Fix support test_copy_python_src_ignore() (#109958) (#110340)
* 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".

(cherry picked from commit b89ed9df39)

* gh-109615: Fix support test_copy_python_src_ignore() on WASM (#109970)

Not only check if src_dir exists, but look also for Lib/os.py
landmark.

(cherry picked from commit cc54bcf17b)

* gh-109615: Look for 'Modules' as landmark for test_copy_python_src_ignore (GH-110108)

(cherry picked from commit 20bc5f7c28)

* gh-109748: Fix again venv test_zippath_from_non_installed_posix() (#110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.

(cherry picked from commit 0def8c712b)

---------

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-10-04 10:27:12 +00:00
Miss Islington (bot)
196738fc86
[3.12] Code: Update Donghee Na's name (GH-109744) (#110225)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-02 17:31:34 +00:00
Victor Stinner
1fc25a389c
[3.12] gh-109615: Fix test_tools.test_freeze SRCDIR (#109935) (#109950)
gh-109615: Fix test_tools.test_freeze SRCDIR (#109935)

Fix copy_source_tree() function of test_tools.test_freeze:

* Don't copy SRC_DIR/build/ anymore. This directory is modified by
  other tests running in parallel.
* Add test.support.copy_python_src_ignore().
* Use sysconfig to get the source directory.
* Use sysconfig.get_config_var() to get CONFIG_ARGS variable.

(cherry picked from commit 1512d6c6ee)
2023-10-02 17:40:02 +02:00
Miss Islington (bot)
95fd4edc63
[3.12] gh-109098: Fuzz re module instead of internal sre (GH-109911) (#109932)
gh-109098: Fuzz re module instead of internal sre (GH-109911)

* gh-109098: Fuzz re module instead of internal sre
* Fix c-analyzer globals test failure
* Put globals exception in ignored.tsv
(cherry picked from commit a829356f86)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2023-10-02 17:39:07 +02:00
Pablo Galindo Salgado
f6cb2e4815
[3.12] gh-109596: Ensure repeated rules in the grammar are not allowed and fix incorrect soft keywords (GH-109606). (#109752)
(cherry picked from commit b28ffaa193)
2023-10-02 17:22:07 +02:00
Miss Islington (bot)
ef99f5e968
[3.12] gh-109991: Update GitHub CI workflows to use OpenSSL 3.0.11 and multissltests to use 1.1.1w, 3.0.11, and 3.1.3. (gh-110002) (#110005)
gh-109991: Update GitHub CI workflows to use OpenSSL 3.0.11 and multissltests to use 1.1.1w, 3.0.11, and 3.1.3. (gh-110002)
(cherry picked from commit c88037d137)

Co-authored-by: Ned Deily <nad@python.org>
2023-09-28 17:21:09 +02:00
Victor Stinner
de0202e937
[3.12] gh-108740: Fix "make regen-all" race condition (#108741) (#109019)
gh-108740: Fix "make regen-all" race condition (#108741)

Fix a race condition in "make regen-all". The deepfreeze.c source and
files generated by Argument Clinic are now generated or updated
before generating "global objects". Previously, some identifiers may
miss depending on the order in which these files were generated.

* "make regen-global-objects": Make sure that deepfreeze.c is
  generated and up to date, and always run "make clinic".
* "make clinic" no longer runs generate_global_objects.py script.
* "make regen-deepfreeze" now only updates deepfreeze.c (C file).
  It doesn't build deepfreeze.o (object) anymore.
* Remove misleading messages in "make regen-global-objects" and
  "make clinic". They are now outdated, these commands are now
  safe to use.
* Document generates files in Doc/using/configure.rst.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
(cherry picked from commit db1ee6a19a)
2023-09-08 15:19:20 +02:00
Miss Islington (bot)
db55cfcbab
[3.12] gh-109002: Ensure only one wheel for each vendored package (GH-109003) (#109005)
Output with one wheel:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
Verifying checksum for /Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl.
Expected digest: 7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
Actual digest:   7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
::notice file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Successfully verified the checksum of the pip wheel.
```

Output with two wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-22.0.4-py3-none-any.whl::Found more than one wheel for package pip.

::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Found more than one wheel for package pip.
```

Output without wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=::Could not find a pip wheel on disk.
```
(cherry picked from commit f8a047941f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-09-06 20:01:36 +02:00
Miss Islington (bot)
bce77915b6
[3.12] Disable differing_test_runners health check (GH-108886) (#108887)
Disable `differing_test_runners` health check (GH-108886)
(cherry picked from commit 6ead5bd6ae)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-04 21:11:16 +02:00
Miss Islington (bot)
149d70c254
[3.12] gh-108179: Add error message for parser stack overflows (GH-108256) (#108263)
gh-108179: Add error message for parser stack overflows (GH-108256)
(cherry picked from commit 86617518c4)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2023-08-22 12:02:32 +02:00
Miss Islington (bot)
359cff5c41
[3.12] gh-107565: Update multissltests and GitHub CI workflows to use OpenSSL 1.1.1v, 3.0.10, and 3.1.2. (GH-108118)
Co-authored-by: Ned Deily <nad@python.org>
2023-08-18 20:30:34 +00:00
Serhiy Storchaka
9864f9a7c7
[3.12] gh-86457: Fix signature for code.replace() (GH-23199) (#107744)
* [3.12] gh-86457: Fix signature for code.replace() (GH-23199)

Also add support of @text_signature in Argument Clinic..
(cherry picked from commit 0e6e32fb84)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

* Update 2023-08-07-16-30-48.gh-issue-95065.-im4R5.rst
2023-08-16 14:27:32 +02:00
Miss Islington (bot)
98dd9d9725
[3.12] gh-91054: make code watcher tests resilient to other watchers (GH-107821) (#107835)
gh-91054: make code watcher tests resilient to other watchers (GH-107821)
(cherry picked from commit 2ec16fed14)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-08-11 16:13:14 +02:00
Miss Islington (bot)
585b4cc3bd
[3.12] Fix the long64 reader in umarshal.py (GH-107828) (#107849)
Fix the long64 reader in umarshal.py (GH-107828)
(cherry picked from commit 50bbc56009)

Co-authored-by: Martin DeMello <martindemello@gmail.com>
2023-08-11 11:59:45 +02:00
Charlie Zhao
99518bbbf4
[3.12] gh-106263: Fix segfault in signaldict_repr in _decimal module (#… (#107491)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>

(cherry picked from commit 3979150a0d)
2023-07-31 14:34:16 +02:00
Miss Islington (bot)
b4355de947
[3.12] gh-104629: Build _testclinic extension module on Windows (GH-104723) (#107393)
(cherry picked from commit 3a1d819ebc)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-28 20:57:26 +00:00
Miss Islington (bot)
57ef065eb3
[3.12] gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258) (gh-107303)
The _xxsubinterpreters module was meant to only use public API.  Some internal C-API usage snuck in over the last few years (e.g. gh-28969).  This fixes that.
(cherry picked from commit e6373c0d8b)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-27 13:15:47 -06:00
Miss Islington (bot)
5f3e371e2d
[3.12] Docs: Argument Clinic: Restructure "Basic concepts and usage" (GH-106981) (#107325)
Split "Basic concepts and usage" into:

- Reference
  - Terminology
  - CLI reference

- Background
  - Basic concepts

(cherry picked from commit 2ad699002e)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-27 09:07:55 +02:00
Miss Islington (bot)
67748f18c9
[3.12] gh-106970: Fix Argument Clinic 'destination <name> clear' command (GH-106972) (#106983)
Add test for the 'destination <name> clear' command,
and the 'destination' directive in general.

Fix two bugs in 'destination <name> clear' command:

1. The text attribute of the allocator is called 'text', not '_text'
2. Return after processing the 'clear' command,
   instead of proceeding directly to the fail().
(cherry picked from commit 3372bcba98)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-22 11:06:46 +02:00
Miss Islington (bot)
e903c16a6c
[3.12] gh-101538: Add experimental wasi-threads build (GH-101537) (#106834)
(cherry picked from commit d8f87cdf94)

Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-07-18 00:31:17 +02:00
Miss Islington (bot)
f0df92a9ce
wasm: do not use inline comment in .editorconfig (GH-106610)
It is no longer valid since 0.15.0
https://github.com/editorconfig/specification/blob/v0.15/index.rstGH-no-inline-comments
(cherry picked from commit 64c0890b69)

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2023-07-16 16:10:39 +09:00
Miss Islington (bot)
af06a8ad4d
[3.12] gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213) (#106667)
gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213)

Fetch CONFIG_ARGS from the original source directory, instead of from
the copied source tree. When "make clean" is executed in the copied
source tree, the build directory is cleared and the configure argument
lookup fails. However, the original source directory still contains this
information.
(cherry picked from commit de827322ca)

Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
2023-07-12 07:32:51 +00:00
Erlend E. Aasland
b72601e7e5
[3.12] gh-64595: Fix regression in file write logic in Argument Clinic (#106449) (#106452)
Revert the two commits that introduced the regressions:

 - gh-104152
 - gh-104507

(cherry picked from commit 9d1d4f9c73)
2023-07-05 13:17:09 +00:00
Miss Islington (bot)
637102980d
[3.12] gh-100238: Use setuptools in peg-generator and reenable tests (GH-104798) (#105135)
(cherry picked from commit afa759fb80)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-07-05 11:42:47 +02:00
Miss Islington (bot)
fda297031b
[3.12] gh-106368: Add tests for permutation helpers in Argument Clinic (GH-106407) (#106409)
Added new test class PermutationTests()
(cherry picked from commit 8f6df5e9cb)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-04 14:17:05 +02:00
Miss Islington (bot)
5f20152f01
[3.12] gh-106359: Fix corner case bugs in Argument Clinic converter parser (GH-106361) (#106364)
gh-106359: Fix corner case bugs in Argument Clinic converter parser (GH-106361)

DSLParser.parse_converter() could return unusable kwdicts in some rare cases

(cherry picked from commit 0da4c883cf)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-03 13:42:20 +00:00
Miss Islington (bot)
0373c2ccd5
[3.12] Fix c-analyzer for GCC: ignore LANG env var (GH-106173) (#106178)
Fix c-analyzer for GCC: ignore LANG env var (GH-106173)

The c-analyzer doesn't support GCC localized messages, so just unset
the LANG environment variable.
(cherry picked from commit 1f74b9e933)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-06-28 03:41:36 +00:00
Miss Islington (bot)
bc997b38b6
[3.12] gh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740) (gh-105765)
This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time.  To solve this we add a thread-local variable for the value.  We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables.
(cherry picked from commit b87d288275)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-06-14 01:34:26 +00:00
Eric Snow
33d3069c45
[3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752)
For a while now, pending calls only run in the main thread (in the main interpreter).  This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
(cherry picked from commit 757b402)
2023-06-14 00:50:08 +00:00
Miss Islington (bot)
51b533ec50
[3.12] gh-98040: Fix importbench: use types.ModuleType() (GH-105743) (#105754)
gh-98040: Fix importbench: use types.ModuleType() (GH-105743)

Replace removed imp.new_module(name) with types.ModuleType(name).
(cherry picked from commit 457a459c78)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-06-13 22:59:02 +00:00
Victor Stinner
82ab13c49a
[3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) (#105371)
* gh-102304: doc: Add links to Stable ABI and Limited C API (#105345)

* Add "limited-c-api" and "stable-api" references.
* Rename "stable-abi-list" reference to "limited-api-list".
* Makefile: Document files regenerated by "make regen-limited-abi"
* Remove first empty line in generated files:

  - Lib/test/test_stable_abi_ctypes.py
  - PC/python3dll.c

(cherry picked from commit bae415ad02)

* gh-102304: Fix up Simple ABI doc (GH-105351)

(cherry picked from commit 0202aa002e)
2023-06-06 13:11:28 +00:00
Miss Islington (bot)
d57ee813eb
[3.12] gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122) (gh-105211)
When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary).  That led to problems for third-party static types.

We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.
(cherry picked from commit 1469393)

Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
2023-06-01 23:06:38 +00:00