summaryrefslogtreecommitdiffstats
path: root/Tools
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)Eric Snow2022-11-152-101/+108
| | | | | This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
* gh-81057: Move the Remaining Import State Globals to _PyRuntimeState (gh-99488)Eric Snow2022-11-141-6/+0
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)Eric Snow2022-11-142-29/+5
| | | | | This moves nearly all remaining object-holding globals in core code (other than static types). https://github.com/python/cpython/issues/81057
* gh-81057: Move PyImport_Inittab to _PyRuntimeState (gh-99402)Eric Snow2022-11-122-2/+2
| | | | | We actually don't move PyImport_Inittab. Instead, we make a copy that we keep on _PyRuntimeState and use only that after Py_Initialize(). We also prevent folks from modifying PyImport_Inittab (the best we can) after that point. https://github.com/python/cpython/issues/81057
* gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)Eric Snow2022-11-111-14/+1
| | | | | The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject. State for the "small block" allocator was stored in another 13. That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057. (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.) https://github.com/python/cpython/issues/81057
* gh-81057: Add PyInterpreterState.static_objects (gh-99397)Eric Snow2022-11-111-2/+4
| | | | | As we consolidate global variables, we find some objects that are almost suitable to add to _PyRuntimeState.global_objects, but have some small/sneaky bit of per-interpreter state (e.g. a weakref list). We're adding PyInterpreterState.static_objects so we can move such objects there. (We'll removed the _not_used field once we've added others.) https://github.com/python/cpython/issues/81057
* gh-81057: Move the Extension Modules Cache to _PyRuntimeState (gh-99355)Eric Snow2022-11-111-2/+0
| | | | | We also move the closely related max_module_number and add comments documenting the group of struct members. https://github.com/python/cpython/issues/81057
* gh-81057: Generate a Separate Initializer For Each Part of the Global ↵Eric Snow2022-11-111-48/+49
| | | | | | | Objects Initializer (gh-99389) Up until now we had a single generated initializer macro for all the statically declared global objects in _PyRuntimeState, including several one-offs (e.g. the empty tuple). The one-offs don't need to be generated, but were because we had one big initializer. Having separate initializers for set of generated global objects allows us to generate only the ones we need to. This allows us to add initializers for one-off global objects without having to generate them. https://github.com/python/cpython/issues/81057
* Fix typo in Tools/wasm/README.md (GH-99384)Ikko Ashimine2022-11-111-1/+1
| | | | | Noticable -> Noticeable Automerge-Triggered-By: GH:AlexWaygood
* Update github CI to use OpenSSL 1.1.1s and 3.0.7. (#99364)Gregory P. Smith2022-11-111-2/+2
|
* gh-90110: Update the C-analyzer Tool (gh-99307)Eric Snow2022-11-103-89/+13
|
* gh-99300: Use Py_NewRef() in Parser/ directory (#99330)Victor Stinner2022-11-101-2/+1
| | | | Replace Py_INCREF() with Py_NewRef() in C files of the Parser/ directory and in the PEG generator.
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-101-8/+10
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-092-2/+3
|
* gh-90868: Add _PyStaticObject_CheckRefcnt() function (#99261)Victor Stinner2022-11-091-5/+2
| | | | | | Add _PyStaticObject_CheckRefcnt() function to make _PyStaticObjects_CheckRefcnt() shorter. Use _PyObject_ASSERT_FAILED_MSG() to log the object causing the fatal error.
* gh-90868: Adjust the Generated Objects (gh-99223)Eric Snow2022-11-081-3/+49
| | | | | | | | | | | We do the following: * move the generated _PyUnicode_InitStaticStrings() to its own file * move the generated _PyStaticObjects_CheckRefcnt() to its own file * include pycore_global_objects.h in extension modules instead of pycore_runtime_init.h These changes help us avoid including things that aren't needed. https://github.com/python/cpython/issues/90868
* gh-98627: Add the _testsinglephase Module (gh-99039)Eric Snow2022-11-082-1/+2
| | | | | This makes it more clear that a given test is definitely testing against a single-phase init (legacy) extension module. The new module is a companion to _testmultiphase. https://github.com/python/cpython/issues/98627
* GH-98831: Simple input-output stack effects for bytecodes.c (#99120)Guido van Rossum2022-11-082-56/+113
|
* gh-72719: Remove asyncore and asynchat modules (#96580)Nikita Sobolev2022-11-081-2/+0
| | | | | Remove modules asyncore and asynchat, which were deprecated by PEP 594. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* GH-98831: Implement super-instruction generation (#99084)Guido van Rossum2022-11-062-14/+66
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-99104: Update headers for bytecodes.c and generate_cases.py (#99112)Guido van Rossum2022-11-051-1/+2
| | | Also tweak the labels near the end of bytecodes.c.
* GH-98831: Auto-generate PREDICTED() macro calls (#99102)Guido van Rossum2022-11-041-0/+7
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* Support comparing two sets of pystats (GH-98816)Michael Droettboom2022-11-041-122/+364
| | | | | | | | | | This adds support for comparing pystats collected from two different builds. - The `--json-output` can be used to load in a set of raw stats and output a JSON file. - Two of these JSON files can be provided on the next run, and then comparative results between the two are output.
* gh-92584: Remove the distutils package (#99061)Victor Stinner2022-11-033-4/+2
| | | | | | | | | | | | Remove the distutils package. It was deprecated in Python 3.10 by PEP 632 "Deprecate distutils module". For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils. * Remove Lib/distutils/ directory * Remove test_distutils * Remove references to distutils * Skip test_check_c_globals and test_peg_generator since they use distutils
* gh-92584: Remove references to removed _bootsubprocess (#99062)Victor Stinner2022-11-031-1/+0
| | | | The _bootsubprocess module was removed in gh-93939 by commit 81dca70d704d0834d8c30580e648a973250b2973.
* gh-98401: Invalid escape sequences emits SyntaxWarning (#99011)Victor Stinner2022-11-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence), use raw strings for regular expression: re.compile(r"\d+\.\d+"). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. Octal escapes with value larger than 0o377 (ex: "\477"), deprecated in Python 3.11, now produce a SyntaxWarning, instead of DeprecationWarning. In a future Python version they will be eventually a SyntaxError. codecs.escape_decode() and codecs.unicode_escape_decode() are left unchanged: they still emit DeprecationWarning. * The parser only emits SyntaxWarning for Python 3.12 (feature version), and still emits DeprecationWarning on older Python versions. * Fix SyntaxWarning by using raw strings in Tools/c-analyzer/ and wasm_build.py.
* GH-98831: Remove redundant extract_cases.py script (GH-99065)Guido van Rossum2022-11-033-338/+0
| | | Debt I owe from PR GH-98830.
* gh-98948: Remove obsolete readelf dependency (#98949)serge-sans-paille2022-11-032-6/+0
| | | | | This got introduced in commit 5884449539510313c826d69835829c7957c7154a to determine if readline is already linked against curses or tinfo in the setup.py, which is no longer present.
* GH-98831: "Generate" the interpreter (#98830)Guido van Rossum2022-11-037-0/+1079
| | | | | | | | | | | The switch cases (really TARGET(opcode) macros) have been moved from ceval.c to generated_cases.c.h. That file is generated from instruction definitions in bytecodes.c (which impersonates a C file so the C code it contains can be edited without custom support in e.g. VS Code). The code generator lives in Tools/cases_generator (it has a README.md explaining how it works). The DSL used to describe the instructions is a work in progress, described in https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md. This is surely a work-in-progress. An easy next step could be auto-generating super-instructions. **IMPORTANT: Merge Conflicts** If you get a merge conflict for instruction implementations in ceval.c, your best bet is to port your changes to bytecodes.c. That file looks almost the same as the original cases, except instead of `TARGET(NAME)` it uses `inst(NAME)`, and the trailing `DISPATCH()` call is omitted (the code generator adds it automatically).
* gh-99016: Make build scripts compatible with Python 3.8 (GH-99017)Serhiy Storchaka2022-11-022-3/+3
|
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-022-19/+11
|
* gh-90716: add _pylong.py module (#96673)Neil Schemenauer2022-10-261-0/+56
| | | | | | | | | | | | Add Python implementations of certain longobject.c functions. These use asymptotically faster algorithms that can be used for operations on integers with many digits. In those cases, the performance overhead of the Python implementation is not significant since the asymptotic behavior is what dominates runtime. Functions provided by this module should be considered private and not part of any public API. Co-author: Tim Peters <tim.peters@gmail.com> Co-author: Mark Dickinson <dickinsm@gmail.com> Co-author: Bjorn Martinsson
* gh-96143: Move the perf trampoline files to the Python directory (#98675)Pablo Galindo Salgado2022-10-252-8/+8
|
* gh-97669: Create Tools/build/ directory (#97963)Victor Stinner2022-10-1716-23/+41
| | | | | | | | | | | | | | | | | | | | | | | Create Tools/build/ directory. Move the following scripts from Tools/scripts/ to Tools/build/: * check_extension_modules.py * deepfreeze.py * freeze_modules.py * generate_global_objects.py * generate_levenshtein_examples.py * generate_opcode_h.py * generate_re_casefix.py * generate_sre_constants.py * generate_stdlib_module_names.py * generate_token.py * parse_html5_entities.py * smelly.py * stable_abi.py * umarshal.py * update_file.py * verify_ensurepip_wheels.py Update references to these scripts.
* gh-95731: Fix module docstring extraction in pygettext (#95732)Jakub Kuczys2022-10-151-3/+4
|
* gh-97669: Remove Tools/scripts/startuptime.py (#98214)Victor Stinner2022-10-121-22/+0
| | | | | | | | | | The "pyperf command" tool be used instead. Example: $ python3 -m pyperf command -- python3 -c pass ..................... command: Mean +- std dev: 17.8 ms +- 0.4 ms pyperf also computes the standard deviation which gives an idea of the benchmark looks reliable or not.
* gh-97669: Create Tools/patchcheck/ directory (#98186)Victor Stinner2022-10-124-3/+0
| | | | Move patchcheck.py, reindent.py and untabify.py scripts to a new Tools/patchcheck/ directory.
* gh-97669: Remove abitype.py and pep384_macrocheck.py (#98165)Victor Stinner2022-10-113-351/+0
| | | Remove abitype.py and pep384_macrocheck.py scripts of Tools/scripts/.
* gh-97669: Remove outdated example scripts (#97675) (#98167)Victor Stinner2022-10-116-576/+0
| | | | | | | | | | | Remove outdated example scripts of the Tools/scripts/ directory: * gprof2html.py * md5sum.py * nm2def.py * pathfix.py * win_add2path.py Remove test_gprof2html, test_md5sum and test_pathfix of test_tools.
* gh-95756: Lazily created cached co_* attrs (GH-97791)Ken Jin2022-10-111-1/+1
|
* gh-68686: Retire eptag ptag scripts (#98064)Joannah Nanjekye2022-10-083-112/+0
| | | | | | | | | * Retire eptag ptag scripts * 📜🤖 Added by blurb_it. * fix news entry error Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-92886: [clinic.py] raise exception on invalid input instead of assertion ↵Irit Katriel2022-10-071-1/+2
| | | | | | | (GH-98051) Tests should pass with -O (assertions off). Automerge-Triggered-By: GH:iritkatriel
* gh-97669: Move difflib examples to Doc/includes/ (#97964)Victor Stinner2022-10-072-193/+0
| | | | | | | | | | | Remove diff.py and ndiff.py scripts of Tools/scripts/: move them to Doc/includes/. * diff.py and ndiff.py files are no longer executable. Remove also their shebang ("#!/usr/bin/env python3"). * Remove the -profile command from ndiff.py to simply the code. * Remove ndiff.py copyright and history command. The Python documentation examples are distributed under the "Zero Clause BSD License".
* gh-97008: Add a Python implementation of AttributeError and NameError ↵Łukasz Langa2022-10-041-0/+70
| | | | | | | | | suggestions (#97022) Relevant tests moved from test_exceptions to test_traceback to be able to compare both implementations. Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* gh-97670: Remove sys.getdxp() and analyze_dxp.py script (#97671)Victor Stinner2022-10-042-130/+0
| | | | | | | Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py script. DXP stands for "dynamic execution pairs". They were related to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been removed in Python 3.11. Python can now be built with "./configure --enable-pystats" to gather statistics on Python opcodes.
* gh-97669: Remove outdated example scripts (#97675)Victor Stinner2022-10-0440-6538/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove outdated example scripts of the Tools/scripts/ directory. A copy can be found in the old-demos project: https://github.com/gvanrossum/old-demos Removed scripts (39): * byext.py * byteyears.py * cleanfuture.py * copytime.py * crlf.py * db2pickle.py * dutree.doc * dutree.py * find-uname.py * find_recursionlimit.py * finddiv.py * findlinksto.py * findnocoding.py * fixcid.py * fixdiv.py * fixheader.py * fixnotice.py * fixps.py * get-remote-certificate.py * google.py * highlight.py * ifdef.py * import_diagnostics.py * lfcr.py * linktree.py * lll.py * mailerdaemon.py * make_ctype.py * mkreal.py * objgraph.py * pdeps.py * pickle2db.py * pindent.py * pysource.py * reindent-rst.py * rgrep.py * suff.py * texi2html.py * which.py Changes: * Remove test_fixcid, test_lll, test_pdeps and test_pindent of test.test_tools. * Remove get-remote-certificate.py changelog entry, since the script was removed. Note: there is a copy of crlf.py in Lib/test/test_lib2to3/data/.
* gh-97681: Remove Tools/demo/ directory (#97682)Victor Stinner2022-10-0315-2721/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the Tools/demo/ directory which contained old demo scripts. A copy can be found in the old-demos project: https://github.com/gvanrossum/old-demos Remove the following old demo scripts: * beer.py * eiffel.py * hanoi.py * life.py * markov.py * mcast.py * queens.py * redemo.py * rpython.py * rpythond.py * sortvisu.py * spreadsheet.py * vector.py Changes: * Remove a reference to the redemo.py script in the regex howto documentation. * Remove a reference to the removed Tools/demo/ directory in the curses documentation. * Update PC/layout/ to remove the reference to Tools/demo/ directory.
* gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE ↵Serhiy Storchaka2022-10-031-0/+1
| | | | | | | converter (GH-97729) It affects function os.system() on Windows and Windows-specific modules winreg, _winapi, _overlapped, and _msi.
* gh-90110: Update the c-analyzer Tool (gh-97695)Eric Snow2022-10-012-68/+7
| | | https://github.com/python/cpython/issues/90110
* gh-90989: Install Windows launcher per-user, and clarify some installer text ↵Steve Dower2022-09-302-7/+7
| | | | (GH-97655)