Don't run lsb_release on linux (#26707)

Running `lsb_release` on Linux takes about 50ms because it is written in
Python. We do not use the output, so this change makes use not call it.
This commit is contained in:
Harmen Stoppels 2021-10-14 01:27:24 +02:00 committed by GitHub
parent 0227fc3ddc
commit fcac95b065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -38,6 +38,7 @@
* Homepage: https://pypi.python.org/pypi/distro
* Usage: Provides a more stable linux distribution detection.
* Version: 1.0.4 (last version supporting Python 2.6)
* Note: Patched to disable lsb_release by default to improve Spack's startup time.
functools
---------

View File

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Spack managed modifications: use include_lsb=False by default.
"""
The ``distro`` package (``distro`` stands for Linux Distribution) provides
information about the Linux distribution it runs on, such as a reliable
@ -1072,7 +1074,7 @@ def _parse_distro_release_content(line):
return distro_info
_distro = LinuxDistribution()
_distro = LinuxDistribution(include_lsb=False)
def main():