Package: lionshead
A platform detection library for Python. It uses various methods to attempt to
determine the operating system, distribution, release, version, etc., to aid
callers in making platform-specific decisions.lionshead was originally written for “platform-specific wheels” that were a
solution to the Linux wheel problem before the creation ofmanylinux. Rather than be wasted effort, it’s been
spun in to a separate library (which would’ve been necessary anyway to be
consumed by both pip and wheel).The development repository can be found athttps://github.com/natefoo/lionsheadDocumentation is available athttp://lionshead.readthedocs.ioThe package is published to PyPI athttps://pypi.python.org/pypi/lionsheadQuick startOn Debian stretch/sid:>>> from lionshead import *
>>> get_specific_platform()
SpecificPlatform(dist='debian', major_vers='stretch/sid', full_vers='stretch/sid', stability='unstable')
>>> get_specific_platform_string()
'debian-stretch_sid'
>>> get_platform_stability_string()
'unstable'On CentOS 7:>>> from lionshead import *
>>> get_specific_platform()
SpecificPlatform(dist='centos', major_vers='7', full_vers='7', stability='stable')
>>> get_specific_platform_string()
'centos-7'
>>> get_platform_stability_string()
'stable'Installation of the module also installslionshead-platformandlionshead-stabilitycommands that return the output ofget_specific_platform_stringandget_platform_stability_string,
respectively.FAQHow can I help?See if your OS/distribution is listed and/or correct inthis gist, and if not, follow
the instructions and create an issue with your findings.Does this work on anything other than Linux?Not currently, but as an avid illumos fan, I plan to add support for other
operating systems such as illumos and the BSDs.Here’s the data collectionI did for Ansible’s
illumos detection to get started.What is a “stable” vs. “unstable” platform?“Stable” platforms are operating system releases which commit to a defined,
non-changing ABI for the lifetime of the release. This means that the ABI
remains consisntent even after OS updates (this typically means that all
software is maintained at a specific version). Examples of “stable” releases
include:Red Hat Enterprise Linux and derivativesUbuntuDebian (stable and past stable releases)SUSE Linux Enterprise ServeropenSUSE (releases)Conversely, “unstable” platforms are operating systems that use a “rolling
release” model where software versions can change with each OS update. Examples
of “unstable” releases include:Debian (testing/sid)openSUSE (tumbleweed)ArchWhat’s with the name?The name is a reference toIndiana Jones and the Last Crusade, specifically
the scene where Indy takes the “leap of faith” on to the invisible bridge in
the Temple of the Sun.“Only in the leap from the lion’s head will he prove his worth.”The leap detects the (presence of the) platform underneath… get it? ;PCode of ConductEveryone interacting in the lionshead project’s codebases, issue trackers, chat
rooms, and mailing lists is expected to follow thePyPA Code of Conduct.History0.1.1 (2017-01-07)Fix detection of Amazon Linux0.1 (2017-01-03)Yankedplatformmodule out of my pip/wheel forks and adapted as a
standalone module for initial version.Wrote a bit of documentation.