Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
python: mkvenv: add ensuregroup command
Introduce a new subcommand that retrieves the packages to be installed from a TOML file. This allows being more flexible in using the system version of a package, while at the same time using a known-good version when installing the package. This is important for packages that sometimes have backwards-incompatible changes or that depend on specific versions of their dependencies. Compared to JSON, TOML is more human readable and easier to edit. A parser is available in 3.11 but also available as a small (12k) package for older versions, tomli. While tomli is bundled with pip, this is only true of recent versions of pip. Of all the supported OSes pretty much only FreeBSD has a recent enough version of pip while staying on Python <3.11. So we cannot use the same trick that is in place for distlib. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
- Loading branch information
Showing
3 changed files
with
148 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # This file describes Python package requirements to be | ||
| # installed in the pyvenv Python virtual environment. | ||
| # | ||
| # Packages are placed in groups, which are installed using | ||
| # the ensuregroup subcommand of python/scripts/mkvenv.py. | ||
| # Each group forms a TOML section and each entry in the | ||
| # section is a TOML key-value list describing a package. | ||
| # All fields are optional; valid fields are: | ||
| # | ||
| # - accepted: accepted versions when using a system package | ||
| # - installed: fixed version to install in the virtual environment | ||
| # if a system package is not found; if not specified, | ||
| # the minimum and maximum | ||
| # - canary: if specified, use this program name to present more | ||
| # precise error diagnostics to the user. For example, | ||
| # 'sphinx-build' can be used as a bellwether for the | ||
| # presence of 'sphinx' in the system. |