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

Handling checking for OSs better #2023

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Handling checking for OSs better #2023

merged 1 commit into from
Nov 26, 2024

Conversation

john-science
Copy link
Member

@john-science john-science commented Nov 26, 2024

What is the change?

I went through all instance of sys.platform in ARMI to check that we were handling it correcty.

Why is the change being made?

The problem I found was people were doing this to test if the current OS is Windows:

"win" in sys.platform

This is because sys.platform returns "win32" for Windows, but it also returns "darwin" for MacOS.

Here is a helpful table:

┍━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━┑
│ System              │ Value               │
┝━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━┥
│ Linux               │ linux or linux2     │
│ Windows             │ win32               │
│ Windows/Cygwin      │ cygwin              │
│ Windows/MSYS2       │ msys                │
│ MacOS               │ darwin              │
│ OS/2                │ os2                 │
│ OS/2 EMX            │ os2emx              │
│ RiscOS              │ riscos              │
│ AtheOS              │ atheos              │
│ FreeBSD 7           │ freebsd7            │
│ FreeBSD 8           │ freebsd8            │
│ FreeBSD N           │ freebsdN            │
│ OpenBSD 6           │ openbsd6            │
│ AIX                 │ aix                 │
┕━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┙

Checklist

  • The release notes have been updated if necessary.
  • The documentation is still up-to-date in the doc folder.
  • The dependencies are still up-to-date in pyproject.toml.

@john-science john-science added the cleanup Code/comment cleanup: Low Priority label Nov 26, 2024
@opotowsky opotowsky merged commit 33acc81 into main Nov 26, 2024
22 checks passed
@opotowsky opotowsky deleted the darwin_macos branch November 26, 2024 22:43
drewj-tp added a commit that referenced this pull request Nov 27, 2024
…pin-dep

* origin/main:
  Moving from shutil.copy to safeCopy (#2024)
  Move files from temporary directory changer (#2022)
  Handling checking for OSs better (#2023)
  Expose some skip inspection options for `armi.init` and `db.loadOperator` (#2005)
  Adding setting to control MCNP / ENDF library (#1989)
  Improving logging on ISOTXS compare  (#2013)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code/comment cleanup: Low Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants