summaryrefslogtreecommitdiffstats
path: root/Tools
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-64595: Fix regression in file write logic in Argument Clinic ↵Erlend E. Aasland2023-07-051-23/+12
| | | | | | | | | | (#106449) (#106452) Revert the two commits that introduced the regressions: - gh-104152 - gh-104507 (cherry picked from commit 9d1d4f9c73a71192b22ab52a2eb9278737f98ddb)
* [3.12] gh-100238: Use setuptools in peg-generator and reenable tests ↵Miss Islington (bot)2023-07-051-7/+47
| | | | | | | (GH-104798) (#105135) (cherry picked from commit afa759fb800be416f69e3e9c9b3efe68006316f5) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* [3.12] gh-106368: Add tests for permutation helpers in Argument Clinic ↵Miss Islington (bot)2023-07-041-2/+2
| | | | | | | | (GH-106407) (#106409) Added new test class PermutationTests() (cherry picked from commit 8f6df5e9cbc3a1689601714192aa6ecbb23e1927) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106359: Fix corner case bugs in Argument Clinic converter parser ↵Miss Islington (bot)2023-07-031-7/+9
| | | | | | | | | | | | (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 0da4c883cf4185efe27b711c3e0a1e6e94397610) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] Fix c-analyzer for GCC: ignore LANG env var (GH-106173) (#106178)Miss Islington (bot)2023-06-281-1/+7
| | | | | | | | | 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 1f74b9e933d546a015e8497e3b8728357196acc8) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740) ↵Miss Islington (bot)2023-06-143-1/+9
| | | | | | | | (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 b87d2882754a7c273e2695c33384383eba380d7d) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752)Eric Snow2023-06-141-0/+1
| | | | 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)
* [3.12] gh-98040: Fix importbench: use types.ModuleType() (GH-105743) (#105754)Miss Islington (bot)2023-06-131-1/+2
| | | | | | | | gh-98040: Fix importbench: use types.ModuleType() (GH-105743) Replace removed imp.new_module(name) with types.ModuleType(name). (cherry picked from commit 457a459c7804950d4c27a243b176eb933ec87a06) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) ↵Victor Stinner2023-06-061-4/+4
| | | | | | | | | | | | | | | | | | | (#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 bae415ad02c79cf3a2eec4aa6969221a12e6716f) * gh-102304: Fix up Simple ABI doc (GH-105351) (cherry picked from commit 0202aa002e06acef9aa55ace0d939103df19cadd)
* [3.12] gh-104614: Make Sure ob_type is Always Set Correctly by ↵Miss Islington (bot)2023-06-011-0/+2
| | | | | | | | | | 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
* [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) ↵Miss Islington (bot)2023-06-012-2/+4
| | | | | | | | | | | | | | | | | | | | (#105199) gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) Upgrade builds to OpenSSL 1.1.1u. This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t. The Mac/BuildScript/build-installer.py was already updated. Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9, and adds a new _ssl_data_31.h file from 3.1.1 along with the ssl.c code to use it. Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting). backports of this prior to 3.12 will not include the openssl 3.1 header. (cherry picked from commit ede89af605b1c0442353435ad22195c16274f65d) Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
* gh-105146: Update links at end of Windows installer (uninstall/repair) ↵Miss Islington (bot)2023-05-311-3/+3
| | | | | | | (GH-105147) (cherry picked from commit ed86e14b1672f32f0a31d72070e93d361ee0e2b4) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] gh-105091: stable_abi.py: Remove "Unixy" check from --all on other ↵Miss Islington (bot)2023-05-311-1/+2
| | | | | | | | platforms (GH-105092) (GH-105133) gh-105091: stable_abi.py: Remove "Unixy" check from --all on other platforms (GH-105092) (cherry picked from commit 0656d23d82cd5b88e578a26c65dd4a64414c833b) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* Improves the Windows MSI test run on PR (GH-104929)Miss Islington (bot)2023-05-251-34/+24
| | | | | | | Correctly set the exit code when builds fail Also build docs as part of the test (cherry picked from commit 569b2b8d612354062b8679d2d3f44f7ee03e66c2) Co-authored-by: Steve Dower <steve.dower@python.org>
* gh-104683: clinic.py: Modernise `parse_converter()` using pattern-matching ↵Alex Waygood2023-05-211-15/+19
| | | | (#104696)
* gh-104050: Add more type annotations to Argument Clinic (#104631)Erlend E. Aasland2023-05-211-23/+44
| | | | | | | Annotate methods of the following classes: - class Function - class Parameter - class LandMine
* gh-104050: Add basic type hints to Argument Clinic clinic class (#104705)Erlend E. Aasland2023-05-211-17/+38
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104050: Annotate Argument Clinic return converters (#104706)Erlend E. Aasland2023-05-211-30/+75
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-103295: expose API for writing perf map files (#103546)gsallam2023-05-211-0/+1
| | | | | Co-authored-by: Aniket Panse <aniketpanse@fb.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-104050: Add basic type hints to Argument Clinic DSL parser (#104704)Erlend E. Aasland2023-05-201-21/+40
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104683: Modernise Tools/clinic/ (#104684)Alex Waygood2023-05-202-27/+31
| | | | | | | - Make some string interpolations more readable using f-strings or explicit parametrisation - Remove unneeded open() mode specifiers Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-104683: Modernise `clinic.py` using `str.removeprefix` and ↵Alex Waygood2023-05-201-5/+5
| | | | | `str.removesuffix` (#104685) Both methods were new in Python 3.9.
* gh-104146: Purge dead code from Argument Clinic (#104680)Erlend E. Aasland2023-05-201-10/+1
| | | | | | | | | | | | | | The following local variables were assigned but never used: - line 551: result - line 1341: groups - line 1431: default_return_converter - line 1529: ignore_self - line 1809: input_checksum - line 4224: new' --- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104683: Argument clinic: use `dict` over `OrderedDict` (#104647)Alex Waygood2023-05-201-25/+23
| | | For code readability. Instances of `builtins.dict` have been ordered since 3.6, and have been guaranteed by the language to be ordered since Python 3.7. Argument Clinic now requires Python 3.10+.
* gh-104050: Add more type annotations to Argument Clinic (#104628)Erlend E. Aasland2023-05-181-14/+39
| | | | | | | | | | Annotate the following: - methods of class Class - methods of class Module - methods of class PythonParser - function compute_checksum() - function parse_file() - global variable unsupported_special_methods
* gh-104549: Set __module__ on TypeAliasType (#104550)Jelle Zijlstra2023-05-181-0/+1
|
* gh-104050: Improve some typing around `default`s and sentinel values (#104626)Alex Waygood2023-05-181-18/+23
| | | | | | | | | | | - Convert `unspecified` and `unknown` to be members of a `Sentinels` enum, rather than instances of bespoke classes. - An enum feels more idiomatic here, and works better with type checkers. - Convert some `==` and `!=` checks for these values to identity checks, which are more idiomatic with sentinels. - _Don't_ do the same for `Null`, as this needs to be a distinct type due to its usage in `clinic.py`. - Use `object` as the annotation for `default` across `clinic.py`. `default` can be literally any object, so `object` is the correct annotation here. --- Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-104146: Remove unused vars from Argument Clinic (#104627)Erlend E. Aasland2023-05-181-2/+0
| | | Remove 'in_classes' and 'so_far' from DSLParser.directive_module()
* gh-104050: Add type hints to Argument Clinic converter keywords (#104588)Erlend E. Aasland2023-05-171-12/+36
| | | | | Introduce TypeSet, and use it to annotate the 'accept' keyword of various C converters. Also add some missing return annotations for converter init functions.
* gh-104050: Add typing to Argument Clinic converters (#104547)Erlend E. Aasland2023-05-161-53/+57
|
* GH-103092: isolate `pyexpat` (#104506)Kumar Aditya2023-05-161-1/+0
|
* gh-104050: Add more annotations to `Tools/clinic.py` (#104544)Nikita Sobolev2023-05-163-30/+60
|
* gh-104050: Don't star-import 'types' in Argument Clinic (#104543)Erlend E. Aasland2023-05-161-3/+2
|
* gh-104050: Add basic typing to CConverter in clinic.py (#104538)Erlend E. Aasland2023-05-161-14/+14
|
* gh-64595: Fix write file logic in Argument Clinic (#104507)Erlend E. Aasland2023-05-161-11/+12
| | | | Check if any clinic output actually changes any of the output files before deciding if we should touch the source file.
* gh-101819: Isolate `_io` (#101948)Erlend E. Aasland2023-05-151-4/+0
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (#104501)dependabot[bot]2023-05-151-1/+1
| | | | | | | | | | | | | | | | build(deps-dev): bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic Bumps [mypy](https://github.com/python/mypy) from 1.2.0 to 1.3.0. - [Commits](https://github.com/python/mypy/compare/v1.2.0...v1.3.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* gh-104050: Run mypy on `clinic.py` in CI (#104421)Alex Waygood2023-05-154-24/+55
| | | | | | | | | | * Add basic mypy workflow to CI * Make the type check pass --------- Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* GH-103082: Filter LINE events in VM, to simplify tool implementation. ↵Mark Shannon2023-05-121-1/+1
| | | | | | | | (GH-104387) When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
* gh-104389: Add 'unused' keyword to Argument Clinic C converters (#104390)Erlend E. Aasland2023-05-121-1/+19
| | | | | | | | | Use the unused keyword param in the converter to explicitly mark an argument as unused: /*[clinic input] SomeBaseClass.stubmethod flag: bool(unused=True) [clinic start generated code]*/
* gh-87729: improve hit rate of LOAD_SUPER_ATTR specialization (#104270)Carl Meyer2023-05-111-3/+5
|
* GH-102181: Improve specialization stats for SEND (GH-102182)penguin_wwy2023-05-101-0/+2
|
* gh-90953: Don't use deprecated AST nodes in clinic.py (#104322)Alex Waygood2023-05-091-9/+3
|
* Trim trailing whitespace and test on CI (#104275)Hugo van Kemenade2023-05-082-2/+2
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-99108: Replace SHA3 implementation HACL* version (#103597)Jonathan Protzenko2023-05-081-7/+1
| | | | | | | | | | | Replaces our built-in SHA3 implementation with a verified one from the HACL* project. This implementation is used when OpenSSL does not provide SHA3 or is not present. 3.11 shiped with a very slow tiny sha3 implementation to get off of the <=3.10 reference implementation that wound up having serious bugs. This brings us back to a reasonably performing built-in implementation consistent with what we've just replaced our other guaranteed available standard hash algorithms with: code from the HACL* project. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-64660: Don't hardcode Argument Clinic return converter result variable ↵Erlend E. Aasland2023-05-071-9/+14
| | | | name (#104200)
* gh-101819: Port _io.PyBytesIOBuffer_Type to heap type (#104264)Erlend E. Aasland2023-05-071-1/+0
|
* gh-101819: Adapt _io.PyWindowsConsoleIO_Type to heap type (#104197)Erlend E. Aasland2023-05-071-1/+0
|
* gh-101819: Port _io.PyIncrementalNewlineDecoder_Type to heap type (#104249)Erlend E. Aasland2023-05-071-1/+0
|
* gh-104146: Remove unused var 'parser_body_declarations' from clinic.py (#104214)Erlend E. Aasland2023-05-051-3/+1
|