banesullivan / scooby

🐶 🕵️ Great Dane turned Python environment detective
MIT License
47 stars 12 forks source link

ENH. Add name and version of current linux distribution. #119

Closed carsten-forty2 closed 4 months ago

carsten-forty2 commented 5 months ago

It would be nice and helpful if we also have the name and version for the Linux distribution under OS . It looks like this for my os.

--------------------------------------------------------------------------------
  Date: Thu Apr 18 18:36:14 2024 CEST

                OS : Linux (Gentoo 2.14)
            CPU(s) : 32
           Machine : x86_64
      Architecture : 64bit
               RAM : 62.6 GiB
       Environment : Python
       File system : ext4

  Python 3.11.8 (main, Mar 21 2024, 00:53:58) [GCC 13.2.1 20240113]

             numpy : 1.26.3
             scipy : 1.12.0
           IPython : 8.21.0
        matplotlib : 3.8.2
            scooby : 0.9.2
--------------------------------------------------------------------------------

The PR adds some placeholder for other platforms (Mac/Windows/Java) and would need some parsing for these platforms. I don't have access to them to test.

Thanks for considering this PR.

Cheers Carsten

prisae commented 5 months ago

Thanks for your PR @carsten-forty2! I like this, what do you think @banesullivan? I do not have Mac/Windows either, but from my perspective we could also pull this in for Linux only, and add other platforms at a later point.

banesullivan commented 5 months ago

This is a great addition! I have access to a few different machines, architectures, and distributions so I'll do some testing and make sure this works

banesullivan commented 5 months ago

I made a few changes to support macOS and put all of this in some general try/catch statements to guarantee it doesn't fail. While I added the info for Windows, I did not test this and simply used the return type from docs (I'm too lazy to boot up Windows 🤣, but I'll try to test this on CI or something)

banesullivan commented 5 months ago

@ThomasMGeo, would you be up for trying this out on Windows and letting us know what's most relevant from import platform;platform.win32_ver()?