summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
Commit message (Collapse)AuthorAgeFilesLines
* closes bpo-40385: Remove Tools/scripts/checkpyc.py (GH-19709)Ammar Askar2020-04-252-70/+0
| | | | | This is one of the few files that has intimate knowledge of the pyc file format. Since it lacks tests it tends to become outdated fairly quickly. At present it has been broken since the introduction of PEP 552.
* bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-221-1/+3
| | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40267: Fix message when last input character produces a SyntaxError ↵Lysandros Nikolaou2020-04-151-0/+4
| | | | | | | | (GH-19521) When there is a SyntaxError after reading the last input character from the tokenizer and if no newline follows it, the error message used to be `unexpected EOF while parsing`, which is wrong.
* bpo-40094: Fix which.py script exit code (GH-19286)Victor Stinner2020-04-021-0/+1
| | | | It now uses os.waitstatus_to_exitcode() to convert os.system() exit status into an exit code.
* bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)Mark Shannon2020-01-141-5/+0
| | | | | | | | Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
* bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)Ruediger Pluem2019-10-111-4/+1
| | | pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.
* bpo-37064: Add option -a to pathfix.py tool (GH-15717)PatrikKopkan2019-09-251-5/+30
| | | Add option -a to Tools/Scripts/pathfix.py script: add flags.
* Mark files as executable that are meant as scripts. (GH-15354)Greg Price2019-09-091-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | This is the converse of GH-15353 -- in addition to plenty of scripts in the tree that are marked with the executable bit (and so can be directly executed), there are a few that have a leading `#!` which could let them be executed, but it doesn't do anything because they don't have the executable bit set. Here's a command which finds such files and marks them. The first line finds files in the tree with a `#!` line *anywhere*; the next-to-last step checks that the *first* line is actually of that form. In between we filter out files that already have the bit set, and some files that are meant as fragments to be consumed by one or another kind of preprocessor. $ git grep -l '^#!' \ | grep -vxFf <( \ git ls-files --stage \ | perl -lane 'print $F[3] if (!/^100644/)' \ ) \ | grep -ve '\.in$' -e '^Doc/includes/' \ | while read f; do head -c2 "$f" | grep -qxF '#!' \ && chmod a+x "$f"; \ done
* bpo-37064: Add option -k to Tools/scripts/pathfix.py (GH-15548)PatrikKopkan2019-09-051-5/+34
| | | Add flag -k to pathscript.py script: preserve shebang flags.
* bpo-37704: Remove Tools/scripts/h2py.py (GH-15000)Victor Stinner2019-07-302-172/+0
| | | Use cffi to access a C API in Python.
* bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026)Zackery Spytz2019-05-021-4/+3
|
* bpo-36345: Update wsgiref example (GH-12562)Stéphane Wirtel2019-04-161-2/+3
| | | | Use literalinclude markup to include Tools/scripts/serve.py code. Tools/scripts/serve.py first argument on the command line is now optional.
* bpo-22831: Use "with" to avoid possible fd leaks in tools (part 2). (GH-10927)Serhiy Storchaka2019-03-3019-216/+208
|
* bpo-22831: Use "with" to avoid possible fd leaks in tools (part 1). (GH-10926)Serhiy Storchaka2019-03-305-228/+226
|
* bpo-35884: Add string-keys-only microbenchmark for dict access to ↵Stefan Behnel2019-03-251-12/+28
| | | | var_access_benchmark.py (GH-11905)
* bpo-35884: Add missing FIFO queue benchmark (GH-11898)Raymond Hettinger2019-02-161-1/+10
| | | https://bugs.python.org/issue35884
* Fix typo (micro->nano) (GH-11759)Raymond Hettinger2019-02-051-1/+1
|
* bpo-35884: Add variable access benchmarking script (GH-11725)Raymond Hettinger2019-02-031-0/+272
|
* bpo-30455: Generate all token related code and docs from Grammar/Tokens. ↵Serhiy Storchaka2018-12-222-0/+321
| | | | | | | | | | | | | | | | | | | (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.
* bpo-35133: Fix mistakes when concatenate string literals on different lines. ↵Serhiy Storchaka2018-11-051-2/+2
| | | | | | | | | | (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
* bpo-32256: Make patchcheck.py work for out-of-tree builds (GH-4760)Alexey Izbyshev2018-10-201-3/+9
| | | Set SRCDIR as the current directory for git.
* Update opcode.h header comment to mention the source data file (GH-9935)Shivank982018-10-181-2/+3
| | | This is intended to help code explorers find out more about what's defined there.
* pypi.python.org -> pypi.org (GH-7613)Ned Deily2018-06-111-1/+1
|
* bpo-33738: Fix macros which contradict PEP 384 (GH-7477)Christian Tismer2018-06-091-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During development of the limited API support for PySide, we saw an error in a macro that accessed a type field. This patch fixes the 7 errors in the Python headers. Macros which were not written as capitals were implemented as function. To do the necessary analysis again, a script was included that parses all headers and looks for "->tp_" in serctions which can be reached with active limited API. It is easily possible to call this script as a test. Error listing: ../../Include/objimpl.h:243 #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) Action: commented only ../../Include/objimpl.h:362 #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) Action: commented only ../../Include/objimpl.h:364 #define PyObject_GET_WEAKREFS_LISTPTR(o) \ ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) Action: commented only ../../Include/pyerrors.h:143 #define PyExceptionClass_Name(x) \ ((char *)(((PyTypeObject*)(x))->tp_name)) Action: implemented function ../../Include/abstract.h:593 #define PyIter_Check(obj) \ ((obj)->ob_type->tp_iternext != NULL && \ (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) Action: implemented function ../../Include/abstract.h:713 #define PyIndex_Check(obj) \ ((obj)->ob_type->tp_as_number != NULL && \ (obj)->ob_type->tp_as_number->nb_index != NULL) Action: implemented function ../../Include/abstract.h:924 #define PySequence_ITEM(o, i)\ ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) Action: commented only
* remove hg support from patchcheck (GH-7440)Benjamin Peterson2018-06-061-21/+3
|
* bpo-25427: Remove pyvenv (GH-5962)Brett Cannon2018-04-201-17/+0
|
* bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (#5772)Miro Hrončok2018-03-131-8/+20
| | | | | | | Creating backup files with ~ suffix can be undesirable in some environment, such as when building RPM packages. Instead of requiring the user to remove those files manually, option -n was added, that simply disables this feature. -n was selected because 2to3 has the same option with this behavior.
* bpo-31355: Travis-CI: re-enable macOS job (#5858)Antoine Pitrou2018-02-271-1/+6
| | | | The long build queues that plagued macOS builds on Travis seem to be a thing of the past now.
* bpo-20361: Remove workaround for a now fixed bug (#5283)Victor Stinner2018-01-231-3/+0
| | | | "python3 -bb -Wd" now works as expected: "python3 -bb -Wd -Werror::BytesWarning" is no more needed.
* bpo-32159: Remove tools for CVS and Subversion (#4615)Victor Stinner2017-11-283-326/+0
| | | | | | | | | | CPython migrated from CVS to Subversion, to Mercurial, and then to Git. CVS and Subversion are not more used to develop CPython. * platform module: drop support for sys.subversion. The sys.subversion attribute has been removed in Python 3.3. * Remove Misc/svnmap.txt * Remove Tools/scripts/svneol.py * Remove Tools/scripts/treesync.py
* bpo-32155: Bugfixes found by flake8 F841 warnings (#4608)Victor Stinner2017-11-281-1/+1
| | | | | | | | | | | * distutils.config: Use the PyPIRCCommand.realm attribute if set * turtledemo: wait until macOS osascript command completes to not create a zombie process * Tools/scripts/treesync.py: declare 'default_answer' and 'create_files' as globals to modify them with the command line arguments. Previously, -y, -n, -f and -a options had no effect. flake8 warning: "F841 local variable 'p' is assigned to but never used".
* bpo-31810: Add smelly.py to check exported symbols (#4057)Victor Stinner2017-10-241-0/+78
| | | | | | | * Add Tools/scripts/smelly.py: script checking if all symbols exported by libpython start with "Py" or "_Py". * Modify "make smelly" to run smelly.py: the command now fails with a non-zero exit code if libpython leaks a "smelly" symbol. * Travis CI now runs "make smelly"
* bpo-31536: Avoid wholesale rebuild after `make regen-all` (#3678)Antoine Pitrou2017-09-201-0/+28
| | | | | | * bpo-31536: Avoid wholesale rebuild after `make regen-all` * Add NEWS
* Simplify run_tests.py (#3482)Antoine Pitrou2017-09-101-5/+1
|
* remove IRIX support (closes bpo-31341) (#3310)Benjamin Peterson2017-09-041-4/+4
| | | See PEP 11.
* bpo-31221: patchcheck ignores external libraries (#3109)Victor Stinner2017-08-171-2/+20
| | | | | | | | | | | | | | | | Tools/scripts/patchcheck.py now ignores changes in directories which are copies of external libraries: * Modules/_ctypes/libffi_msvc/ * Modules/_ctypes/libffi_osx/ * Modules/_decimal/libmpdec/ * Modules/expat/ * Modules/zlib/ Drop also support for Mercurial, since CPython migrated to Git. Exclude also libmpdec patchcheck: exclude also libffi_osx and libffi_msvc
* Update `make patchcheck` for blurb and NEWS.d (#2381)Antoine Pitrou2017-06-251-5/+5
|
* Check the whitespace of pull requests on Travis (GH-2367)Brett Cannon2017-06-241-2/+32
|
* bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)Jon Dufresne2017-05-181-1/+1
| | | | | | | | * Replaced list(<generator expression>) with list comprehension * Replaced dict(<generator expression>) with dict comprehension * Replaced set(<list literal>) with set literal * Replaced builtin func(<list comprehension>) with func(<generator expression>) when supported (e.g. any(), all(), tuple(), min(), & max())
* bpo-30109: Fix reindent.py (GH-1207)Mariatta2017-04-201-1/+5
| | | Skip the file if it has bad encoding.
* Issue #29798: Handle git worktree in patchcheck (#1058)Nick Coghlan2017-04-091-1/+1
| | | | The original attempted fix missed an `isdir()` call in `get_base_branch()`.
* bpo-29798: Handle git worktree in `make patchcheck` (#629)Nick Coghlan2017-03-121-1/+4
| | | | In git worktree directories, `.git` is a configuration file rather than a subdirectory
* bpo-29656: Handle PR branches in 'make patchcheck' (#302)Nick Coghlan2017-03-121-6/+52
|
* Reintroduce Python2 support in generate_opcode_h.pyVictor Stinner2016-11-281-3/+9
| | | | | | Issue #28821. Add also a message to show that the command did something :-)
* Fix a ResourceWarning in generate_opcode_h.pyVictor Stinner2016-11-251-1/+5
| | | | | Use a context manager to close the Python file. Replace also open() with tokenize.open() to handle coding cookie if any in Lib/opcode.py.
* regrtest: add -u for unbuffered stdout/stderrVictor Stinner2016-09-211-0/+1
|
* Issue #26830: Refactor Tools/scripts/google.pyBerker Peksag2016-09-141-15/+17
| | | | Patch by Francisco Couzo.
* Issue #27952: Merge fixcid.py from 3.5Martin Panter2016-09-111-25/+27
|\
| * Issue #27952: Get fixcid.py working with the re moduleMartin Panter2016-09-111-25/+27
| |
* | Remove legacy "from __future__ import with_statement" lines.Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-09-081-2/+0
| |