Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect OS Version Displayed for Windows 11 in marimo env Command #1409

Closed
Haleshot opened this issue May 19, 2024 · 2 comments · Fixed by #1410
Closed

Incorrect OS Version Displayed for Windows 11 in marimo env Command #1409

Haleshot opened this issue May 19, 2024 · 2 comments · Fixed by #1410
Labels
bug Something isn't working

Comments

@Haleshot
Copy link
Contributor

Haleshot commented May 19, 2024

Describe the bug

The marimo env command incorrectly displays the OS version as "10" for Windows 11 systems. This issue arises because the platform.release() function relies on the version of the kernel32.dll file, which remains unchanged between Windows 10 and Windows 11. As a result, the actual Windows version is not accurately reflected.

Workaround or Plan to Submit a PR

I have identified a solution that involves using sys.getwindowsversion().build to determine if the OS is Windows 11 and updating the OS Version field accordingly. I am planning to submit a PR with the necessary changes to fix this issue.

Stack Trace or Screenshots

N/A


Here’s the problematic output:

{
  "marimo": "0.3.7",
  "OS": "Windows",
  "OS Version": "10",
  "Processor": "AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD",
  "Python Version": "3.11.4",
  "Binaries": {
    "Browser": "--",
    "Node": "v18.17.0"
  },
  "Requirements": {
    "click": "8.1.6",
    "importlib-resources": "6.3.2",
    "jedi": "0.19.0",
    "markdown": "3.6",
    "pymdown-extensions": "10.7.1",
    "pygments": "2.15.1",
    "tomlkit": "0.12.4",
    "uvicorn": "0.29.0",
    "starlette": "0.37.2",
    "websocket": "missing",
    "typing-extensions": "4.10.0",
    "black": "24.3.0"
  }
}

The OS Version should reflect "11" for Windows 11 systems instead of "10".

Environment

{
  "marimo": "0.3.7",
  "OS": "Windows",
  "OS Version": "10",
  "Processor": "AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD",
  "Python Version": "3.11.4",
  "Binaries": {
    "Browser": "--",
    "Node": "v18.17.0"
  },
  "Requirements": {
    "click": "8.1.6",
    "importlib-resources": "6.3.2",
    "jedi": "0.19.0",
    "markdown": "3.6",
    "pymdown-extensions": "10.7.1",
    "pygments": "2.15.1",
    "tomlkit": "0.12.4",
    "uvicorn": "0.29.0",
    "starlette": "0.37.2",
    "websocket": "missing",
    "typing-extensions": "4.10.0",
    "black": "24.3.0"
  }
}

Code to reproduce

To reproduce the issue, simply run the marimo env command on a Windows 11 machine. The command faces issues in displaying when the OS version is 11.

Alternatively, you can use the following minimal reproducible example to observe the issue:

# Example code to reproduce the issue

import platform

def get_system_info():
    info = {
        "OS": platform.system(),
        "OS Version": platform.release(),  # This will show "10" on Windows 11
        "Processor": platform.processor(),
        "Python Version": platform.python_version(),
    }
    return info

if __name__ == "__main__":
    system_info = get_system_info()
    print(system_info)

Running this code on a Windows 11 machine will display the incorrect OS version:

python example.py

Expected Output (on Windows 11):

{
  "OS": "Windows",
  "OS Version": "10",  # Incorrectly shows "10" instead of "11"
  "Processor": "AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD",
  "Python Version": "3.11.4"
}
@Haleshot Haleshot added the bug Something isn't working label May 19, 2024
@Haleshot
Copy link
Contributor Author

PS: Also let me know if I can help in setting up a PR template in the .github section. Can help in maintaining uniformity throughout while reviewing PRs.

@Haleshot Haleshot changed the title Incorrect OS Version Displayed for Windows 11 in marimo env Command Incorrect OS Version Displayed for Windows 11 in marimo env Command May 19, 2024
@mscolnick
Copy link
Contributor

mscolnick commented May 19, 2024

@Haleshot - if you have a good PR template that you have used and recommend, it would be great to incorporate it. I agree it would help with maintaining uniformity

(and thank you for the contribution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants