meta_package_manager.managers.asdf module¶
- class meta_package_manager.managers.asdf.ASDF[source]¶
Bases:
PackageManagerasdf manages parallel versions of multiple developer tools (Node.js, Ruby, Python, Erlang, …) through a plugin ecosystem, exposing all of them behind a single CLI.
mpm targets the
0.16.0Go rewrite and later: it calls the space-separated subcommands (asdf list all,asdf plugin add) that replaced the hyphenated forms (list-all,plugin-add) of the older Bash asdf, which is unsupported.Note
asdf is plugin-driven: every tool the user can install is gated behind a plugin (
asdf plugin add nodejs).mpm installdoes not auto-add plugins; the user is expected to register them first withasdf plugin add.Note
Each
(plugin, installed_version)pair is reported as a distinct package, so a tool installed at multiple versions yields multiple entries sharing the same ID.Caution
mpm outdatedonly reports tools that have a currently-active version (marked with*inasdf list) different from their latest stable release. A tool installed without being activated through a.tool-versionsfile does not surface as outdated.Initialize
cli_errorslist.- homepage_url: str | None = 'https://asdf-vm.com'¶
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.16.0'¶
The Go rewrite shipped in
0.16.0on 2025-01-30 replaced the hyphenated subcommands (asdf list-all,asdf plugin-add, …) with their space-separated equivalents this wrapper depends on (asdf list all,asdf plugin add, …). Older Bash-based releases are not supported.
- version_cli_options: tuple[str, ...] = ('version',)¶
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- version_regexes: tuple[str, ...] = ('v?(?P<version>\\d+\\.\\d+\\.\\d+)',)¶
$ asdf version v0.19.0-83adfe6
- property installed: Iterator[Package]¶
Fetch installed packages.
Emits one
meta_package_manager.package.Packageper(plugin, installed_version)pair, so a tool installed at multiple versions yields multiple entries sharing the same ID.$ asdf list nodejs 18.20.4 *20.10.0 ruby *3.2.0
- property outdated: Iterator[Package]¶
Fetch outdated packages.
Cross-references the currently-active version per plugin (the entry marked with
*inasdf list) with the latest stable version (asdf latest --all). Only plugins whose active version differs from the latest are yielded.$ asdf latest --all nodejs 20.10.0 missing ruby 3.3.0 missing
- search(query, extended, exact)[source]¶
Fetch matching packages.
asdf plugin list allenumerates the entire short-name plugin catalogue. The framework’smeta_package_manager.manager.PackageManager.refiltered_search()narrows the listing down to entries that contain the query.$ asdf plugin list all 1password-cli https://github.com/NeoHsu/asdf-1password-cli.git act https://github.com/grimoh/asdf-act.git nodejs https://github.com/asdf-vm/asdf-nodejs.git
- install(package_id, version=None)[source]¶
Install one package.
asdf install <plugin>requires the plugin to have been added beforehand withasdf plugin add <plugin>. This wrapper does not auto-add plugins.$ asdf install nodejs 20.10.0
- Return type:
- upgrade_one_cli(package_id, version=None)[source]¶
Generates the CLI to upgrade one package.
asdf has no native upgrade verb: installing the
latestalias downloads the newest stable release alongside any older versions already on disk. The user is responsible for switching the active version withasdf setif desired.$ asdf install nodejs latest
- cli_names: tuple[str, ...] = ('asdf',)¶
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 = 'asdf'¶
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.
- remove(package_id)[source]¶
Remove one package.
asdf plugin removedeletes the plugin and every version of the tool installed through it, which matchesmpm’s “remove this package” contract more cleanly than iteratingasdf uninstallper installed version.$ asdf plugin remove nodejs
- Return type: