diff --git a/changelog.md b/changelog.md index abed7d43..c64c4032 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ - Add `is_` 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) diff --git a/extra_platforms/__init__.py b/extra_platforms/__init__.py index b496772a..b241a23f 100644 --- a/extra_platforms/__init__.py +++ b/extra_platforms/__init__.py @@ -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, @@ -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 @@ -247,10 +247,10 @@ def current_os() -> Platform: "IBM_POWERKVM", # noqa: F405 "is_aix", # noqa: F405 "is_all_platforms", # noqa: F405 - "is_all_windows", # noqa: F405 "is_altlinux", # noqa: F405 "is_amzn", # noqa: F405 "is_android", # noqa: F405 + "is_any_windows", # noqa: F405 "is_arch", # noqa: F405 "is_bsd", # noqa: F405 "is_bsd_without_macos", # noqa: F405 diff --git a/extra_platforms/groups.py b/extra_platforms/groups.py index ed08f93b..c5e8c3e8 100644 --- a/extra_platforms/groups.py +++ b/extra_platforms/groups.py @@ -145,7 +145,7 @@ def issuperset(self, other: Group | Iterable[Platform]) -> bool: ALL_PLATFORMS: Group = Group( "all_platforms", - "Any platforms", + "All platforms", "🖥️", ( AIX, @@ -196,7 +196,7 @@ 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.""" @@ -204,7 +204,7 @@ def issuperset(self, other: Group | Iterable[Platform]) -> bool: "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.""" @@ -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, diff --git a/readme.md b/readme.md index a800eeae..375f6893 100644 --- a/readme.md +++ b/readme.md @@ -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 ``` @@ -418,7 +418,7 @@ flowchart linux_xenserver(xenserver
XenServer) end subgraph "extra_platforms.ALL_WINDOWS
🪟 Any Windows" - all_windows_windows(windows
🪟 Windows) + any_windows_windows(windows
🪟 Windows) end subgraph "extra_platforms.BSD
🅱️ Any BSD" bsd_freebsd(freebsd
😈 FreeBSD) diff --git a/tests/test_platforms.py b/tests/test_platforms.py index a8b44786..c671bf23 100644 --- a/tests/test_platforms.py +++ b/tests/test_platforms.py @@ -31,10 +31,10 @@ ALL_GROUPS, ALL_OS_LABELS, ALL_PLATFORMS, - ALL_WINDOWS, ALTLINUX, AMZN, ANDROID, + ANY_WINDOWS, ARCH, BSD, BSD_WITHOUT_MACOS, @@ -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 == ( @@ -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}), (