Repository: numba/numba

Issue:
`platform.linux_distribution` is deprecated
I was looking into the output of `numba -s` and found that the code is using `platform.linux_distribution` which is now [deprecated](https://bugs.python.org/issue1322).

The issue is located in [`numba_entry.py` line 98](https://github.com/numba/numba/blob/2b613798cf548e247e81b54b2cf0930d9865040b/numba/misc/numba_entry.py#L98)

A suggested alternative is to use the [distro package](https://pypi.org/project/distro/) or use some form of custom heuristic. 

Another way around it would be to simply ignore this information!


Discussion:
This was [removed in Python 3.8](https://bugs.python.org/issue28167), so when `numba -s` is run on it, we just get an error:

```
$ numba -s
System info:
--------------------------------------------------------------------------------
__Time Stamp__
2020-04-09 14:38:50.980937

__Hardware Information__
Machine                                       : x86_64
CPU Name                                      : skylake
Number of accessible CPU cores                : 8
Listed accessible CPUs cores                  : 0-7
CFS restrictions                              : None
CPU Features                                  : 
64bit adx aes avx avx2 bmi bmi2 clflushopt cmov cx16 f16c fma fsgsbase invpcid
lzcnt mmx movbe pclmul popcnt prfchw rdrnd rdseed rtm sahf sse sse2 sse3 sse4.1
sse4.2 ssse3 xsave xsavec xsaveopt xsaves

__OS Information__
Platform                                      : Linux-5.3.0-42-generic-x86_64-with-glibc2.10
Release                                       : 5.3.0-42-generic
System Name                                   : Linux
Version                                       : #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020
Error: System name incorrectly identified or unknown.

__Python Information__
Python Compiler                               : GCC 7.3.0
Python Implementation                         : CPython
Python Version                                : 3.8.2
Python Locale                                 : en_GB UTF-8

...
```
How do we want to fix this? It seems that the distribution info can be found in three locations:

  a) Inside the `/etc/lsb-release` file
  b) In the name of the `/etc/<distrib>-release` file
  c) In the content of the `/etc/<distrib>-release` file
Given that it seems non-trivial to get right, I'd lean towards an optional dependency on (or vendoring if appropriate) of the distro package rather than adding some custom code to try to work it out. Any thoughts @esc? (Because you commented on the other similar issue)
I am also in favor of optional dependencies over vendoring, if possible.
I'd go with optional dependency, conditional on it being something well maintained and widely available e.g. in Anaconada distro. Also worth noting that when I wrote `numba -s` I just made it dump out absolutely everything that was available and looked useful opposed to some carefully curated list, another option is to simply decide that it isn't useful and remove it.
If I may ask, is it worth the effort of an optional dependency? On my machine the kernel name gives it away. I understand that it was part of the output when it was easy to reach but now that it's gone, removing the feature is not entirely ruled out. Happy either way. 
It may well not be worth it - to me it seems pretty acceptable to just remove the distro name from the output.
I'm fine with removal. It can always be added back in if proven useful.

Resolving patch:
diff --git a/numba/misc/numba_entry.py b/numba/misc/numba_entry.py
--- a/numba/misc/numba_entry.py
+++ b/numba/misc/numba_entry.py
@@ -95,7 +95,7 @@ def scrape_lines(loc):
         print(fmt % ("Version", platform.version()))
         try:
             if system_name == 'Linux':
-                info = platform.linux_distribution()
+                info = ()
             elif system_name == 'Windows':
                 info = platform.win32_ver()
             elif system_name == 'Darwin':


Test patch: