Commit graph

1012 commits

Author SHA1 Message Date
Petr Viktorin
d78117981a
[3.11] gh-115421: List all test/ subdirs in Makefile, and test them (GH-115813)
This backports:
- GH-115813
- GH-115422

Unlike on the main branch, new directories are added to the end,
so they're a bit easier to patch out if a redistributor needs to do so.

On main & 3.12, there's a special case for `idlelib/idle_test`; on
3.11 TESTSUBDIRS has several more entries that are not in `test/`.
This backport ignores all of them (including idlelib).
(The alternative would be list them, as additions to TEST_HOME_DIR.
But that's probably too invasive; people might split stdlib up in
surprising ways.)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-11 12:02:05 +01:00
Nikita Sobolev
c3a274b0fe
[3.11] gh-108303: Move all pydoc related files to test_pydoc (GH-114506) (#115501)
(cherry picked from commit ccc76c3e88)
2024-02-15 16:36:10 +03:00
Nikita Sobolev
a4ad7a0ac5
[3.11] gh-108303: Move all doctest related files and tests to Lib/test/test_doctest/ (GH-112109) (#114313)
gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (GH-112109)
2024-01-19 16:12:48 +01:00
Miss Islington (bot)
90593e6fa1
[3.11] gh-112305: Fix check-clean-src to detect frozen_modules .h files. (GH-113344) (#113347)
gh-112305: Fix check-clean-src to detect frozen_modules .h files. (GH-113344)

A typo left this check broken so many of us who do out-of-tree builds
were seeing strange failures due to bad `Python/frozen_modules/*.h`
files being picked up from the source tree and used at build time from
different Python versions leading to errors like:

`Fatal Python error: _PyImport_InitCore: failed to initialize importlib`

Or similar once our build got to an "invoke the interpreter"
bootstrapping step due to incorrect bytecode being embedded.
(cherry picked from commit 103c4ea274)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-12-21 07:47:20 +00:00
Serhiy Storchaka
f92c8bfed6
[3.11] gh-108927: Include new dir test/regrtestdata in the installation (GH-112765) (GH-112784)
(cherry picked from commit f8c0198e3b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-06 08:12:08 +00:00
Seth Michael Larson
76c9c9cedf
[3.11] GH-112160: Pin to manifest of quay.io/tiran/cpython_autoconf (#112161) 2023-12-04 16:02:45 +00:00
Miss Islington (bot)
7b8445109d
[3.11] gh-108303: Install Lib/test/configdata (GH-111899) (#111945)
gh-108303: Install `Lib/test/configdata` (GH-111899)
(cherry picked from commit 65d6dc2715)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-10 12:23:57 +00:00
Nikita Sobolev
bc9f47097e
[3.11] gh-108303: Move all inspect test files to test_inspect/ (GH-109607) (#111543) 2023-10-31 14:00:39 +00:00
Miss Islington (bot)
28c6cc1928
[3.11] [3.12] gh-108303: Move all certificates to Lib/test/certdata/ (GH-109489) (GH-109682) (#110646)
[3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (GH-109682)

* gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489)
(cherry picked from commit e57ecf6bbc)

Python 3.12 backport: update also `test_nntplib`.

(cherry picked from commit c2d542b42c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: T. Wouters <thomas@python.org>
2023-10-10 21:02:21 +00:00
Miss Islington (bot)
f7a1d7d060
[3.11] gh-103053: Fix make check-clean-src: check "python" program (GH-110449) (#110454)
gh-103053: Fix make check-clean-src: check "python" program (GH-110449)

"make check-clean-src" now also checks if the "python" program is
found in the source directory: fail with an error if it does exist.
(cherry picked from commit a155f9f342)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-06 01:10:39 +00:00
Miss Islington (bot)
779481ef15
[3.11] gh-110429: Fix race condition in "make regen-all" (GH-110433) (#110439)
gh-110429: Fix race condition in "make regen-all" (GH-110433)

"make regen-pegen" now creates a temporary file called "parser.c.new"
instead of "parser.new.c". Previously, if "make clinic" was run in
parallel with "make regen-all", clinic may try but fail to open
"parser.new.c" if the temporay file was removed in the meanwhile.
(cherry picked from commit fb6c4ed2bb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 20:49:32 +00:00
Victor Stinner
6c98c734c7
[3.11] gh-109972: Split test_gdb.py into test_gdb package (#109977) (… (#110343)
[3.12] gh-109972: Split test_gdb.py into test_gdb package (#109977) (#110339)

gh-109972: Split test_gdb.py into test_gdb package (#109977)

Split test_gdb.py file into a test_gdb package made of multiple
tests, so tests can now be run in parallel.

* Create Lib/test/test_gdb/ directory.
* Split test_gdb.py into multiple files in Lib/test/test_gdb/
  directory.
* Move Lib/test/gdb_sample.py to Lib/test/test_gdb/ directory.
  Update get_sample_script(): use __file__ to locate gdb_sample.py.
* Move gdb_has_frame_select() and HAS_PYUP_PYDOWN to test_misc.py.
* Explicitly skip test_gdb on Windows. Previously, test_gdb was
  skipped even if gdb was available because of
  gdb_has_frame_select().

(cherry picked from commit 8f324b7ecd)
(cherry picked from commit e7a61d34b7)
2023-10-04 10:53:28 +00:00
Victor Stinner
8d99502aac
[3.11] gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265) (#109678)
* gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265)

(cherry picked from commit 1110c5bc82)

* gh-108303: Add `Lib/test/tokenizedata` to `TESTSUBDIRS` (#109314)

(cherry picked from commit 42ab2cbd7b)

---------

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-21 21:46:05 +02:00
Victor Stinner
37b261799b
[3.11] gh-108303: Move test_future into its own test_future_stmt subdir (#109368) (#109680)
gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368)

(cherry picked from commit 82505dc351)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-21 21:45:37 +02:00
Victor Stinner
ca8da713d5
[3.11] gh-108303: Create Lib/test/test_dataclasses/ directory (#108978) (#109675)
gh-108303: Create Lib/test/test_dataclasses/ directory (#108978)

Move test_dataclasses.py and its "dataclass_*.py" modules into the
new Lib/test/test_dataclasses/ subdirectory.

Backport to 3.11: update Lib/test/.ruff.toml.

(cherry picked from commit 14d6e197cc)
2023-09-21 18:59:11 +00:00
Victor Stinner
ed233ddc00
[3.11] gh-108740: Fix "make regen-all" race condition (#108741) (#109021)
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 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.

Backport notes:

* Omit Doc/using/configure.rst changes.
* no need to change "make clinic", it didn't run
  generate_global_objects.py script before.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
(cherry picked from commit db1ee6a19a)
2023-09-06 23:00:30 +02:00
Victor Stinner
a15396146f
[3.11] gh-108303: Add Lib/test/test_cppext/ sub-directory (#108325) (#108336)
gh-108303: Add Lib/test/test_cppext/ sub-directory (#108325)

* Move test_cppext to its own directory
* Rename setup_testcppext.py to setup.py
* Rename _testcppext.cpp to extension.cpp
* The source (extension.cpp) is now also copied by the test.

(cherry picked from commit 21dda09600)
2023-08-23 05:11:53 +02:00
Miss Islington (bot)
5be32d8818
[3.11] gh-106016: Add Lib/test/test_module/ directory (GH-108293) (#108304)
gh-106016: Add Lib/test/test_module/ directory (GH-108293)

* Move Python scripts related to test_module to this new directory:
  good_getattr.py and bad_getattrX.py scripts.
* Move Lib/test/test_module.py to Lib/test/test_module/__init__.py.
(cherry picked from commit adfc118fda)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-08-22 15:42:00 +00:00
Łukasz Langa
5a7456623f
[3.11] gh-75371: reformat Makefile.pre.in to accommodate for empty FRAMEWORKALTINSTALLLAST (GH-107035) (#107050)
in the case of an empty FRAMEWORKALTINSTALLLAST, this patch prevents leaving
an astray linebreak and two tabs in the resulting Makefile.

Before change:
```
.PHONY: commoninstall
commoninstall:  check-clean-src  \
		altbininstall libinstall inclinstall libainstall \
		sharedinstall altmaninstall \

```

After change (with empty FRAMEWORKALTINSTALLLAST):
```
.PHONY: commoninstall
commoninstall:  check-clean-src  \
		altbininstall libinstall inclinstall libainstall \
		sharedinstall altmaninstall
```
(cherry picked from commit 9c38206925)

Co-authored-by: Moritz Neeb <nt4u@kpvn.de>
2023-07-23 11:29:13 +02:00
Jeffery To
6c6a2a9143
[3.11] gh-104692: Include commoninstall as a prerequisite for bininstall (GH-104693) (#105429)
This ensures that `commoninstall` is completed before `bininstall` is
started when parallel builds are used (`make -j install`), and so the
`python3` symlink is only installed after all standard library modules
are installed.

.
(cherry picked from commit 990cb3676c)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-07-05 12:51:26 +02:00
Zachary Ware
4219074127
[3.11] gh-98822: Correct a few TESTSUBDIRS entries (GH-103970)
A few differences from the main branch were missed in GH-103946.
2023-04-28 12:07:16 -05:00
Erlend E. Aasland
838bc90511
[3.11] gh-98822: Add missing test directories to TESTSUBDIRS (#103942) (#103946) 2023-04-27 20:32:28 +00:00
Erlend E. Aasland
eac1a63cdb
[3.11] gh-98707: configure --with-system-libmpdec and --with-system-expat no longer include vendored headers (GH-98711) (#99391)
(cherry picked from commit 6abec1caff)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2022-11-13 19:47:31 +01:00
Miss Islington (bot)
dc4bf6b229
gh-97731: Specify the full path to the docs for make docclean (GH-98982)
Specify the full path to the docs for `make docclean`
This is to have `make clean` not error out on cross-builds.
(cherry picked from commit 22bab74c8f)

Co-authored-by: Brett Cannon <brett@python.org>
2022-11-02 12:58:48 -07:00
Jelle Zijlstra
52dab90500
[3.11] gh-96073: Fix installed tests by adding to Makefile.pre.in (#98071)
[3.11] Fix installed tests by adding to Makefile.pre.in

This was broken in #98045 but already fixed on main.
2022-10-07 20:59:18 -07:00
Senthil Kumaran
87a9e0f815
[3.11] gh-97731: fix distclean target to clean docs GH-97732 (#97844)
Backport  gh-97731: fix distclean target to clean docs #97732 to 3.11
2022-10-04 14:56:46 -07:00
Christian Heimes
4958820032
[3.11] gh-95853: Add script to automate WASM build (GH-95828, GH-95985, GH-96045, GH-96389, GH-96744) (GH-96749)
Automate WASM build with a new Python script. The script provides
several build profiles with configure flags for Emscripten flavors
and WASI. The script can detect and use Emscripten SDK and WASI SDK from
default locations or env vars.

``configure`` now detects Node arguments and creates HOSTRUNNER
arguments for Node 16. It also sets correct arguments for
``wasm64-emscripten``.
2022-09-13 12:06:39 +02:00
Christian Heimes
e62a0dfab2
[3.11] gh-95174: Add pthread stubs for WASI (GH-95234) (#95503)
Co-authored-by: Brett Cannon <brett@python.org>.
(cherry picked from commit 0fe645d6fd)

Co-authored-by: Christian Heimes <christian@python.org>
2022-08-01 15:37:45 +01:00
Miss Islington (bot)
62bc052c1e
gh-89758: Track all socket module dependencies (GH-95157)
(cherry picked from commit 41a5b84eaf)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-23 03:03:05 -07:00
Miss Islington (bot)
f44a9dc430
gh-94759: Create LCOV report with branch coverage (GH-94793)
(cherry picked from commit f5c02afaff)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-13 08:01:15 -07:00
Christian Heimes
a548a45633
[3.11] gh-94404: Use module CFLAGS before PY_STDMODULE_CFLAGS (GH-94413) (GH-94415)
``PY_STDMODULE_CFLAGS`` may contain include directories with system
headers. This can break compiling with built-in libmpdec.
Co-authored-by: Christian Heimes <christian@python.org>
2022-06-29 16:22:41 +02:00
Christian Heimes
4ec146cefd
[3.11] gh-90005: Rename MODULE_EGG variable to MODULE_EGG_STATE (GH-94301) (GH-94317)
Co-authored-by: Christian Heimes <christian@python.org>
2022-06-27 09:23:04 +02:00
Victor Stinner
96254a9acd
gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938) (#94000)
Move the follow functions and type from frameobject.h to pyframe.h,
so the standard <Python.h> provide frame getter functions:

* PyFrame_Check()
* PyFrame_GetBack()
* PyFrame_GetBuiltins()
* PyFrame_GetGenerator()
* PyFrame_GetGlobals()
* PyFrame_GetLasti()
* PyFrame_GetLocals()
* PyFrame_Type

Remove #include "frameobject.h" from many C files. It's no longer
needed.

(cherry picked from commit 27b9894033)
2022-06-20 15:47:41 +02:00
Miss Islington (bot)
6c8eb9503c
gh-84461: Fix pydebug Emscripten browser builds (GH-93982)
wasm_assets script did not take the ABIFLAG flag of sysconfigdata into
account.
(cherry picked from commit 7a2cc35e1c)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-18 06:17:09 -07:00
Miss Islington (bot)
753fe41418
gh-84461: Fix circulare dependency on BUILDPYTHON (GH-93977)
(cherry picked from commit 084023ccbe)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-18 01:56:25 -07:00
Christian Heimes
abd022383b
[3.11] gh-93584: Make all install+tests targets depends on all (GH-93589) (GH-93603)
All install targets use the "all" target as synchronization point to
prevent race conditions with PGO builds. PGO builds use recursive make,
which can lead to two parallel `./python setup.py build` processes that
step on each others toes.

"test" targets now correctly compile PGO build in a clean repo.
(cherry picked from commit 243ed5439c)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-08 17:24:30 +02:00
Pablo Galindo Salgado
e89c01eac7
[3.11] Add CI step to check changes in the exported ABI (#92442) 2022-05-08 04:32:17 +01:00
Petr Viktorin
83bce8ef14
gh-91324: Convert the stable ABI manifest to TOML (GH-92026) 2022-04-29 16:18:08 +02:00
Ethan Smith
d1de10784d
gh-84461: Add HOSTRUNNER for program to run Python executable (GH-91931)
`HOSTRUNNER` is a program which can be used to run `BUILDPYTHON` for the host platform (for example, `python.js` requires `node`).

Also change depedencies from `build_all` to `all` so that targets which can't build everything (e.g. WASM) can still run `buildbottest` and `pythoninfo`.

cc @tiran
2022-04-28 05:14:19 -07:00
Victor Stinner
64a54e511d
gh-91719: Add pycore_opcode.h internal header file (#91906)
Move the following API from Include/opcode.h (public C API) to a new
Include/internal/pycore_opcode.h header file (internal C API):

* EXTRA_CASES
* _PyOpcode_Caches
* _PyOpcode_Deopt
* _PyOpcode_Jump
* _PyOpcode_OpName
* _PyOpcode_RelativeJump
2022-04-26 00:14:30 +02:00
Victor Stinner
20cc695286
gh-64783: Fix signal.NSIG value on FreeBSD (#91929)
Fix signal.NSIG value on FreeBSD to accept signal numbers greater
than 32, like signal.SIGRTMIN and signal.SIGRTMAX.

* Add Py_NSIG constant.
* Add pycore_signal.h internal header file.
* _Py_Sigset_Converter() now includes the range of valid signals in
  the error message.
2022-04-26 00:13:31 +02:00
Serhiy Storchaka
f912cc0e41
gh-91575: Add a script for generating data for case-insensitive matching in re (GH-91660)
Also test that all extra cases are in BMP.
2022-04-22 21:37:46 +03:00
Victor Stinner
8a4e519e78
gh-79315: Add Include/cpython/pythread.h header (#91798) 2022-04-21 23:00:42 +02:00
Victor Stinner
6f9addb5ba
gh-79315: Add Include/cpython/modsupport.h header (#91797) 2022-04-21 23:00:26 +02:00
Brandt Bucher
1b34b5687b
gh-91404: Use computed gotos and reduce indirection in re (#91495) 2022-04-15 09:26:44 -07:00
Christian Heimes
7acedd71de
gh-84461: Drop -sWASM, fix building tests for browser (GH-91530)
- drop unnecessary ``=1`` suffix from Emscripten flags
- drop unnecessary ``-sWASM`` flag for side modules
- rename ``build_platform`` to ``build_wasm``. I introduced the target
  for WASM builds a couple of months ago.
- fix ``--enable-test-modules`` for browser builds
2022-04-14 16:27:41 +02:00
Serhiy Storchaka
474fdbe9e4
bpo-47152: Automatically regenerate sre_constants.h (GH-91439)
* Move the code for generating Modules/_sre/sre_constants.h from
  Lib/re/_constants.py into a separate script
  Tools/scripts/generate_sre_constants.py.
* Add target `regen-sre` in the makefile.
* Make target `regen-all` depending on `regen-sre`.
2022-04-12 18:34:06 +03:00
Christian Heimes
defbbd68f7
bpo-40280: WASM docs and smaller browser builds (GH-32412)
Co-authored-by: Brett Cannon <brett@python.org>
2022-04-10 09:29:51 +02:00
Victor Stinner
85addfb9c6
bpo-35134: Remove the Include/code.h header file (GH-32385)
Remove the Include/code.h header file. C extensions should only
include the main <Python.h> header file.

Python.h includes directly Include/cpython/code.h instead.
2022-04-07 02:29:52 +02:00
Victor Stinner
5c4d1f6e0e
bpo-35134: Add Include/cpython/setobject.h header (GH-32384) 2022-04-07 01:26:24 +02:00