There's a closed pull request on the void-packages repository Drop default python_version in xbps-src https://github.com/void-linux/void-packages/pull/21209 Description: This is a second attempt at #21132 following the recommendation of @q66. With the help of @Duncaen, I've identified (almost) all of the packages that currently rewrite python shebangs to the current default, `python2`. Those packages that do **not** create a `/usr/lib/pythonX.Y` directory have had `python_version=2` explicitly added to their templates. Note that I did not bump the revisions, becasuse there is no need to rebuild the packges for this change. I've also cleaned up a few `xlint` failures in some packages. All packages that have `python3` shebangs are assumed to satisfy one of two conditions: 1. Any python scripts in the package explicitly use a `python3` shebang, which is never modified by the `xbps-src` rewrite hook. (The hook only modifies `python` or `pythonX.Y` shebangs.) 2. The package explicitly sets `python_version=3` to instruct the hook to use the correct version. In either case, there is no need to alter these packages. In addition, I have removed the default `python_version=2` in `common/environment/setup/python.sh` and modified `common/hooks/pre-pkg/03-rewrite-python-shebang.sh` to do the "right" thing with `python_version`: 1. As before, iff the package installs something to exactly one `usr/lib/pythonX.Y` python libdir, a default `python_version` will be inferred from the directory name. (Note: if the package creates more than one python libdir, the test in the hook will fail, so no default `python_version` will be derived in this case.) 2. A manual declaration of `python_version` in a template will override this default (or lack of a default). 3. Iff a default or explicit `python_version` has been specified, an approriate "target" shebang will be created. 4. If any python scripts are detected in the package, their shebangs will be replaced iff the appropriate target shebang was created; otherwise, if no target shebang was determined but at least one python script is found, package building will fail with a hard error. These changes minimize the chance for package breakage because of the disappearing default `python_version` and, if I've missed anything, it should be detected the next time one of these packages is rebuilt. Note that some packages may have already installed broken scripts from relying on the default `python_version=2` if the scripts actually target `python3`. This PR does not attempt to detect or fix those, but instead seeks to preserve existing behavior without adding additional breakage.