extra_platforms packageΒΆ
Expose package-wide elements.
- extra_platforms.extract_members(*other)[source]ΒΆ
Returns all traits found in
other.othercan be an arbitrarily nestedIterableofGroup,Trait, or their IDs.Nonevalues and empty iterables are silently ignored.Caution
Can returns duplicates.
- extra_platforms.platforms_from_ids(*trait_and_group_ids)ΒΆ
Alias
platforms_from_idsβtraits_from_ids().Deprecated since version 6.0.0: Use
traits_from_ids()instead.
SubmodulesΒΆ
extra_platforms.architecture_data moduleΒΆ
Architecture definitions and metadata.
See also
Architecture variants from Rustβs target-lexicon.
Todo
Add mapping of architecture to manylinux Python targets? As per: - https://github.com/zaniebot/uv/blob/6e9a42e31b19f56abb69352c9e5b3b17a013ad45/crates/uv-platform-tags/src/platform.rs#L182-L199 - https://github.com/pypa/manylinux
- extra_platforms.architecture_data.AARCH64 = Architecture(id='aarch64', name='ARM64 (AArch64)')ΒΆ
Warning
Although
aarch64is the canonical ID for this architecture, some platforms may use the aliasarm64instead (e.g., macOS on Apple Silicon).Todo
Consider adding
arm64as an alias in the future.
- extra_platforms.architecture_data.ARMV5TEL = Architecture(id='armv5tel', name='ARMv5TE (little-endian)')ΒΆ
Note
ARMv5TE includes Thumb and DSP extensions. This architecture is found on older ARM devices and may appear in embedded systems or legacy platforms.
- extra_platforms.architecture_data.ARMV7L = Architecture(id='armv7l', name='ARMv7 (little-endian)')ΒΆ
Note
This architecture is commonly referred to as
armhf(ARM hard-float) in Debian-based distributions, or simplyarmv7in other contexts.
- extra_platforms.architecture_data.I386 = Architecture(id='i386', name='Intel 80386 (i386)')ΒΆ
Todo
Alias this to
i486.
- extra_platforms.architecture_data.PPC64LE = Architecture(id='ppc64le', name='PowerPC 64-bit (little-endian)')ΒΆ
Note
Also known as
powerpc64leorppc64elin some distributions.
- extra_platforms.architecture_data.X86_64 = Architecture(id='x86_64', name='x86-64 (AMD64)')ΒΆ
Warning
Although
x86_64is the canonical ID for this architecture, some platforms may use the aliasamd64instead (e.g., Windows on x86-64).Todo
Consider adding
amd64as an alias in the future.
extra_platforms.ci_data moduleΒΆ
CI definitions and metadata.
extra_platforms.detection moduleΒΆ
Heuristics to detect all traits of the current environment.
This collection of heuristics is designed as a set of separate function with minimal logic and dependencies. Theyβre the building blocks to evaluate the current environment.
All these heuristics can be hard-cached as the underlying system is not changing between code execution. They are still allowed to depends on each others, as long as youβre careful of not implementing circular dependencies.
Warning
Even if highly unlikely, it is possible to have multiple platforms detected for the same environment.
Typical example is Ubuntu WSL, which
will make both the is_wsl2() and
is_ubuntu() functions return True at the same time.
Thatβs because of the environment metadata, where:
$ uname -a
Linux 5.15.167.4-microsoft-standard-WSL2
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
That way we have the possibility elsewhere in extra-platforms to either decide
if we only allow one, and only one, heuristic to match the current system, or allow
for considering multiple systems at the same time.
Detection of Linux distribution rely on distro to gather as much details as possible.
And also because it is the recommended replacement for Pythonβs original
platform.linux_distribution function (which was removed in Python 3.8).
For all other traits, we either rely on:
environment variables
- extra_platforms.detection.is_aarch64()[source]ΒΆ
Return
Trueif current architecture isAARCH64.Caution
platform.machine()returns different values depending on the OS:Linux:
aarch64macOS:
arm64Windows:
ARM64
- Return type:
- extra_platforms.detection.is_armv5tel()[source]ΒΆ
Return
Trueif current architecture isARMV5TEL.- Return type:
- extra_platforms.detection.is_armv6l()[source]ΒΆ
Return
Trueif current architecture isARMV6L.- Return type:
- extra_platforms.detection.is_armv7l()[source]ΒΆ
Return
Trueif current architecture isARMV7L.- Return type:
- extra_platforms.detection.is_armv8l()[source]ΒΆ
Return
Trueif current architecture isARMV8L.- Return type:
- extra_platforms.detection.is_arm()[source]ΒΆ
Return
Trueif current architecture isARM.Hint
This is a fallback detection for generic ARM architecture. It will return
Truefor any ARM architecture not specifically covered by the more precise variants:is_aarch64(),is_armv5tel(),is_armv6l(),is_armv7l()oris_armv8l().- Return type:
- extra_platforms.detection.is_i386()[source]ΒΆ
Return
Trueif current architecture isI386.- Return type:
- extra_platforms.detection.is_i586()[source]ΒΆ
Return
Trueif current architecture isI586.- Return type:
- extra_platforms.detection.is_i686()[source]ΒΆ
Return
Trueif current architecture isI686.- Return type:
- extra_platforms.detection.is_x86_64()[source]ΒΆ
Return
Trueif current architecture isX86_64.Caution
Windows returns
AMD64in uppercase, so we normalize to lowercase.- Return type:
- extra_platforms.detection.is_mips()[source]ΒΆ
Return
Trueif current architecture isMIPS.- Return type:
- extra_platforms.detection.is_mipsel()[source]ΒΆ
Return
Trueif current architecture isMIPSEL.- Return type:
- extra_platforms.detection.is_mips64()[source]ΒΆ
Return
Trueif current architecture isMIPS64.- Return type:
- extra_platforms.detection.is_mips64el()[source]ΒΆ
Return
Trueif current architecture isMIPS64EL.- Return type:
- extra_platforms.detection.is_ppc()[source]ΒΆ
Return
Trueif current architecture isPPC.- Return type:
- extra_platforms.detection.is_ppc64()[source]ΒΆ
Return
Trueif current architecture isPPC64.- Return type:
- extra_platforms.detection.is_ppc64le()[source]ΒΆ
Return
Trueif current architecture isPPC64LE.- Return type:
- extra_platforms.detection.is_riscv32()[source]ΒΆ
Return
Trueif current architecture isRISCV32.- Return type:
- extra_platforms.detection.is_riscv64()[source]ΒΆ
Return
Trueif current architecture isRISCV64.- Return type:
- extra_platforms.detection.is_sparc()[source]ΒΆ
Return
Trueif current architecture isSPARC.- Return type:
- extra_platforms.detection.is_sparc64()[source]ΒΆ
Return
Trueif current architecture isSPARC64.- Return type:
- extra_platforms.detection.is_s390x()[source]ΒΆ
Return
Trueif current architecture isS390X.- Return type:
- extra_platforms.detection.is_loongarch64()[source]ΒΆ
Return
Trueif current architecture isLOONGARCH64.- Return type:
- extra_platforms.detection.is_wasm32()[source]ΒΆ
Return
Trueif current architecture isWASM32.Hint
WebAssembly detection is based on Emscriptenβs platform identifier.
- Return type:
- extra_platforms.detection.is_wasm64()[source]ΒΆ
Return
Trueif current architecture isWASM64.Hint
WebAssembly detection is based on Emscriptenβs platform identifier.
- Return type:
- extra_platforms.detection.is_unknown_architecture()[source]ΒΆ
Return
Trueif current architecture isUNKNOWN_ARCHITECTURE.- Return type:
- extra_platforms.detection.is_altlinux()[source]ΒΆ
Return
Trueif current platform isALTLINUX.- Return type:
- extra_platforms.detection.is_android()[source]ΒΆ
Return
Trueif current platform isANDROID.See also
Source: <https://github.com/kivy/kivy/blob/3c4b1dc84cdd930d352aab9be32c38e1c98bd5c6/kivy/utils.py#L435-L436>
- Return type:
- extra_platforms.detection.is_buildroot()[source]ΒΆ
Return
Trueif current platform isBUILDROOT.- Return type:
- extra_platforms.detection.is_cachyos()[source]ΒΆ
Return
Trueif current platform isCACHYOS.- Return type:
- extra_platforms.detection.is_centos()[source]ΒΆ
Return
Trueif current platform isCENTOS.- Return type:
- extra_platforms.detection.is_cloudlinux()[source]ΒΆ
Return
Trueif current platform isCLOUDLINUX.- Return type:
- extra_platforms.detection.is_cygwin()[source]ΒΆ
Return
Trueif current platform isCYGWIN.- Return type:
- extra_platforms.detection.is_debian()[source]ΒΆ
Return
Trueif current platform isDEBIAN.- Return type:
- extra_platforms.detection.is_dragonfly_bsd()[source]ΒΆ
Return
Trueif current platform isDRAGONFLY_BSD.- Return type:
- extra_platforms.detection.is_exherbo()[source]ΒΆ
Return
Trueif current platform isEXHERBO.- Return type:
- extra_platforms.detection.is_fedora()[source]ΒΆ
Return
Trueif current platform isFEDORA.- Return type:
- extra_platforms.detection.is_freebsd()[source]ΒΆ
Return
Trueif current platform isFREEBSD.- Return type:
- extra_platforms.detection.is_gentoo()[source]ΒΆ
Return
Trueif current platform isGENTOO.- Return type:
- extra_platforms.detection.is_haiku()[source]ΒΆ
Return
Trueif current platform isHAIKU.- Return type:
- extra_platforms.detection.is_hurd()[source]ΒΆ
Return
Trueif current platform isHURD.Caution
sys.platformcan returnsGNUorgnu0, see: <https://github.com/kdeldycke/extra-platforms/issues/308>- Return type:
- extra_platforms.detection.is_ibm_powerkvm()[source]ΒΆ
Return
Trueif current platform isIBM_POWERKVM.- Return type:
- extra_platforms.detection.is_illumos()[source]ΒΆ
Return
Trueif current platform isILLUMOS.Hint
Illumos is a Unix OS derived from OpenSolaris. It shares
sys.platform == 'sunos5'with Solaris, but can be distinguished by checkingplatform.uname().versionwhich contains βillumosβ on Illumos-based systems (like OpenIndiana, SmartOS, OmniOS).- Return type:
- extra_platforms.detection.is_kvmibm()[source]ΒΆ
Return
Trueif current platform isKVMIBM.- Return type:
- extra_platforms.detection.is_linuxmint()[source]ΒΆ
Return
Trueif current platform isLINUXMINT.- Return type:
- extra_platforms.detection.is_macos()[source]ΒΆ
Return
Trueif current platform isMACOS.- Return type:
- extra_platforms.detection.is_mageia()[source]ΒΆ
Return
Trueif current platform isMAGEIA.- Return type:
- extra_platforms.detection.is_mandriva()[source]ΒΆ
Return
Trueif current platform isMANDRIVA.- Return type:
- extra_platforms.detection.is_midnightbsd()[source]ΒΆ
Return
Trueif current platform isMIDNIGHTBSD.- Return type:
- extra_platforms.detection.is_netbsd()[source]ΒΆ
Return
Trueif current platform isNETBSD.- Return type:
- extra_platforms.detection.is_nobara()[source]ΒΆ
Return
Trueif current platform isNOBARA.- Return type:
- extra_platforms.detection.is_openbsd()[source]ΒΆ
Return
Trueif current platform isOPENBSD.- Return type:
- extra_platforms.detection.is_opensuse()[source]ΒΆ
Return
Trueif current platform isOPENSUSE.- Return type:
- extra_platforms.detection.is_oracle()[source]ΒΆ
Return
Trueif current platform isORACLE.- Return type:
- extra_platforms.detection.is_parallels()[source]ΒΆ
Return
Trueif current platform isPARALLELS.- Return type:
- extra_platforms.detection.is_pidora()[source]ΒΆ
Return
Trueif current platform isPIDORA.- Return type:
- extra_platforms.detection.is_raspbian()[source]ΒΆ
Return
Trueif current platform isRASPBIAN.- Return type:
- extra_platforms.detection.is_rocky()[source]ΒΆ
Return
Trueif current platform isROCKY.- Return type:
- extra_platforms.detection.is_scientific()[source]ΒΆ
Return
Trueif current platform isSCIENTIFIC.- Return type:
- extra_platforms.detection.is_slackware()[source]ΒΆ
Return
Trueif current platform isSLACKWARE.- Return type:
- extra_platforms.detection.is_solaris()[source]ΒΆ
Return
Trueif current platform isSOLARIS.- Return type:
- extra_platforms.detection.is_sunos()[source]ΒΆ
Return
Trueif current platform isSUNOS.- Return type:
- extra_platforms.detection.is_tumbleweed()[source]ΒΆ
Return
Trueif current platform isTUMBLEWEED.- Return type:
- extra_platforms.detection.is_tuxedo()[source]ΒΆ
Return
Trueif current platform isTUXEDO.- Return type:
- extra_platforms.detection.is_ubuntu()[source]ΒΆ
Return
Trueif current platform isUBUNTU.- Return type:
- extra_platforms.detection.is_ultramarine()[source]ΒΆ
Return
Trueif current platform isULTRAMARINE.- Return type:
- extra_platforms.detection.is_windows()[source]ΒΆ
Return
Trueif current platform isWINDOWS.- Return type:
- extra_platforms.detection.is_wsl1()[source]ΒΆ
Return
Trueif current platform isWSL1.Caution
The only difference between WSL1 and WSL2 is the case of the kernel release version:
WSL 1:
$ uname -r 4.4.0-22572-Microsoft
WSL 2:
$ uname -r 5.10.102.1-microsoft-standard-WSL2
- Return type:
- extra_platforms.detection.is_xenserver()[source]ΒΆ
Return
Trueif current platform isXENSERVER.- Return type:
- extra_platforms.detection.is_unknown_platform()[source]ΒΆ
Return
Trueif current platform isUNKNOWN_PLATFORM.- Return type:
- extra_platforms.detection.is_azure_pipelines()[source]ΒΆ
Return
Trueif current CI isAZURE_PIPELINES.See also
Environment variables reference: <https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&viewFallbackFrom=vsts&tabs=yaml#system-variables>.
- Return type:
- extra_platforms.detection.is_bamboo()[source]ΒΆ
Return
Trueif current CI isBAMBOO.See also
Environment variables reference: <https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html#Bamboovariables-Build-specificvariables>.
- Return type:
- extra_platforms.detection.is_buildkite()[source]ΒΆ
Return
Trueif current CI isBUILDKITE.See also
Environment variables reference: <https://buildkite.com/docs/pipelines/environment-variables>.
- Return type:
- extra_platforms.detection.is_circle_ci()[source]ΒΆ
Return
Trueif current CI isCIRCLE_CI.See also
Environment variables reference: <https://circleci.com/docs/reference/variables/#built-in-environment-variables>.
- Return type:
- extra_platforms.detection.is_cirrus_ci()[source]ΒΆ
Return
Trueif current CI isCIRRUS_CI.See also
Environment variables reference: <https://cirrus-ci.org/guide/writing-tasks/#environment-variables>.
- Return type:
- extra_platforms.detection.is_codebuild()[source]ΒΆ
Return
Trueif current CI isCODEBUILD.See also
Environment variables reference: <https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html>.
- Return type:
- extra_platforms.detection.is_github_ci()[source]ΒΆ
Return
Trueif current CI isGITHUB_CI.See also
Environment variables reference: <https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables>.
- Return type:
- extra_platforms.detection.is_gitlab_ci()[source]ΒΆ
Return
Trueif current CI isGITLAB_CI.See also
Environment variables reference: <https://docs.gitlab.com/ci/variables/predefined_variables/#predefined-variables>.
- Return type:
- extra_platforms.detection.is_heroku_ci()[source]ΒΆ
Return
Trueif current CI isHEROKU_CI.See also
Environment variables reference: <https://devcenter.heroku.com/articles/heroku-ci#immutable-environment-variables>.
- Return type:
- extra_platforms.detection.is_teamcity()[source]ΒΆ
Return
Trueif current CI isTEAMCITY.See also
Environment variables reference: <https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html#PredefinedBuildParameters-ServerBuildProperties>.
- Return type:
- extra_platforms.detection.is_travis_ci()[source]ΒΆ
Return
Trueif current CI isTRAVIS_CI.See also
Environment variables reference: <https://docs.travis-ci.com/user/environment-variables/#default-environment-variables>.
- Return type:
- extra_platforms.detection.is_unknown_ci()[source]ΒΆ
Return
Trueif current CI isUNKNOWN_CI.- Return type:
- extra_platforms.detection.current_architecture(strict=False)[source]ΒΆ
Returns the
Architecturematching the current environment.Returns
UNKNOWN_ARCHITECTUREif not running inside a recognized architecture. To raise an error instead, setstricttoTrue.Important
Always raises an error if multiple architectures match.
- Return type:
- extra_platforms.detection.current_platform(strict=False)[source]ΒΆ
Always returns the best matching
Platformfor the current environment.Returns
UNKNOWN_PLATFORMif not running inside a recognized platform. To raise an error instead, setstricttoTrue.Important
If multiple platforms match the current environment, this function will try to select the best, informative one. Raises an error if we canβt decide on a single, appropriate platform.
- Return type:
- extra_platforms.detection.current_ci(strict=False)[source]ΒΆ
Returns the
CIsystem matching the current environment.Returns
UNKNOWN_CIif not running inside a recognized CI system. To raise an error instead, setstricttoTrue.Important
Always raises an error if multiple CI systems match.
- Return type:
- extra_platforms.detection.current_traits()[source]ΒΆ
Returns all traits matching the current environment.
This includes
Platform,Architecture, andCIsystems.Caution
Never returns
UNKNOWNtraits.Raises
SystemErrorif the current environment is not recognized at all.Attention
At this point it is too late to worry about caching. This function has no choice but to evaluate all detection heuristics.
extra_platforms.group moduleΒΆ
Group a collection of traits. Also referred as families.
- extra_platforms.group.extract_members(*other)[source]ΒΆ
Returns all traits found in
other.othercan be an arbitrarily nestedIterableofGroup,Trait, or their IDs.Nonevalues and empty iterables are silently ignored.Caution
Can returns duplicates.
- class extra_platforms.group.Group(id, name, icon='β', members=<factory>)[source]ΒΆ
Bases:
_IdentifiableA
Groupidentifies a collection ofTraitmembers.Additionally of the common fields inherited from
_Identifiable, each group provides:members: An iterable ofTraitinstances that belong to this group.member_ids: Afrozensetof member IDs for quick lookup.canonical: Aboolindicating if the group is canonical (non-overlapping).various
set-like operations (union, intersection, difference, etc.).
- unknown_symbol: ClassVar[str] = 'UNKNOWN'ΒΆ
Groups use
UNKNOWNinstead ofUNKNOWN_GROUP.
- members: Iterable[Trait]ΒΆ
Traits in this group.
Normalized to
MappingProxyTypeat init, providing O(1) lookup by ID.
- generate_docstring()[source]ΒΆ
Generate comprehensive docstring for this group instance.
Combines the attribute docstring from the source module with various metadata.
- Return type:
- property canonical: boolΒΆ
Returns
Trueif the group is canonical (non-overlapping),Falseotherwise.A canonical group is one that does not share any members with other canonical groups. All canonical groups are non-overlapping.
Non-canonical groups are provided for convenience, but overlap with each other or with canonical groups.
Hint
Canonical groups are denoted with a β¬₯ symbol in the documentation and tables.
- isdisjoint(other)[source]ΒΆ
Return
Trueif the group has no members in common withother.Groups are disjoint if and only if their intersection is an empty
set.othercan be an arbitrarily nestedIterableofGroupandTrait.- Return type:
- fullyintersects(other)[source]ΒΆ
Return
Trueif the group has all members in common withother.- Return type:
- union(*others)[source]ΒΆ
Return a new
Groupwith members from the group and all others.Caution
The new
Groupwill inherits the metadata of the first one. All other groupsβ metadata will be ignored.- Return type:
- intersection(*others)[source]ΒΆ
Return a new
Groupwith members common to the group and all others.Caution
The new
Groupwill inherits the metadata of the first one. All other groupsβ metadata will be ignored.- Return type:
- difference(*others)[source]ΒΆ
Return a new
Groupwith members in the group that are not in the others.Caution
The new
Groupwill inherits the metadata of the first one. All other groupsβ metadata will be ignored.- Return type:
- symmetric_difference(other)[source]ΒΆ
Return a new
Groupwith members in either the group or other but not both.Caution
The new
Groupwill inherits the metadata of the first one. All other groupsβ metadata will be ignored.- Return type:
- copy(id=None, name=None, icon=None, members=None)[source]ΒΆ
Return a shallow copy of the group.
Fields can be overridden by passing new values as arguments.
- Return type:
- add(member)[source]ΒΆ
Return a new
Groupwith the specified trait added.If the trait is already in the group, returns a copy unchanged.
- Return type:
- remove(member)[source]ΒΆ
Return a new
Groupwith the specified trait removed.Raises
KeyErrorif the trait is not in the group.- Return type:
- discard(member)[source]ΒΆ
Return a new
Groupwith the specified trait removed if present.Unlike
remove(), this does not raise an error if the trait is not found.- Return type:
- clear()[source]ΒΆ
Return a new empty
Groupwith the same metadata.- Return type:
- Returns:
A new
Groupinstance with no members but same id, name, and icon.
- all_group: ClassVar[str] = 'ALL_GROUPS'ΒΆ
The symbol name for the group containing all instances of this type.
- data_module_id: ClassVar[str] = 'group_data'ΒΆ
The module name where instances of this type are defined.
- doc_page: ClassVar[str] = 'groups.md'ΒΆ
The documentation page filename.
- type_id: ClassVar[str] = 'group'ΒΆ
Machine-readable type identifier used to derive module and symbol names.
- type_name: ClassVar[str] = 'group'ΒΆ
Human-readable type name for documentation.
extra_platforms.group_data moduleΒΆ
Definitions of ready-to-use groups.
This module contains all predefined Group instances and
frozenset collections that organize traits into logical categories.
- extra_platforms.group_data.ALL_ARCHITECTURES: Group = Group(id='all_architectures', name='All architectures')ΒΆ
All recognized architectures.
Caution
This group does not contain the
UNKNOWN_ARCHITECTUREtrait.
- extra_platforms.group_data.ALL_ARM = Group(id='all_arm', name='ARM architectures')ΒΆ
All ARM-based architectures.
- extra_platforms.group_data.X86 = Group(id='x86', name='x86 family')ΒΆ
All x86-based architectures (Intel-compatible).
- extra_platforms.group_data.LOONGARCH = Group(id='loongarch', name='LoongArch')ΒΆ
LoongArch architecture.
- extra_platforms.group_data.ALL_MIPS = Group(id='all_mips', name='MIPS architectures')ΒΆ
All MIPS-based architectures.
- extra_platforms.group_data.POWERPC = Group(id='powerpc', name='PowerPC family')ΒΆ
All PowerPC-based architectures.
- extra_platforms.group_data.RISCV = Group(id='riscv', name='RISC-V family')ΒΆ
All RISC-V-based architectures.
- extra_platforms.group_data.ALL_SPARC = Group(id='all_sparc', name='SPARC architectures')ΒΆ
All SPARC-based architectures.
- extra_platforms.group_data.IBM_MAINFRAME = Group(id='ibm_mainframe', name='IBM mainframe')ΒΆ
IBM mainframe architectures.
- extra_platforms.group_data.WEBASSEMBLY = Group(id='webassembly', name='WebAssembly')ΒΆ
WebAssembly architectures.
- extra_platforms.group_data.ARCH_64_BIT = Group(id='arch_64_bit', name='64-bit architectures')ΒΆ
All 64-bit architectures.
- extra_platforms.group_data.ARCH_32_BIT = Group(id='arch_32_bit', name='32-bit architectures')ΒΆ
All 32-bit architectures.
- extra_platforms.group_data.ALL_PLATFORMS: Group = Group(id='all_platforms', name='All platforms')ΒΆ
All recognized platforms.
Caution
This group does not contain the
UNKNOWN_PLATFORMtrait.
- extra_platforms.group_data.ALL_WINDOWS = Group(id='all_windows', name='All Windows')ΒΆ
All Windows operating systems.
- extra_platforms.group_data.UNIX = Group(id='unix', name='All Unix')ΒΆ
All Unix-like operating systems and compatibility layers.
- extra_platforms.group_data.UNIX_WITHOUT_MACOS = Group(id='unix_without_macos', name='All Unix excluding macOS')ΒΆ
All Unix platforms, without macOS.
This is useful to avoid macOS-specific workarounds on Unix platforms.
- extra_platforms.group_data.BSD = Group(id='bsd', name='All BSD')ΒΆ
All BSD platforms.
Note
Are considered of this family (according Wikipedia):
386BSD (FreeBSD, NetBSD, OpenBSD, DragonFly BSD)
NeXTSTEP
Darwin (macOS, iOS, audioOS, iPadOS, tvOS, watchOS, bridgeOS)
SunOS
Ultrix
- extra_platforms.group_data.BSD_WITHOUT_MACOS = Group(id='bsd_without_macos', name='All BSD excluding macOS')ΒΆ
All BSD platforms, without macOS.
This is useful to avoid macOS-specific workarounds on BSD platforms.
- extra_platforms.group_data.LINUX = Group(id='linux', name='Linux distributions')ΒΆ
All distributions based on a Linux kernel.
- extra_platforms.group_data.LINUX_LAYERS = Group(id='linux_layers', name='Linux compatibility layers')ΒΆ
Interfaces that allows Linux binaries to run on a different host system.
- extra_platforms.group_data.LINUX_LIKE = Group(id='linux_like', name='All Linux & compatibility layers')ΒΆ
Sum of all Linux distributions and Linux compatibility layers.
- extra_platforms.group_data.SYSTEM_V = Group(id='system_v', name='AT&T System Five')ΒΆ
All Unix platforms derived from AT&T System Five.
Note
Are considered of this family (according Wikipedia):
A/UX
AIX
HP-UX
IRIX
OpenServer
Solaris
OpenSolaris
Illumos
Tru64
UNIX
UnixWare
- extra_platforms.group_data.UNIX_LAYERS = Group(id='unix_layers', name='Unix compatibility layers')ΒΆ
Interfaces that allows Unix binaries to run on a different host system.
Note
Are considered of this family (according Wikipedia):
Cygwin
Darling
Eunice
GNV
Interix
MachTen
Microsoft POSIX subsystem
MKS Toolkit
PASE
P.I.P.S.
PWS/VSE-AF
UNIX System Services
UserLAnd Technologies
Windows Services for UNIX
- extra_platforms.group_data.OTHER_POSIX = Group(id='other_posix', name='Other POSIX-compliant platforms')ΒΆ
All other UNIX-like or POSIX-compliant platforms.
Note
Are considered of this family (according Wikipedia):
Coherent
GNU/Hurd
HarmonyOS
LiteOS
LynxOS
Minix
MOS
OSF/1
QNX
BlackBerry 10
Research Unix
SerenityOS
- extra_platforms.group_data.ALL_CI = Group(id='all_ci', name='CI systems')ΒΆ
All recognized Continuous Integration systems.
Caution
This group does not contain the
UNKNOWN_CItrait.See also
- extra_platforms.group_data.UNKNOWN = Group(id='unknown', name='Unknown')ΒΆ
Unknown or unrecognized traits.
- extra_platforms.group_data.ALL_TRAITS = Group(id='all_traits', name='All architectures, platforms and CI systems')ΒΆ
All predefined architectures, platforms and CI systems.
Hint
This group includes all
UNKNOWN_*traits.
- extra_platforms.group_data.ALL_ARCHITECTURE_GROUPS: frozenset[Group] = frozenset({Group(id='loongarch', name='LoongArch'), Group(id='ibm_mainframe', name='IBM mainframe'), Group(id='all_arm', name='ARM architectures'), Group(id='all_sparc', name='SPARC architectures'), Group(id='arch_32_bit', name='32-bit architectures'), Group(id='x86', name='x86 family'), Group(id='powerpc', name='PowerPC family'), Group(id='riscv', name='RISC-V family'), Group(id='webassembly', name='WebAssembly'), Group(id='arch_64_bit', name='64-bit architectures'), Group(id='all_mips', name='MIPS architectures'), Group(id='all_architectures', name='All architectures')})ΒΆ
All groups whose members are architectures.
- extra_platforms.group_data.ALL_PLATFORM_GROUPS: frozenset[Group] = frozenset({Group(id='linux_layers', name='Linux compatibility layers'), Group(id='linux_like', name='All Linux & compatibility layers'), Group(id='system_v', name='AT&T System Five'), Group(id='other_posix', name='Other POSIX-compliant platforms'), Group(id='bsd_without_macos', name='All BSD excluding macOS'), Group(id='unix_layers', name='Unix compatibility layers'), Group(id='unix_without_macos', name='All Unix excluding macOS'), Group(id='bsd', name='All BSD'), Group(id='linux', name='Linux distributions'), Group(id='unix', name='All Unix'), Group(id='all_windows', name='All Windows'), Group(id='all_platforms', name='All platforms')})ΒΆ
All groups whose members are platforms.
- extra_platforms.group_data.ALL_CI_GROUPS: frozenset[Group] = frozenset({Group(id='all_ci', name='CI systems')})ΒΆ
All groups whose members are CI systems.
Note
Not that useful currently, but provided for symmetry with architecture and platform groups.
- extra_platforms.group_data.NON_OVERLAPPING_GROUPS: frozenset[Group] = frozenset({Group(id='loongarch', name='LoongArch'), Group(id='ibm_mainframe', name='IBM mainframe'), Group(id='all_arm', name='ARM architectures'), Group(id='all_sparc', name='SPARC architectures'), Group(id='all_ci', name='CI systems'), Group(id='linux_layers', name='Linux compatibility layers'), Group(id='powerpc', name='PowerPC family'), Group(id='x86', name='x86 family'), Group(id='riscv', name='RISC-V family'), Group(id='system_v', name='AT&T System Five'), Group(id='unknown', name='Unknown'), Group(id='webassembly', name='WebAssembly'), Group(id='other_posix', name='Other POSIX-compliant platforms'), Group(id='unix_layers', name='Unix compatibility layers'), Group(id='bsd', name='All BSD'), Group(id='linux', name='Linux distributions'), Group(id='all_mips', name='MIPS architectures'), Group(id='all_windows', name='All Windows')})ΒΆ
Non-overlapping groups.
Hint
These groups together cover all predefined architectures, platforms, and CI systems, including traits from the
UNKNOWNgroup.All groups in this collection are marked as canonical.
- extra_platforms.group_data.EXTRA_GROUPS: frozenset[Group] = frozenset({Group(id='arch_32_bit', name='32-bit architectures'), Group(id='bsd_without_macos', name='All BSD excluding macOS'), Group(id='linux_like', name='All Linux & compatibility layers'), Group(id='unix_without_macos', name='All Unix excluding macOS'), Group(id='unix', name='All Unix'), Group(id='all_platforms', name='All platforms'), Group(id='arch_64_bit', name='64-bit architectures'), Group(id='all_architectures', name='All architectures'), Group(id='all_traits', name='All architectures, platforms and CI systems')})ΒΆ
Overlapping groups, defined for convenience.
Hint
None of these groups are marked as canonical.
- extra_platforms.group_data.ALL_GROUPS: frozenset[Group] = frozenset({Group(id='loongarch', name='LoongArch'), Group(id='all_arm', name='ARM architectures'), Group(id='all_sparc', name='SPARC architectures'), Group(id='linux_layers', name='Linux compatibility layers'), Group(id='arch_32_bit', name='32-bit architectures'), Group(id='powerpc', name='PowerPC family'), Group(id='riscv', name='RISC-V family'), Group(id='unknown', name='Unknown'), Group(id='webassembly', name='WebAssembly'), Group(id='x86', name='x86 family'), Group(id='all_architectures', name='All architectures'), Group(id='linux', name='Linux distributions'), Group(id='bsd_without_macos', name='All BSD excluding macOS'), Group(id='unix_layers', name='Unix compatibility layers'), Group(id='linux_like', name='All Linux & compatibility layers'), Group(id='unix_without_macos', name='All Unix excluding macOS'), Group(id='bsd', name='All BSD'), Group(id='all_windows', name='All Windows'), Group(id='unix', name='All Unix'), Group(id='all_platforms', name='All platforms'), Group(id='all_ci', name='CI systems'), Group(id='system_v', name='AT&T System Five'), Group(id='other_posix', name='Other POSIX-compliant platforms'), Group(id='ibm_mainframe', name='IBM mainframe'), Group(id='arch_64_bit', name='64-bit architectures'), Group(id='all_mips', name='MIPS architectures'), Group(id='all_traits', name='All architectures, platforms and CI systems')})ΒΆ
All predefined groups.
Hint
This collection contains both canonical and non-canonical groups, including the
UNKNOWNgroup.
- extra_platforms.group_data.ALL_TRAIT_IDS: frozenset[str] = frozenset({'aarch64', 'aix', 'altlinux', 'amzn', 'android', 'arch', 'arm', 'armv5tel', 'armv6l', 'armv7l', 'armv8l', 'azure_pipelines', 'bamboo', 'buildkite', 'buildroot', 'cachyos', 'centos', 'circle_ci', 'cirrus_ci', 'cloudlinux', 'codebuild', 'cygwin', 'debian', 'dragonfly_bsd', 'exherbo', 'fedora', 'freebsd', 'gentoo', 'github_ci', 'gitlab_ci', 'guix', 'haiku', 'heroku_ci', 'hurd', 'i386', 'i586', 'i686', 'ibm_powerkvm', 'illumos', 'kvmibm', 'linuxmint', 'loongarch64', 'macos', 'mageia', 'mandriva', 'midnightbsd', 'mips', 'mips64', 'mips64el', 'mipsel', 'netbsd', 'nobara', 'openbsd', 'opensuse', 'oracle', 'parallels', 'pidora', 'ppc', 'ppc64', 'ppc64le', 'raspbian', 'rhel', 'riscv32', 'riscv64', 'rocky', 's390x', 'scientific', 'slackware', 'sles', 'solaris', 'sparc', 'sparc64', 'sunos', 'teamcity', 'travis_ci', 'tumbleweed', 'tuxedo', 'ubuntu', 'ultramarine', 'wasm32', 'wasm64', 'windows', 'wsl1', 'wsl2', 'x86_64', 'xenserver'})ΒΆ
A
frozensetof all recognized traits IDs.Attention
This collection does not contain all the
UNKNOWN_*traits.
- extra_platforms.group_data.ALL_GROUP_IDS: frozenset[str] = frozenset({'all_architectures', 'all_arm', 'all_ci', 'all_mips', 'all_platforms', 'all_sparc', 'all_traits', 'all_windows', 'arch_32_bit', 'arch_64_bit', 'bsd', 'bsd_without_macos', 'ibm_mainframe', 'linux', 'linux_layers', 'linux_like', 'loongarch', 'other_posix', 'powerpc', 'riscv', 'system_v', 'unix', 'unix_layers', 'unix_without_macos', 'webassembly', 'x86'})ΒΆ
A
frozensetof all recognized group IDs.Attention
This collection does not contain the
UNKNOWNgroup.
- extra_platforms.group_data.ALL_IDS: frozenset[str] = frozenset({'aarch64', 'aix', 'all_architectures', 'all_arm', 'all_ci', 'all_mips', 'all_platforms', 'all_sparc', 'all_traits', 'all_windows', 'altlinux', 'amzn', 'android', 'arch', 'arch_32_bit', 'arch_64_bit', 'arm', 'armv5tel', 'armv6l', 'armv7l', 'armv8l', 'azure_pipelines', 'bamboo', 'bsd', 'bsd_without_macos', 'buildkite', 'buildroot', 'cachyos', 'centos', 'circle_ci', 'cirrus_ci', 'cloudlinux', 'codebuild', 'cygwin', 'debian', 'dragonfly_bsd', 'exherbo', 'fedora', 'freebsd', 'gentoo', 'github_ci', 'gitlab_ci', 'guix', 'haiku', 'heroku_ci', 'hurd', 'i386', 'i586', 'i686', 'ibm_mainframe', 'ibm_powerkvm', 'illumos', 'kvmibm', 'linux', 'linux_layers', 'linux_like', 'linuxmint', 'loongarch', 'loongarch64', 'macos', 'mageia', 'mandriva', 'midnightbsd', 'mips', 'mips64', 'mips64el', 'mipsel', 'netbsd', 'nobara', 'openbsd', 'opensuse', 'oracle', 'other_posix', 'parallels', 'pidora', 'powerpc', 'ppc', 'ppc64', 'ppc64le', 'raspbian', 'rhel', 'riscv', 'riscv32', 'riscv64', 'rocky', 's390x', 'scientific', 'slackware', 'sles', 'solaris', 'sparc', 'sparc64', 'sunos', 'system_v', 'teamcity', 'travis_ci', 'tumbleweed', 'tuxedo', 'ubuntu', 'ultramarine', 'unix', 'unix_layers', 'unix_without_macos', 'wasm32', 'wasm64', 'webassembly', 'windows', 'wsl1', 'wsl2', 'x86', 'x86_64', 'xenserver'})ΒΆ
A
frozensetof all recognized traits and group IDs.Attention
This collection does not contain all the
UNKNOWN_*traits and theUNKNOWNgroup.
extra_platforms.platform_data moduleΒΆ
Platform definitions and metadata.
Note
Default icons are inspired from Starship project: - https://starship.rs/config/#os - https://github.com/davidkna/starship/blob/e9faf17/.github/config-schema.json#L1221-L1269
Some icons, especially Linux distributions, have their own dedicated codepoints in NerdFonts.
- extra_platforms.platform_data.NOBARA = Platform(id='nobara', name='Nobara')ΒΆ
Note
Instead of using a loose Unicode icon for the Nobara OS, or just not adding any, we are using a NerdFont icon instead: ο (i.e. nf-linux-nobara / f380).
The side-effect of using a NerdFont character is it will only display correctly when using a supported font. Otherwise, it will appear as an unknown or invisible character depending on the fonts.
Todo
In the future, we may want to have two icons for each platform, one that is Unicode-based, the other that is NerdFont-based.
extra_platforms.pytest moduleΒΆ
Pytest decorators to skip tests depending on the platform theyβre run on.
Generates a pair of ready-to-use @skip_<id> and @unless_<id> decorators for
each platform and group.
extra_platforms.trait moduleΒΆ
Trait base class for architectures, platforms, CI systems, and more.
A trait represents a distinguishing characteristic of a runtime environment. Each trait has a unique ID, a human-readable name, an icon, and the ability to detect if it matches the current environment.
Data associated with traits can be aggressively cached and frozen, as theyβre only computed based on environment-dependent values.