Commit Graph

42 Commits

Author SHA1 Message Date
Nikita Sobolev
1110c5bc82
gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265) 2023-09-12 09:37:42 +03:00
Victor Stinner
ad73674283
gh-107603: Argument Clinic: Only include pycore_gc.h if needed (#108726)
Argument Clinic now only includes pycore_gc.h if PyGC_Head is needed,
and only includes pycore_runtime.h if _Py_ID() is needed.

* Add 'condition' optional argument to Clinic.add_include().
* deprecate_keyword_use() includes pycore_runtime.h when using
  the _PyID() function.
* Fix rendering of includes: comments start at the column 35.
* Mark PC/clinic/_wmimodule.cpp.h and
  "Objects/stringlib/clinic/*.h.h" header files as generated in
  .gitattributes.

Effects:

* 42 header files generated by AC no longer include the internal C
  API, instead of 4 header files before. For example,
  Modules/clinic/_abc.c.h no longer includes the internal C API.
* Fix _testclinic_depr.c.h: it now always includes pycore_runtime.h
  to get _Py_ID().
2023-08-31 23:42:34 +02:00
Ken Jin
e28b0dc86d
gh-107557: Setup abstract interpretation (#107847)
Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
Co-authored-by: Jules <57632293+juliapoo@users.noreply.github.com>
2023-08-15 18:04:17 +00:00
Irit Katriel
caa41a4f1d
gh-105481: split opcode_ids.h out of opcode.h so that it can be generated separately (#107866) 2023-08-11 17:42:01 +01:00
Brandt Bucher
e52e87c349
GH-105481: Mark more files as generated (GH-107598) 2023-08-03 21:37:23 -07:00
Irit Katriel
40f3f11a77
gh-105481: Generate the opcode lists in dis from data extracted from bytecodes.c (#106758) 2023-07-18 19:42:44 +01:00
Irit Katriel
2ca008e2b7
gh-105481: move Python/opcode_metadata.h to Include/internal/pycore_opcode_metadata.h (#106673) 2023-07-12 11:30:25 +01:00
Brandt Bucher
7b2d94d875
GH-106008: Make implicit boolean conversions explicit (GH-106003) 2023-06-29 13:49:54 -07:00
Guido van Rossum
51fc725117
gh-104584: Baby steps towards generating and executing traces (#105924)
Added a new, experimental, tracing optimizer and interpreter (a.k.a. "tier 2"). This currently pessimizes, so don't use yet -- this is infrastructure so we can experiment with optimizing passes. To enable it, pass ``-Xuops`` or set ``PYTHONUOPS=1``. To get debug output, set ``PYTHONUOPSDEBUG=N`` where ``N`` is a debug level (0-4, where 0 is no debug output and 4 is excessively verbose).

All of this code is likely to change dramatically before the 3.13 feature freeze. But this is a first step.
2023-06-26 19:02:57 -07:00
Victor Stinner
7b00940f69
gh-104773: PEP 594: Remove the sndhdr module (#104774)
Remove the Lib/test/sndhdrdata/ directory.
2023-05-24 09:32:18 +00:00
Steve Dower
eb5fd31948
gh-103088: Ensure POSIX venv scripts always use LF line endings (GH-103591)
Also touches the affected files in meaningless ways to ensure they get updated when pulling
2023-04-17 17:33:54 +01:00
Stanislav Syekirin
2b6e877767
gh-103088: Fix virtual environment activate script not working in Cygwin (GH-103470) 2023-04-12 21:11:50 +01:00
Eric Snow
52f91c642b
gh-90868: Adjust the Generated Objects (gh-99223)
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
2022-11-08 10:03:03 -07:00
Guido van Rossum
41bc101dd6
GH-98831: "Generate" the interpreter (#98830)
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).
2022-11-02 21:31:26 -07:00
Łukasz Langa
bbc7cd649a
gh-97008: Add a Python implementation of AttributeError and NameError 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>
2022-10-04 15:31:16 -07:00
Jason R. Coombs
3e718cf880
gh-95218: Move tests for importlib.resources into test_importlib.resources. (#95219)
* gh-95218: Move tests for importlib.resources into test_importlib.resources.

* Also update makefile

* Include test_importlib/resources in code ownership rule.
2022-07-24 20:53:10 -04:00
Kumar Aditya
71697664d7
GH-90699: Move generated static initializer to pycore_runtime_generated.h (GH-94051) 2022-07-07 13:04:05 -07:00
Dennis Sweeney
b733708ca3
gh-91719: Mark pycore_opcode.h as generated in .gitattributes (#91976) 2022-04-27 12:45:40 +02:00
Erlend Egeberg Aasland
0b906ae562
Use git attribute macros for CRLF and no-EOL files (GH-30762) 2022-04-17 15:53:31 -05:00
Petr Viktorin
079143df7e
bpo-47168: Mark files generated by make regen-limited-abi as generated (GH-32195) 2022-04-01 17:19:05 +02:00
Erlend Egeberg Aasland
f1e559b754
Update generated files list and add diff=generated attribute (GH-30745)
As a side effect, the list of generated files is relocated after the language aware diff settings.

Closes python/core-workflow#425

Automerge-Triggered-By: GH:zware
2022-01-21 12:59:45 -08:00
Erlend Egeberg Aasland
71734d0b9c
Mark all clinic headers as generated (GH-30679) 2022-01-19 08:54:45 -08:00
Guido van Rossum
1cbaa505d0
bpo-45696: Deep-freeze selected modules (GH-29118)
This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems.

The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new.

Windows version TBD.
2021-11-10 18:01:53 -08:00
Eric Snow
a2d8c4b81b
bpo-45019: Do some cleanup related to frozen modules. (gh-28319)
There are a few things I missed in gh-27980. This is a follow-up that will make subsequent PRs cleaner. It includes fixes to tests and tools that reference the frozen modules.

https://bugs.python.org/issue45019
2021-09-13 16:18:37 -06:00
Eric Snow
044e8d866f
bpo-45019: Add a tool to generate list of modules to include for frozen modules (gh-27980)
Frozen modules must be added to several files in order to work properly. Before this change this had to be done manually. Here we add a tool to generate the relevant lines in those files instead. This helps us avoid mistakes and omissions.

https://bugs.python.org/issue45019
2021-08-30 17:25:11 -06:00
Jason R. Coombs
aaa83cdfab
bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436)
* bpo-44771: Apply changes from importlib_resources@3b24bd6307

* Add blurb

* Exclude namespacedata01 from eol conversion.
2021-07-29 21:05:05 -04:00
Victor Stinner
eaede0ded7
bpo-44131: Test Py_FrozenMain() (GH-26126)
* Add test_frozenmain to test_embed
* Add Programs/test_frozenmain.py
* Add Programs/freeze_test_frozenmain.py
* Add Programs/test_frozenmain.h
* Add make regen-test-frozenmain
* Add test_frozenmain command to Programs/_testembed
* _testembed.c: add error(msg) function
2021-05-17 23:48:35 +02:00
Victor Stinner
94faa0724f
bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933)
These functions were undocumented and excluded from the limited C
API.

Most names defined by these header files were not prefixed by "Py"
and so could create names conflicts. For example, Python-ast.h
defined a "Yield" macro which was conflict with the "Yield" name used
by the Windows <winbase.h> header.

Use the Python ast module instead.

* Move Include/asdl.h to Include/internal/pycore_asdl.h.
* Move Include/Python-ast.h to Include/internal/pycore_ast.h.
* Remove ast.h header file.
* pycore_symtable.h no longer includes Python-ast.h.
2021-03-23 20:47:40 +01:00
Raymond Hettinger
95ad890a7b
bpo-42084: Language aware diff headers (GH-22776) 2020-10-19 12:13:01 -07:00
Lysandros Nikolaou
314858e276
bpo-40939: Remove the old parser (Part 2) (GH-21005)
Remove some remaining files and Makefile targets for the old parser
2020-06-20 19:07:25 +01:00
Greg Price
4e3dfcc4b9 bpo-37760: Mark all generated Unicode data headers as generated. (GH-15171)
This causes them to be collapsed by default in diffs shown on GitHub.




https://bugs.python.org/issue37760



Automerge-Triggered-By: @benjaminp
2019-08-12 22:23:41 -07:00
Serhiy Storchaka
8ac658114d
bpo-30455: Generate all token related code and docs from Grammar/Tokens. (GH-10370)
"Include/token.h", "Lib/token.py" (containing now some data moved from
"Lib/tokenize.py") and new files "Parser/token.c" (containing the code
moved from "Parser/tokenizer.c") and "Doc/library/token-list.inc" (included
in "Doc/library/token.rst") are now generated from "Grammar/Tokens" by
"Tools/scripts/generate_token.py". The script overwrites files only if
needed and can be used on the read-only sources tree.

"Lib/symbol.py" is now generated by "Tools/scripts/generate_symbol_py.py"
instead of been executable itself.

Added new make targets "regen-token" and "regen-symbol" which are now
dependencies of "regen-all".

The documentation contains now strings for operators and punctuation tokens.
2018-12-22 11:18:40 +02:00
Steve Dower
0cd6391fd8
bpo-34977: Add Windows App Store package (GH-11027)
Also adds the PC/layout script for generating layouts on Windows.
2018-12-10 18:52:57 -08:00
Victor Stinner
cb0b78a070
Revert "bpo-34977: Add Windows App Store package (GH-10245)" (GH-11019)
This reverts commit 468a15aaf9.
2018-12-07 12:57:43 +01:00
Steve Dower
468a15aaf9
bpo-34977: Add Windows App Store package (GH-10245) 2018-12-06 21:09:20 -08:00
INADA Naoki
c1897eda3d
gitattribute: Mark generated files (GH-7619)
Marked files are collapsed by default in Github pull request.
https://github.com/github/linguist#generated-code
2018-06-16 00:45:02 +09:00
Victor Stinner
44a70e9336
Fix Git attributes of test_importlib data files (#5209)
bpo-32248: Make sure that Git checks out data files with Unix line
ending on Windows as well.
2018-01-17 10:26:03 +01:00
Zachary Ware
d01db1c2a2 bpo-31358: Pull zlib out of the repository (GH-3375)
Also enable building externals by default on Windows, use PCbuild\build.bat's -E option to disable it.
2017-09-06 17:29:37 -07:00
Zachary Ware
6b6e687766 bpo-27425: Be more explicit in .gitattributes (GH-840)
Updates checked-in line endings on several files.
2017-06-10 14:58:42 -05:00
INADA Naoki
060d2d776a remove merge=union attribute for Misc/NEWS (GH-460)
Github doesn't support it (ref. isaacs/github#487).  So it can't ease
conflict on Github.

Additionally, it can make trouble when cherry-pick. (ref. GH-212)
2017-03-05 08:49:45 +09:00
Benjamin Peterson
2771304357 mark various test data binary (#233) 2017-02-22 22:38:48 -08:00
INADA Naoki
2c700af5a7 .gitattribute -> .gitattributes (GH-213) 2017-02-21 18:39:41 +09:00