gh-36977: `sage --package metrics`: New tool to assist discussions of the Sage distribution
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
Discussions of the complexity of the Sage distribution pop up
unexpectedly, as seen in
https://github.com/sagemath/sage/pull/36982#issuecomment-1873202140,
https://github.com/sagemath/sage/pull/36982#issuecomment-1874285785,
https://github.com/sagemath/sage/pull/36982#issuecomment-1874328804,
https://github.com/sagemath/sage/pull/36982#issuecomment-1874446757,
https://github.com/sagemath/sage/pull/36982#issuecomment-1874452301,
https://github.com/sagemath/sage/pull/36982#issuecomment-1874454350,
https://github.com/sagemath/sage/pull/36982#issuecomment-1874557090
https://github.com/sagemath/sage/pull/36726#issuecomment-1821618629,
https://github.com/sagemath/sage/pull/36726#issuecomment-1821795302,
https://github.com/sagemath/sage/pull/36726#issuecomment-1836736491,
https://github.com/sagemath/sage/pull/36726#issuecomment-1837111688,
https://github.com/sagemath/sage/pull/36726#issuecomment-1838189407,
https://github.com/sagemath/sage/pull/36726#issuecomment-1838759510,
https://github.com/sagemath/sage/pull/36726#issuecomment-1839341903,
https://github.com/sagemath/sage/pull/36726#issuecomment-1839596640,
https://github.com/sagemath/sage/pull/36726#issuecomment-1840193953,
https://github.com/sagemath/sage/pull/36726#issuecomment-1840362382,
https://github.com/sagemath/sage/pull/36726#issuecomment-1843422890,
https://github.com/sagemath/sage/pull/36726#issuecomment-1843584828,
https://github.com/sagemath/sage/pull/36726#issuecomment-1843760600,
https://github.com/sagemath/sage/pull/36726#issuecomment-1846117906,
https://github.com/sagemath/sage/pull/36726#issuecomment-1848641519,
https://github.com/sagemath/sage/pull/36726#issuecomment-1871890028,
https://github.com/sagemath/sage/pull/36726#issuecomment-1872063393
https://github.com/sagemath/sage/pull/36777#issuecomment-1832416522,
https://github.com/sagemath/sage/pull/36777#issuecomment-1832818351,
https://github.com/sagemath/sage/pull/36777#issuecomment-1833364886,
https://github.com/sagemath/sage/pull/36777#issuecomment-1836881844,
https://github.com/sagemath/sage/pull/36777#issuecomment-1837100711,
https://github.com/sagemath/sage/pull/36777#issuecomment-1837426485
To help put such discussions on a solid factual basis, we introduce the
command `sage --package metrics`.
```
$ ./sage -package metrics :standard:
has_file_distros_arch_txt=131
has_file_distros_conda_txt=216
has_file_distros_debian_txt=125
has_file_distros_fedora_txt=138
has_file_distros_gentoo_txt=181
has_file_distros_homebrew_txt=61
has_file_distros_macports_txt=129
has_file_distros_nix_txt=51
has_file_distros_opensuse_txt=146
has_file_distros_slackware_txt=25
has_file_distros_void_txt=184
has_file_patches=35
has_file_spkg_check=59
has_file_spkg_configure_m4=222
has_file_spkg_install=198
has_tarball_upstream_url=231
line_count_file_patches=22561
line_count_file_spkg_check=402
line_count_file_spkg_configure_m4=2792
line_count_file_spkg_install=2960
packages=272
type_standard=272
```
Use `PATH=build/bin:$PATH SAGE_ROOT=some-other-worktree build/bin/sage-
package metrics :standard:` to obtain the metrics of another version of
Sage in some other worktree.
We add computation and before/after comparison of the metrics to the CI
Linux Incremental workflow.
As an illustration, we change one Python package from "normal" to
"wheel", removing an `spkg-install.in` file in the process. See https://
github.com/sagemath/sage/actions/runs/7342841283/job/19992606617?pr=3697
7#step:6:12
More metrics can be added after
- #36740
<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->
### :memo: Checklist
<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.
### :hourglass: Dependencies
<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
URL: https://github.com/sagemath/sage/pull/36977
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe