Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated Tools/scripts/ example scripts #97669

Open
vstinner opened this issue Sep 30, 2022 · 6 comments
Open

Remove outdated Tools/scripts/ example scripts #97669

vstinner opened this issue Sep 30, 2022 · 6 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

vstinner commented Sep 30, 2022

The Tools/scripts/ directory contains more than 70+ example scripts. Most of them are outdated and short scripts Python which are simple to rewrite. When I asked other core developers, they suggest to remove all of them, see the discussion:

https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571

I created this issue to look into these scripts and see what to do with them.

@vstinner vstinner added the type-bug An unexpected behavior, bug, or error label Sep 30, 2022
@vstinner
Copy link
Member Author

vstinner commented Sep 30, 2022

analyze_dxp.py: I created issue #97670 to remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py script.

@vstinner
Copy link
Member Author

vstinner commented Sep 30, 2022

See also issue #97649: Do not install Tools directory on Windows.

vstinner added a commit to vstinner/cpython that referenced this issue Sep 30, 2022
Remove outdated example scripts. Copy them from Python 3.11 if you
still need them.

Removed scripts:

* 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
* md5sum.py
* mkreal.py
* objgraph.py
* parse_html5_entities.py
* pdeps.py
* pickle2db.py
* pindent.py
* pysource.py
* reindent-rst.py
* rgrep.py
* suff.py
* texi2html.py
* untabify.py
* which.py

Changes:

* Remove also test_fixcid, test_pdeps and test_pindent of
  test.test_tools.
* Remove get-remote-certificate.py changelog entry, since the script
  was removed.
* There is a copy of crlf.py in Lib/test/test_lib2to3/data/.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 30, 2022
Remove outdated example scripts. Copy them from Python 3.11 if you
still need them.

Removed scripts:

* 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
* md5sum.py
* mkreal.py
* objgraph.py
* parse_html5_entities.py
* pdeps.py
* pickle2db.py
* pindent.py
* pysource.py
* reindent-rst.py
* rgrep.py
* suff.py
* texi2html.py
* untabify.py
* which.py

Changes:

* Remove test_fixcid, test_pdeps and test_pindent of test.test_tools.
* Remove get-remote-certificate.py changelog entry, since the script
  was removed.
* FYI there is a copy of crlf.py in Lib/test/test_lib2to3/data/.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 30, 2022
Remove outdated example scripts. Copy them from Python 3.11 if you
still need them.

Removed scripts:

* 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
* parse_html5_entities.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.
* FYI there is a copy of crlf.py in Lib/test/test_lib2to3/data/.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 30, 2022
Remove outdated example scripts. Copy them from Python 3.11 if you
still need them.

Removed scripts:

* 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.
* FYI there is a copy of crlf.py in Lib/test/test_lib2to3/data/.
@vstinner
Copy link
Member Author

vstinner commented Sep 30, 2022

I created PR #97675 to remove a first batch of outdated example scripts.

@vstinner
Copy link
Member Author

vstinner commented Oct 3, 2022

@warsaw @gpshead @gvanrossum: Would you mind to approve formally this PR since you are in favor of removing Tools/scripts/ scripts according to your messages on https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571?

vstinner added a commit to vstinner/cpython that referenced this issue Oct 4, 2022
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/.
vstinner added a commit that referenced this issue Oct 4, 2022
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/.
vstinner added a commit to vstinner/cpython that referenced this issue Oct 6, 2022
Create Tools/build/ directory. Move the following scripts from
Tools/scripts/ to Tools/build/:

* check_extension_modules.py
* deepfreeze.py
* generate_global_objects.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
@vstinner
Copy link
Member Author

vstinner commented Oct 6, 2022

I created a draft PR #97963 to create a new Tools/build/ sub-directory which contains scripts used to build Python. I moved 13 scripts there. Not sure if it's a good idea or not.

With PR #97963 and PR #97964, the remaining scripts in Tools/scripts/ are:

Programs (3):

  • 2to3
  • idle3
  • pydoc3

Scripts (19):

  • abitype.py
  • checkpip.py
  • combinerefs.py
  • eptags.py
  • gprof2html.py
  • md5sum.py
  • nm2def.py
  • patchcheck.py
  • pathfix.py
  • pep384_macrocheck.py
  • ptags.py
  • reindent.py
  • run_tests.py
  • startuptime.py
  • summarize_stats.py
  • untabify.py: used by patchcheck.py
  • var_access_benchmark.py
  • verify_ensurepip_wheels.py
  • win_add2path.py

patchcheck.py, run_tests.py and verify_ensurepip_wheels.py are used by the Python workflow. Does it deserve its own sub-directory?

vstinner added a commit to vstinner/cpython that referenced this issue Oct 6, 2022
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".
vstinner added a commit to vstinner/cpython that referenced this issue Oct 6, 2022
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".
vstinner added a commit to vstinner/cpython that referenced this issue Oct 6, 2022
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".
@vstinner
Copy link
Member Author

vstinner commented Oct 6, 2022

I created PR #97964 to move diff.py and ndiff.py scripts to the difflib documentation (to Doc/includes/).

vstinner added a commit to vstinner/cpython that referenced this issue Oct 6, 2022
Create Tools/build/ directory. Move the following scripts from
Tools/scripts/ to Tools/build/:

* check_extension_modules.py
* deepfreeze.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
vstinner added a commit to vstinner/cpython that referenced this issue Oct 6, 2022
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
vstinner added a commit to vstinner/cpython that referenced this issue Oct 7, 2022
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".
vstinner added a commit to vstinner/cpython that referenced this issue Oct 7, 2022
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
ambv pushed a commit that referenced this issue Oct 7, 2022
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".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant