Skip to content

Commit 8fbbc3b

Browse files
authored
Merge pull request #99 from aboutcode-org/add-os
Add sunos and haiku
2 parents cff2a3b + d9bc676 commit 8fbbc3b

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

.github/workflows/docs-ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ jobs:
1212
python-version: [3.12]
1313

1414
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
15+
- name: Checkout repository
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
with:
18+
persist-credentials: false # do not keep the token around
1719

1820
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2022
with:
2123
python-version: ${{ matrix.python-version }}
2224

.github/workflows/pypi-release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ jobs:
2424
runs-on: ubuntu-24.04
2525

2626
steps:
27-
- uses: actions/checkout@v4
28-
- name: Set up Python
29-
uses: actions/setup-python@v5
27+
- name: Checkout repository
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
persist-credentials: false # do not keep the token around
31+
32+
- name: Set up Python 3.12
33+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3034
with:
3135
python-version: 3.12
3236

src/commoncode/system.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def os_arch():
3030
os = "mac"
3131
elif "freebsd" in sys_platform:
3232
os = "freebsd"
33+
elif "sunos" in sys_platform:
34+
os = "sunos"
35+
elif "haiku" in sys_platform:
36+
os = "haiku"
3337
else:
3438
raise Exception("Unsupported OS/platform %r" % sys_platform)
3539
return os, arch
@@ -45,7 +49,9 @@ def os_arch():
4549
on_mac = current_os == "mac"
4650
on_linux = current_os == "linux"
4751
on_freebsd = current_os == "freebsd"
48-
on_posix = not on_windows and (on_mac or on_linux or on_freebsd)
52+
on_sunos = current_os == "sunos"
53+
on_haiku = current_os == "haiku"
54+
on_posix = not on_windows and (on_mac or on_linux or on_freebsd or on_sunos or on_haiku)
4955

5056
current_os_arch = "%(current_os)s-%(current_arch)s" % locals()
5157
noarch = "noarch"

0 commit comments

Comments
 (0)