Skip to content

Commit

Permalink
Rename ALL_WINDOWS group to ANY_WINDOWS
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Sep 11, 2024
1 parent 4cbe89a commit 7c6e9ac
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add `is_<group_id>` booleans to module root to test the membership of the current platform to that group.
- Rename `ALL_LINUX` group to `LINUX`.
- Rename `ALL_WINDOWS` group to `ANY_WINDOWS`.

## [1.2.1 (2024-09-04)](https://github.com/kdeldycke/extra-platforms/compare/v1.2.0...v1.2.1)

Expand Down
6 changes: 3 additions & 3 deletions extra_platforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def cache(user_function):
from .groups import ( # noqa: E402
ALL_GROUPS,
ALL_PLATFORMS,
ALL_WINDOWS,
ANY_WINDOWS,
BSD,
BSD_WITHOUT_MACOS,
EXTRA_GROUPS,
Expand Down Expand Up @@ -221,10 +221,10 @@ def current_os() -> Platform:
"ALL_GROUPS", # noqa: F405
"ALL_OS_LABELS", # noqa: F405
"ALL_PLATFORMS", # noqa: F405
"ALL_WINDOWS", # noqa: F405
"ALTLINUX", # noqa: F405
"AMZN", # noqa: F405
"ANDROID", # noqa: F405
"ANY_WINDOWS", # noqa: F405
"ARCH", # noqa: F405
"BSD", # noqa: F405
"BSD_WITHOUT_MACOS", # noqa: F405
Expand All @@ -247,10 +247,10 @@ def current_os() -> Platform:
"IBM_POWERKVM", # noqa: F405
"is_aix", # noqa: F405
"is_all_platforms", # noqa: F405

Check failure on line 249 in extra_platforms/__init__.py

View workflow job for this annotation

GitHub Actions / autofix / Format Python

Ruff (F822)

extra_platforms/__init__.py:249:5: F822 Undefined name `is_all_platforms` in `__all__`
"is_all_windows", # noqa: F405
"is_altlinux", # noqa: F405
"is_amzn", # noqa: F405
"is_android", # noqa: F405
"is_any_windows", # noqa: F405

Check failure on line 253 in extra_platforms/__init__.py

View workflow job for this annotation

GitHub Actions / autofix / Format Python

Ruff (F822)

extra_platforms/__init__.py:253:5: F822 Undefined name `is_any_windows` in `__all__`
"is_arch", # noqa: F405
"is_bsd", # noqa: F405

Check failure on line 255 in extra_platforms/__init__.py

View workflow job for this annotation

GitHub Actions / autofix / Format Python

Ruff (F822)

extra_platforms/__init__.py:255:5: F822 Undefined name `is_bsd` in `__all__`
"is_bsd_without_macos", # noqa: F405

Check failure on line 256 in extra_platforms/__init__.py

View workflow job for this annotation

GitHub Actions / autofix / Format Python

Ruff (F822)

extra_platforms/__init__.py:256:5: F822 Undefined name `is_bsd_without_macos` in `__all__`
Expand Down
8 changes: 4 additions & 4 deletions extra_platforms/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def issuperset(self, other: Group | Iterable[Platform]) -> bool:

ALL_PLATFORMS: Group = Group(
"all_platforms",
"Any platforms",
"All platforms",
"🖥️",
(
AIX,
Expand Down Expand Up @@ -196,15 +196,15 @@ def issuperset(self, other: Group | Iterable[Platform]) -> bool:
"""All recognized platforms."""


ALL_WINDOWS = Group("all_windows", "Any Windows", "🪟", (WINDOWS,))
ANY_WINDOWS = Group("any_windows", "Any Windows", "🪟", (WINDOWS,))
"""All Windows operating systems."""


UNIX = Group(
"unix",
"Any Unix",
"⨷",
tuple(p for p in ALL_PLATFORMS.platforms if p not in ALL_WINDOWS),
tuple(p for p in ALL_PLATFORMS.platforms if p not in ANY_WINDOWS),
)
"""All Unix-like operating systems and compatibility layers."""

Expand Down Expand Up @@ -413,7 +413,7 @@ def issuperset(self, other: Group | Iterable[Platform]) -> bool:

NON_OVERLAPPING_GROUPS: frozenset[Group] = frozenset(
(
ALL_WINDOWS,
ANY_WINDOWS,
BSD,
LINUX,
LINUX_LAYERS,
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ linux_layers,wsl1,1
linux_layers,wsl2,1
unix_layers,cygwin,1
other_unix,hurd,1
all_windows,windows,1
any_windows,windows,1
```

<!-- platform-sankey-end -->
Expand Down Expand Up @@ -418,7 +418,7 @@ flowchart
linux_xenserver(<code>xenserver</code><br/>❓ <em>XenServer</em>)
end
subgraph "<code>extra_platforms.ALL_WINDOWS</code><br/>🪟 <em>Any Windows</em>"
all_windows_windows(<code>windows</code><br/>🪟 <em>Windows</em>)
any_windows_windows(<code>windows</code><br/>🪟 <em>Windows</em>)
end
subgraph "<code>extra_platforms.BSD</code><br/>🅱️ <em>Any BSD</em>"
bsd_freebsd(<code>freebsd</code><br/>😈 <em>FreeBSD</em>)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
ALL_GROUPS,
ALL_OS_LABELS,
ALL_PLATFORMS,
ALL_WINDOWS,
ALTLINUX,
AMZN,
ANDROID,
ANY_WINDOWS,
ARCH,
BSD,
BSD_WITHOUT_MACOS,
Expand Down Expand Up @@ -540,7 +540,7 @@ def test_logical_grouping():
assert BSD.issuperset(BSD_WITHOUT_MACOS)

# All platforms are divided into Windows and Unix at the highest level.
assert {p.id for p in ALL_PLATFORMS} == ALL_WINDOWS.platform_ids | UNIX.platform_ids
assert {p.id for p in ALL_PLATFORMS} == ANY_WINDOWS.platform_ids | UNIX.platform_ids

# All UNIX platforms are divided into BSD, Linux, and Unix families.
assert UNIX.platform_ids == (
Expand Down Expand Up @@ -591,10 +591,10 @@ def test_overlapping_groups():
([UNIX], {UNIX}),
([UNIX, UNIX], {UNIX}),
([UNIX, AIX], {UNIX}),
([WINDOWS], {ALL_WINDOWS}),
([WINDOWS], {ANY_WINDOWS}),
([ALL_PLATFORMS, WINDOWS], {ALL_PLATFORMS}),
([UNIX, WINDOWS], {ALL_PLATFORMS}),
([UNIX, ALL_WINDOWS], {ALL_PLATFORMS}),
([UNIX, ANY_WINDOWS], {ALL_PLATFORMS}),
([BSD_WITHOUT_MACOS, UNIX], {UNIX}),
([BSD_WITHOUT_MACOS, MACOS], {BSD}),
(
Expand Down

0 comments on commit 7c6e9ac

Please sign in to comment.