meta_package_manager.managers.sheldon module¶
- class meta_package_manager.managers.sheldon.Sheldon[source]¶
Bases:
PackageManagerSheldon is a fast, configurable plugin manager for any shell.
Plugins are declared in a
plugins.tomlconfig file, each under a unique local name, and materialized into aplugins.lockfile that Sheldon generates. Packages are identified by that local name, which is what every command below takes.Unlike the other shell plugin managers mpm wraps, Sheldon is a real compiled binary rather than a sourced shell function, so it needs no interpreter wrapper: mpm calls
sheldondirectly.Caution
No
installed: Sheldon ships no command that prints its plugins. The inventory does exist, in theplugins.tomlconfig file, but reaching it would mean mpm reading and parsing a configuration file instead of calling a CLI, which is not how a manager gathers packages here. The upstream command set isinit,add,edit,remove,lock,source,completionsandversion: none of them lists anything.Caution
No
install:sheldon addrequires two values, a unique local name and a source flag naming where the plugin comes from (--github,--git,--gist,--remoteor--local). mpm’s install carries a single package id, which cannot supply both, and guessing a source from the id would be inventing a mapping Sheldon never defined. The operation is therefore not implemented rather than faked, and mpm auto-skips it.Note
No
outdated: Sheldon compares nothing against its remotes short of performing the update.upgrade --allstill works, and mpm auto-skips the operation.Documentation: sheldon.
Initialize
cli_errorslist.- name: str = 'Sheldon'¶
Return package manager’s common name.
Default value is based on class name.
- homepage_url: str | None = 'https://sheldon.cli.rs'¶
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='almalinux', name='AlmaLinux'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='endeavouros', name='EndeavourOS'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='pikaos', name='PikaOS'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})¶
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a
frozensetofPlatforminstances at instantiation.
- requirement: str | None = '>=0.6.0'¶
The series carrying the subcommand set this class drives.
0.6.0is wherelock --updatesettled as the way to refresh every plugin source, split from thesourcecommand that generates the shell script.
- extra_env: ClassVar = {'NO_COLOR': '1'}¶
Sheldon colors its progress output, which
NO_COLORdisables. It also honors a--colorflag, but the environment variable covers every invocation without threading a flag through each one.
- cli_names: tuple[str, ...] = ('sheldon',)¶
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this property’s value is derived from the manager’s ID (see the
MetaPackageManager.__init__method above).
- id: str = 'sheldon'¶
Package manager’s ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as they’re used as feature flags for the mpm CLI.
- version_regexes: tuple[str, ...] = ('sheldon\\s+(?P<version>\\S+)',)¶
Sheldon declares its version through clap, which prints the crate name and release. The separate
sheldon versionsubcommand prints a longer report, and is not what the probe reads.$ sheldon --version sheldon 0.8.2
- virtual: bool = False¶
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- upgrade_all_cli()[source]¶
Generates the CLI to upgrade all packages.
lock --updatere-fetches every plugin source declared inplugins.tomland regenerates the lock file. The sibling--reinstalldiscards and re-clones each source instead, which is a repair rather than an upgrade, so it is not what this builds.$ sheldon lock --update