# Remove outdated Tools/scripts/ scripts

**URL:** <https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571>\
**Category:** Core Development\
**Created:** [September 29, 2022, 2:17pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571 "2022-09-29T14:17:12Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![steve.dower](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steve.dower/32/56_2.png) [@steve.dower](https://discuss.python.org/u/steve.dower)\
**Post date:** [September 30, 2022, 2:03pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/21 "2022-09-30T14:03:33Z")

</div>

> [@eryksun](#):
>
> The one thing this script does that the installer doesn’t do is add the user scripts directory to `PATH`. That’s for `--user` installations, which pip enables automatically if it isn’t permitted to install to the system site packages.

FWIW (and at risk of getting sidetracked), we can’t add directories to user-specific paths when installing as admin - Windows Installer just doesn’t support it (unless it’s been added since I last checked). In the default case, pip can install to system packages (which are per-user by default on Windows), so it turns out not to matter.

---

<div class="post-metadata">

**Author:** ![eric.snow](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/eric.snow/32/31_2.png) [@eric.snow](https://discuss.python.org/u/eric.snow)\
**Post date:** [September 30, 2022, 3:47pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/22 "2022-09-30T15:47:48Z")

</div>

> [@vstinner](#):
>
> If some scripts are useful, maybe the code should be moved into the stdlib?

I’d be surprised if there was much in Tools/scripts worth moving to the stdlib.

> [@vstinner](#):
>
> Or should we move these scripts to a separated project/Git repository?

> [@mwichmann](#):
>
> Just as a kind of data point, a “mature” (20+ yrs) project (written in Python) I work on has been moving old snippets of this nature off into a separate repository of unsupported tools and tricks, and out of the main repo where it might end up getting distributed with the project and considered something that needs supporting.

+1

After a quick scan through [https://github.com/python/cpython/pull/97675](https://github.com/python/cpython/pull/97675), it seems like at least some of these scripts are useful still (whether for getting something specific done or as good example code), even if CPython doesn’t need them. It would be good to preserve them publicly (other than in git history) _before_ removing them from Tools/scripts.

How much work would it be to create a new repo (“old-scripts”?) under [Python · GitHub](https://github.com/python) where we would add these scripts? Would there be any downsides?

(If possible, it would be nice if we could preserve git history too. Is that hard to do?)

---

<div class="post-metadata">

**Author:** ![eric.snow](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/eric.snow/32/31_2.png) [@eric.snow](https://discuss.python.org/u/eric.snow)\
**Post date:** [September 30, 2022, 3:59pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/23 "2022-09-30T15:59:45Z")

</div>

> [@guido](#):
>
> I think we should remove everything from those directories that isn’t needed to build. I don’t know how to tell what that is. For sure the `Tools/demo` directory can go – there’s even a demo of remote execution there! 🙂

+1

Expanding the exercise from Tools/scripts to Tools/\* makes sense. I expect we could circle back to the rest after Tools/scripts is done.

> [@guido](#):
>
> There are also some benchmarks (`ccbench`, `iobench`, `stringbench`) that probably ought to be moved to `pyperformance` so they can be used and maintained.

[https://github.com/python/cpython/issues/97680](https://github.com/python/cpython/issues/97680)

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [September 30, 2022, 4:06pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/24 "2022-09-30T16:06:29Z")

</div>

> [@eric.snow](#):
>
> it seems like at least some of these scripts are useful still (whether for getting something specific done or as good example code)

Can you please be more specific? Do you have examples?

> [@eric.snow](#):
>
> How much work would it be to create a new repo (“old-scripts”?) under [Python · GitHub](https://github.com/python) where we would add these scripts? Would there be any downsides?

Do you expect maintenance? Or do you want to archive the project as soon as it is created? Scripts are available in Python 3.11.

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [September 30, 2022, 4:22pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/25 "2022-09-30T16:22:42Z")

</div>

> [@guido](#):
>
> I think we should remove everything from those directories that isn’t needed to build. I don’t know how to tell what that is. For sure the `Tools/demo` directory can go – there’s even a demo of remote execution there! 🙂

I created a [separated issue](https://github.com/python/cpython/issues/97681) to propose removing these demo scripts.

---

<div class="post-metadata">

**Author:** ![jack1142](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jack1142/32/2224_2.png) [@jack1142](https://discuss.python.org/u/jack1142)\
**Post date:** [September 30, 2022, 4:30pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/26 "2022-09-30T16:30:53Z")

</div>

> [@eric.snow](#):
>
> Expanding the exercise from Tools/scripts to Tools/\* makes sense. I expect we could circle back to the rest after Tools/scripts is done.

`Tools/i18n` is one of the directories that should probably be excluded if you decide to go with widening these removals to `Tools/*`. It’s mentioned in Python’s gettext documentation and one of the tools there - pygettext.py - even has some added benefits over similar tools such as xgettext - e.g. support for gettext calls inside f-strings. It uses tokenize module which is comparatively more fragile than using ast module but I would say that it still performs its purpose pretty well.

---

<div class="post-metadata">

**Author:** ![eric.snow](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/eric.snow/32/31_2.png) [@eric.snow](https://discuss.python.org/u/eric.snow)\
**Post date:** [September 30, 2022, 9:19pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/27 "2022-09-30T21:19:02Z")

</div>

> [@vstinner](#):
>
> Scripts are available in Python 3.11.

Good point. That’s probably sufficient. I separate repo isn’t needed.

---

<div class="post-metadata">

**Author:** ![EpicWink](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/epicwink/32/17968_2.png) [@EpicWink](https://discuss.python.org/u/EpicWink)\
**Post date:** [September 30, 2022, 11:38pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/28 "2022-09-30T23:38:01Z")

</div>

> [@eric.snow](#):
>
> How much work would it be to create a new repo (“old-scripts”?) under [Python · GitHub](https://github.com/python) where we would add these scripts? Would there be any downsides?
> 
> (If possible, it would be nice if we could preserve git history too. Is that hard to do?)

Quite easy to preserve history. Just fork and run `git filter-branch --subdirectory-filter Tools HEAD` ([SO answer](https://stackoverflow.com/a/38086538)).

---

<div class="post-metadata">

**Author:** ![guido](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/guido/32/21_2.png) [@guido](https://discuss.python.org/u/guido)\
**Post date:** [October 1, 2022, 12:56am UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/29 "2022-10-01T00:56:19Z")

</div>

Oh, I should probably do this for the Tools/demo directory which I preserved in gvanrossum/old-demos. I wouldn’t feel bad at all doing a `git push -f` there. (I wrote many of those demos so I feel particularly motivated to preserve them somewhere other than git history.)

---

<div class="post-metadata">

**Author:** ![malemburg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/malemburg/32/50_2.png) [@malemburg](https://discuss.python.org/u/malemburg)\
**Post date:** [October 1, 2022, 11:14am UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/30 "2022-10-01T11:14:26Z")

</div>

We could add a new repo “cpython-attic” for such older scripts, modules  
and similar code.

CVS used to have a feature called the “attic” where you could keep  
old stuff, which is no longer needed, but may still serve some  
purpose, even if it’s just software archeology. A useful feature,  
which subsequent VCSes dropped for some reason.

---

<div class="post-metadata">

**Author:** ![fungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/fungi/32/5963_2.png) [@fungi](https://discuss.python.org/u/fungi)\
**Post date:** [October 1, 2022, 11:53am UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/31 "2022-10-01T11:53:28Z")

</div>

Be aware that, these days, the manpage for git filter-branch warns  
against its own use, and recommends the more robust  
[git-filter-repo · PyPI](https://pypi.org/project/git-filter-repo/) tool in its stead.

But yes, cleanly preserving revision history for only specific files  
is quite doable when forking into a new repository.

---

<div class="post-metadata">

**Author:** ![malemburg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/malemburg/32/50_2.png) [@malemburg](https://discuss.python.org/u/malemburg)\
**Post date:** [October 1, 2022, 12:26pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/32 "2022-10-01T12:26:32Z")

</div>

A probably easier to maintain alternative would be having a separate  
branch “attic” with only those archived parts of the source tree.

That way, history is maintained, but the code won’t get installed  
anywhere and also not be part of the source dist.

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [October 1, 2022, 9:23pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/33 "2022-10-01T21:23:22Z")

</div>

You can use the “3.11” branch to get these scripts and demos.

---

<div class="post-metadata">

**Author:** ![malemburg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/malemburg/32/50_2.png) [@malemburg](https://discuss.python.org/u/malemburg)\
**Post date:** [October 2, 2022, 11:33am UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/34 "2022-10-02T11:33:09Z")

</div>

Of course, and all the other past release branches 🙂 But that’s not  
the point. A new “attic” branch would not be subject to any release  
cycles and simply be used to stash away older code - much like this  
worked in CVS.

The code would still be easily accessible (without having to remember  
in which release it was removed from the main branch) and could be  
used as basis for forks outside the python org.

What’s more important: you get to keep the history for free and  
without having to run git filter scripts.

---

<div class="post-metadata">

**Author:** ![hroncok](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hroncok/32/18696_2.png) [@hroncok](https://discuss.python.org/u/hroncok)\
**Post date:** [October 3, 2022, 11:28pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/35 "2022-10-03T23:28:58Z")

</div>

For the record, we install [pathfix.py](https://github.com/python/cpython/blob/main/Tools/scripts/pathfix.py) to `/usr/bin` in `python3-devel` Fedora package, as we use the script when we build Python packages. If the script goes away, we will need to ship it differently.

---

<div class="post-metadata">

**Author:** ![PeterL](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/peterl/32/2076_2.png) [@PeterL](https://discuss.python.org/u/PeterL)\
**Post date:** [October 6, 2022, 1:31am UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/36 "2022-10-06T01:31:36Z")

</div>

I was sad to see pynche (“Punchie”) go!  
It was a nice, simple demo of the capabilities of `tkinter` (IDLE is too hard for a beginner to have a go at understanding, so I used pynche as an example in my courses. My clients often don’t have any install rights, or internet is not available, so installing is not always possible.)  
And it was actually a useful colour picker.

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [October 6, 2022, 12:13pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/37 "2022-10-06T12:13:19Z")

</div>

> [@PeterL](#):
>
> I was sad to see pynche (“Punchie”) go!

It’s still around: it was just moved to [Barry Warsaw / pynche · GitLab](https://gitlab.com/warsaw/pynche)

@barry: Maybe you should mention your repository in What’s New in Python 3.11?

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/barry/32/42_2.png) [@barry](https://discuss.python.org/u/barry)\
**Post date:** [October 6, 2022, 5:01pm UTC](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571/38 "2022-10-06T17:01:33Z")

</div>

Good idea! (P.S. I pronounce it “pinch-ee” 😄)

[Previous page](https://discuss.python.org/t/remove-outdated-tools-scripts-scripts/19571.md?page=1)
