Detectionยถ
All detection functionsยถ
Detection function |
Icon |
Associated symbol |
|---|---|---|
๐ฑ |
||
โฟ |
||
๐ณ |
||
๐๏ธ |
||
ฮ |
||
โคป |
||
๐ค |
||
๐๏ธ |
||
๐ฑ |
||
โบ |
||
๐ฒ |
||
โ๏ธ |
||
๐ |
||
โ๏ธ |
||
๐ป |
||
โ |
||
๐ช |
||
๐ |
||
๐๏ธ |
||
ยณยฒ |
||
โถโด |
||
๐ฑ |
||
๐ฑ |
||
๐ฑ |
||
๐ฑ |
||
๐ฑ |
||
๐ชถ |
||
โ |
||
โฒ |
||
๏ผ |
||
โฌ๏ธ |
||
๐ฒ |
||
โท |
||
๐ ฑ๏ธ |
||
๐ช |
||
โ๏ธ |
||
๐ ฒ |
||
โฌ |
||
๐ |
||
โชพ |
||
โ |
||
๊ฉ |
||
โถ |
||
แ |
||
โฐ |
||
๐ |
||
ฯพ |
||
๐จ |
||
๐ |
||
๐ชฐ |
||
๐ฝ |
||
๐ฉ |
||
๐ |
||
๐ฆถ |
||
๐ |
||
๐๏ธ |
||
๐ป |
||
๐ |
||
๐ฆ |
||
๐ |
||
๐บ |
||
๐ฎ |
||
๐ |
||
๐ |
||
โฅ |
||
๐ฆฌ |
||
โฌก |
||
๐ถ |
||
๐ถ |
||
๐ถ |
||
๐ข |
||
๐คน |
||
๐ฅ |
||
โฌ |
||
๐ฑ |
||
๐ฑ |
||
๐ |
||
๐ |
||
๐คน |
||
๐ง |
||
โ |
||
๐ฃ |
||
๐ฟ |
||
โฌ๏ธ |
||
๐ |
||
๐ |
||
๐ |
||
โฅ |
||
๐ซ |
||
โฒ |
||
๐ |
||
๐ฒ |
||
๐ฒ |
||
๐ฒ |
||
๐ฒ |
||
โง |
||
โฆ |
||
๐ฉ |
||
๏ |
||
๐ |
||
๐ก |
||
๐ฆ |
||
๐ถ |
||
๐ฆด |
||
๐ |
||
โ |
||
โฅ |
||
๐ |
||
โก |
||
๐ท |
||
โก |
||
โก |
||
โก |
||
๐ |
||
๐ฉ |
||
๐๏ธ |
||
โ ค |
||
โ ค |
||
โ ค |
||
โฐ๏ธ |
||
๐ข |
||
โ๏ธ |
||
๐ฌ |
||
๐ฆ |
||
๐ |
||
โ๏ธ |
||
โ๏ธ |
||
๐ |
||
๐ |
||
๐ |
||
๐ |
||
๐๏ธ |
||
๐ |
||
๐ |
||
๐ท |
||
โป |
||
๐คต |
||
๐ฏ |
||
๐ |
||
โจท |
||
โ |
||
โจ |
||
โ |
||
โ |
||
โ |
||
โ |
||
โ |
||
โ |
||
๐ต |
||
๐ |
||
๐ |
||
โฌข |
||
๐ |
||
๐ก |
||
๐ช |
||
โจ๏ธ |
||
โก |
||
โ |
||
โ |
||
๐ |
||
๐ฅ๏ธ |
||
โ |
||
๐ |
||
๐ |
||
๐ชต |
||
โค |
Trait detection functionsยถ
- extra_platforms.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.is_android()[source]ยถ
Return
Trueif current platform isANDROID.See also
Source: <https://github.com/kivy/kivy/blob/master/kivy/utils.py>
- Return type:
- extra_platforms.is_apple_terminal()[source]ยถ
Return
Trueif current terminal isAPPLE_TERMINAL.- Return type:
- extra_platforms.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.is_armv5tel()[source]ยถ
Return
Trueif current architecture isARMV5TEL.- Return type:
- extra_platforms.is_ash()[source]ยถ
Return
Trueif current shell isASH.Hint
Detected via the
SHELLenvironment variable path, as Almquist Shell does not set its own version variable.Note
BusyBoxโs built-in shell is an
ASHderivative. On BusyBox-based systems (ALPINE,OPENWRT),$SHELLtypically resolves to/bin/ash, so BusyBox environments are detected asASH.- Return type:
- extra_platforms.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.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.is_bash()[source]ยถ
Return
Trueif current shell isBASH.Hint
Detected via the
BASH_VERSIONenvironment variable (set by Bash on startup), or via theSHELLpath as a fallback.Attention
GitHubโs
ubuntu-slimrunner is a stripped-down environments, running as a WSL2 container on top of Windows. It uses Bash as the default shell, but does not set neitherBASH_VERSIONnorSHELL. In that case we fall back to walking the parent process tree via/procto find it.- Return type:
- extra_platforms.is_buildkite()[source]ยถ
Return
Trueif current CI isBUILDKITE.See also
Environment variables reference: <https://buildkite.com/docs/pipelines/environment-variables>.
- Return type:
- extra_platforms.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.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.is_cloudlinux()[source]ยถ
Return
Trueif current platform isCLOUDLINUX.- Return type:
- extra_platforms.is_cmd()[source]ยถ
Return
Trueif current shell isCMD.Hint
Detected on Windows when the
PROMPTenvironment variable is set andPSModulePathis not (to exclude PowerShell).- Return type:
- extra_platforms.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.is_csh()[source]ยถ
Return
Trueif current shell isCSH.Hint
Detected via the
SHELLenvironment variable path.- Return type:
- extra_platforms.is_dash()[source]ยถ
Return
Trueif current shell isDASH.Hint
Detected via the
SHELLenvironment variable path, as Dash does not set its own version variable.- Return type:
- extra_platforms.is_dragonfly_bsd()[source]ยถ
Return
Trueif current platform isDRAGONFLY_BSD.- Return type:
- extra_platforms.is_fish()[source]ยถ
Return
Trueif current shell isFISH.Hint
Detected via the
FISH_VERSIONenvironment variable (set by Fish on startup), or via theSHELLpath as a fallback.- Return type:
- extra_platforms.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>.
- Return type:
- extra_platforms.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.is_gnome_terminal()[source]ยถ
Return
Trueif current terminal isGNOME_TERMINAL.- Return type:
- extra_platforms.is_gnu_screen()[source]ยถ
Return
Trueif current terminal isGNU_SCREEN.- Return type:
- extra_platforms.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.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.is_ibm_powerkvm()[source]ยถ
Return
Trueif current platform isIBM_POWERKVM.- Return type:
- extra_platforms.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.is_ksh()[source]ยถ
Return
Trueif current shell isKSH.Hint
Detected via the
KSH_VERSIONenvironment variable (set by Korn shell on startup), or via theSHELLpath as a fallback.- Return type:
- extra_platforms.is_loongarch64()[source]ยถ
Return
Trueif current architecture isLOONGARCH64.- Return type:
- extra_platforms.is_midnightbsd()[source]ยถ
Return
Trueif current platform isMIDNIGHTBSD.- Return type:
- extra_platforms.is_mips64el()[source]ยถ
Return
Trueif current architecture isMIPS64EL.- Return type:
- extra_platforms.is_nushell()[source]ยถ
Return
Trueif current shell isNUSHELL.Hint
Detected via the
NU_VERSIONenvironment variable (set by Nushell on startup), or via theSHELLpath as a fallback.- Return type:
- extra_platforms.is_powershell()[source]ยถ
Return
Trueif current shell isPOWERSHELL.Note
PowerShell is cross-platform and available on Linux and macOS. Detection covers all platforms via
PSModulePath,SHELLpath, and parent process tree.Attention
PSModulePathcan leak into non-PowerShell child processes via two vectors:Process-level inheritance (all platforms): PowerShell modifies
PSModulePathat startup, and all non-PowerShell children inherit it.System-wide registry variable (Windows only):
PSModulePathis a persistent machine-level environment variable visible to all processes.
This is the case for all GitHub Ubuntu runners, where
PSModulePathleaks from Azure infrastructure. This leads to multiple shell detections, which is arbitraged bycurrent_shell(), which deprioritizes PowerShell when other shells are detected.- Return type:
- extra_platforms.is_scientific()[source]ยถ
Return
Trueif current platform isSCIENTIFIC.- Return type:
- extra_platforms.is_tcsh()[source]ยถ
Return
Trueif current shell isTCSH.Hint
Detected via the
SHELLenvironment variable path.- Return type:
- extra_platforms.is_teamcity()[source]ยถ
Return
Trueif current CI isTEAMCITY.See also
Environment variables reference: <https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html#Predefined+Server+Build+Parameters>.
- Return type:
- extra_platforms.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.is_tumbleweed()[source]ยถ
Return
Trueif current platform isTUMBLEWEED.- Return type:
- extra_platforms.is_ultramarine()[source]ยถ
Return
Trueif current platform isULTRAMARINE.- Return type:
- extra_platforms.is_unknown_architecture()[source]ยถ
Return
Trueif current architecture isUNKNOWN_ARCHITECTURE.- Return type:
- extra_platforms.is_unknown_ci()[source]ยถ
Return
Trueif current CI isUNKNOWN_CI.- Return type:
- extra_platforms.is_unknown_platform()[source]ยถ
Return
Trueif current platform isUNKNOWN_PLATFORM.- Return type:
- extra_platforms.is_unknown_shell()[source]ยถ
Return
Trueif current shell isUNKNOWN_SHELL.- Return type:
- extra_platforms.is_unknown_terminal()[source]ยถ
Return
Trueif current terminal isUNKNOWN_TERMINAL.- Return type:
- extra_platforms.is_vscode_terminal()[source]ยถ
Return
Trueif current terminal isVSCODE_TERMINAL.- Return type:
- extra_platforms.is_wasm32()[source]ยถ
Return
Trueif current architecture isWASM32.Hint
WebAssembly detection is based on Emscriptenโs platform identifier.
- Return type:
- extra_platforms.is_wasm64()[source]ยถ
Return
Trueif current architecture isWASM64.Hint
WebAssembly detection is based on Emscriptenโs platform identifier.
- Return type:
- extra_platforms.is_windows_terminal()[source]ยถ
Return
Trueif current terminal isWINDOWS_TERMINAL.- Return type:
- extra_platforms.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.is_x86_64()[source]ยถ
Return
Trueif current architecture isX86_64.Caution
Windows returns
AMD64in uppercase, so we normalize to lowercase.- Return type:
- extra_platforms.is_xonsh()[source]ยถ
Return
Trueif current shell isXONSH.Hint
Detected via the
XONSH_VERSIONenvironment variable (set by Xonsh on startup), or via theSHELLpath as a fallback.- Return type:
- extra_platforms.is_xterm()[source]ยถ
Return
Trueif current terminal isXTERM.Note
We check for
XTERM_VERSIONrather thanTERM=xtermbecause many headless environments (e.g., GitHub Actionsubuntu-slimrunners) setTERM=xtermfor termcap/terminfo compatibility without actually running xterm.- Return type:
Group detection functionsยถ
Contrary to individual trait detection functions like is_linux() or is_x86_64(), group detection functions check for membership in a collection of traits.
These functions are dynamically generated for each group and test whether at least one trait from the group matches the current system:
- extra_platforms.is_any_architecture(_group=Group(id='all_architectures', name='All architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_ARCHITECTURESgroup.- Return type:
- extra_platforms.is_any_arm(_group=Group(id='all_arm', name='ARM architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_ARMgroup.- Return type:
- extra_platforms.is_any_ci(_group=Group(id='all_ci', name='CI systems'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_CIgroup.- Return type:
- extra_platforms.is_any_mips(_group=Group(id='all_mips', name='MIPS architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_MIPSgroup.- Return type:
- extra_platforms.is_any_platform(_group=Group(id='all_platforms', name='All platforms'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_PLATFORMSgroup.- Return type:
- extra_platforms.is_any_shell(_group=Group(id='all_shells', name='All shells'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_SHELLSgroup.- Return type:
- extra_platforms.is_any_sparc(_group=Group(id='all_sparc', name='SPARC architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_SPARCgroup.- Return type:
- extra_platforms.is_any_terminal(_group=Group(id='all_terminals', name='All terminals'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_TERMINALSgroup.- Return type:
- extra_platforms.is_any_trait(_group=Group(id='all_traits', name='All architectures, platforms, shells, terminals, and CI systems'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_TRAITSgroup.- Return type:
- extra_platforms.is_any_windows(_group=Group(id='all_windows', name='All Windows'))ยถ
Return
Trueif at least onecurrent_traits()is found in theALL_WINDOWSgroup.- Return type:
- extra_platforms.is_arch_32_bit(_group=Group(id='arch_32_bit', name='32-bit architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theARCH_32_BITgroup.- Return type:
- extra_platforms.is_arch_64_bit(_group=Group(id='arch_64_bit', name='64-bit architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theARCH_64_BITgroup.- Return type:
- extra_platforms.is_big_endian(_group=Group(id='big_endian', name='Big-endian architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theBIG_ENDIANgroup.- Return type:
- extra_platforms.is_bourne_shells(_group=Group(id='bourne_shells', name='Bourne-compatible shells'))ยถ
Return
Trueif at least onecurrent_traits()is found in theBOURNE_SHELLSgroup.- Return type:
- extra_platforms.is_bsd(_group=Group(id='bsd', name='All BSD'))ยถ
Return
Trueif at least onecurrent_traits()is found in theBSDgroup.- Return type:
- extra_platforms.is_bsd_not_macos(_group=Group(id='bsd_without_macos', name='All BSD excluding macOS'))ยถ
Return
Trueif at least onecurrent_traits()is found in theBSD_WITHOUT_MACOSgroup.- Return type:
- extra_platforms.is_c_shells(_group=Group(id='c_shells', name='C shells'))ยถ
Return
Trueif at least onecurrent_traits()is found in theC_SHELLSgroup.- Return type:
- extra_platforms.is_gpu_terminals(_group=Group(id='gpu_terminals', name='GPU-accelerated terminals'))ยถ
Return
Trueif at least onecurrent_traits()is found in theGPU_TERMINALSgroup.- Return type:
- extra_platforms.is_ibm_mainframe(_group=Group(id='ibm_mainframe', name='IBM mainframe'))ยถ
Return
Trueif at least onecurrent_traits()is found in theIBM_MAINFRAMEgroup.- Return type:
- extra_platforms.is_linux(_group=Group(id='linux', name='Linux distributions'))ยถ
Return
Trueif at least onecurrent_traits()is found in theLINUXgroup.- Return type:
- extra_platforms.is_linux_layers(_group=Group(id='linux_layers', name='Linux compatibility layers'))ยถ
Return
Trueif at least onecurrent_traits()is found in theLINUX_LAYERSgroup.- Return type:
- extra_platforms.is_linux_like(_group=Group(id='linux_like', name='All Linux & compatibility layers'))ยถ
Return
Trueif at least onecurrent_traits()is found in theLINUX_LIKEgroup.- Return type:
- extra_platforms.is_little_endian(_group=Group(id='little_endian', name='Little-endian architectures'))ยถ
Return
Trueif at least onecurrent_traits()is found in theLITTLE_ENDIANgroup.- Return type:
- extra_platforms.is_loongarch(_group=Group(id='loongarch', name='LoongArch'))ยถ
Return
Trueif at least onecurrent_traits()is found in theLOONGARCHgroup.- Return type:
- extra_platforms.is_multiplexers(_group=Group(id='multiplexers', name='Terminal multiplexers'))ยถ
Return
Trueif at least onecurrent_traits()is found in theMULTIPLEXERSgroup.- Return type:
- extra_platforms.is_native_terminals(_group=Group(id='native_terminals', name='Native terminal emulators'))ยถ
Return
Trueif at least onecurrent_traits()is found in theNATIVE_TERMINALSgroup.- Return type:
- extra_platforms.is_other_posix(_group=Group(id='other_posix', name='Other POSIX-compliant platforms'))ยถ
Return
Trueif at least onecurrent_traits()is found in theOTHER_POSIXgroup.- Return type:
- extra_platforms.is_other_shells(_group=Group(id='other_shells', name='Other shells'))ยถ
Return
Trueif at least onecurrent_traits()is found in theOTHER_SHELLSgroup.- Return type:
- extra_platforms.is_powerpc(_group=Group(id='powerpc', name='PowerPC family'))ยถ
Return
Trueif at least onecurrent_traits()is found in thePOWERPCgroup.- Return type:
- extra_platforms.is_riscv(_group=Group(id='riscv', name='RISC-V family'))ยถ
Return
Trueif at least onecurrent_traits()is found in theRISCVgroup.- Return type:
- extra_platforms.is_system_v(_group=Group(id='system_v', name='AT&T System Five'))ยถ
Return
Trueif at least onecurrent_traits()is found in theSYSTEM_Vgroup.- Return type:
- extra_platforms.is_unix(_group=Group(id='unix', name='All Unix'))ยถ
Return
Trueif at least onecurrent_traits()is found in theUNIXgroup.- Return type:
- extra_platforms.is_unix_layers(_group=Group(id='unix_layers', name='Unix compatibility layers'))ยถ
Return
Trueif at least onecurrent_traits()is found in theUNIX_LAYERSgroup.- Return type:
- extra_platforms.is_unix_not_macos(_group=Group(id='unix_without_macos', name='All Unix excluding macOS'))ยถ
Return
Trueif at least onecurrent_traits()is found in theUNIX_WITHOUT_MACOSgroup.- Return type:
- extra_platforms.is_unknown(_group=Group(id='unknown', name='Unknown'))ยถ
Return
Trueif at least onecurrent_traits()is found in theUNKNOWNgroup.- Return type:
- extra_platforms.is_web_terminals(_group=Group(id='web_terminals', name='Web-based terminals'))ยถ
Return
Trueif at least onecurrent_traits()is found in theWEB_TERMINALSgroup.- Return type:
- extra_platforms.is_webassembly(_group=Group(id='webassembly', name='WebAssembly'))ยถ
Return
Trueif at least onecurrent_traits()is found in theWEBASSEMBLYgroup.- Return type:
- extra_platforms.is_windows_shells(_group=Group(id='windows_shells', name='Windows shells'))ยถ
Return
Trueif at least onecurrent_traits()is found in theWINDOWS_SHELLSgroup.- Return type:
- extra_platforms.is_x86(_group=Group(id='x86', name='x86 family'))ยถ
Return
Trueif at least onecurrent_traits()is found in theX86group.- Return type:
Current trait functionsยถ
These functions retrieve the currently detected traits:
- extra_platforms.current_traits()[source]ยถ
Returns all traits matching the current environment.
This includes
Architecture,Platform,Shell,Terminal, 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.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.
Warning
An architecture is always expected to be detected. An unrecognized result logs a
WARNINGand likely indicates a missing detection heuristic that should be reported.- Return type:
- extra_platforms.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.
Warning
A platform is always expected to be detected. An unrecognized result logs a
WARNINGand likely indicates a missing detection heuristic that should be reported.- Return type:
- extra_platforms.current_shell(strict=False)[source]ยถ
Returns the
Shellmatching the current environment.Uses a tiered detection strategy:
Shell-specific environment variables (detects active shell).
SHELLenvironment variable (detects login shell on Unix).Windows defaults (
PROMPTโCMD, else โPOWERSHELL).
Returns
UNKNOWN_SHELLif not running inside a recognized shell. To raise an error instead, setstricttoTrue.Important
If both
POWERSHELLand another shell are detected (becausePSModulePathleaks into child processes), the other shell is preferred.Warning
A shell is always expected to be detected. An unrecognized result logs a
WARNINGand likely indicates a missing detection heuristic that should be reported.See also
Inspired by UVโs cross-platform shell detection.
- Return type:
- extra_platforms.current_terminal(strict=False)[source]ยถ
Returns the
Terminalmatching the current environment.Returns
UNKNOWN_TERMINALif not running inside a recognized terminal. To raise an error instead, setstricttoTrue.Important
If multiple terminals match (e.g.,
TMUXinsideKITTY), multiplexers are filtered out first to identify the innermost terminal. If multiple non-multiplexer terminals still match, aRuntimeErroris raised.Note
Unlike architectures, platforms, and shells, a terminal is not always present. Headless environments (CI runners, cron jobs, Docker containers, SSH non-interactive commands) have no terminal emulator attached. An unrecognized result only logs at
INFOlevel.- Return type:
- extra_platforms.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.
Note
Unlike architectures, platforms, and shells, a CI system is not always present. Local development environments have no CI system running. An unrecognized result only logs at
INFOlevel.- Return type:
Cache managementยถ
- extra_platforms.invalidate_caches()[source]ยถ
Invalidate all cached properties.
Inspired by the new platform.invalidate_caches() from Python 3.14, which is also called here when available.