sp-variant updates in 2022

3.0.0 - 2022-11-09

Incompatible changes

  • All: Yum/DNF: when installing packages (both via the package.install and pkgfile.install commands), disable all the configured repositories, only enable some base system ones and the StorPool ones.

  • Python: dropped Python 2.6 support, using dict comprehensions.

  • Rust: all the functions now return our own error enum instead of Box<dyn error::Error>.

Fixes

All:

  • Correctly treat Linux Mint 21.x as a Ubuntu 22.04 equivalent.

  • Making AlmaLinux the principal RPM-based distribution instead of CentOS.

Python: sp_build_repo: correctly using the name and slug fields when generating the repository definitions files.

Additions

  • All: added some initial support for AlmaLinux 9 and Rocky Linux 9.

  • Python: sp_build_repo: allowed repository URLs to be overridden using a TOML configuration file; provided a sample as examples/build-repo-overrides.toml.

  • Rust:

    • Using a separate tool, run-clippy.sh, to invoke clippy; removed the #![warn(...)] directives from the individual source files.

    • Keeping the Cargo.lock file under version control.

Other changes

All:

  • Allowing repository definitions to be built using a different storpool_variant interpretation, mostly for testing the correctness of the Rust one.

  • Use the simpler container names for AlmaLinux and Rocky Linux.

Python:

  • Using the cfg-diag 0.4 Config class API.

  • Declared Python 3.10 and 3.11 as supported versions.

  • Dropped the Rust and POSIX shell implementations from the sdist tarball.

  • sp_variant: now that sp_build_repo and test_docker use the click library, dropped the base_parser() method.

  • sp_build_repo:

    • Marked the -r option as required, renamed its long form to --runtime.

    • Overridden a “duplicate code” warning from pylint.

    • Using the typedload library for validating and loading configuration data.

    • Using the click library for command-line argument parsing.

    • Using f-strings.

    • Using the Text type instead of str; long overdue.

  • test_docker:

    • Installing the StorPool Python packages to make sure the repository is indeed accessible and configured correctly.

    • Only using asyncio.run() for the parts that need to run asynchronously (e.g. not for command-line parsing or trivial queries).

    • Using the click library for command-line argument parsing.

    • Running docker swap for the CentOS 8 container to switch to the CentOS Stream repositories; maybe we need to start using the quay.io containers instead.

  • Test suite:

    • Specified version constraints for the library dependencies.

    • Using pytest.mark.parametrize() instead of the ddt library.

    • Dropped the Python 2.x mypy and the flake8` + ``hacking test environments, they do not provide much value nowadays.

    • Dropped the outdated pytest.pyi typing stub.

    • Moved the configuration for the check tools out of the tox.ini file, mostly into pyproject.toml, but still setup.cfg for flake8.

Rust:

  • Minor refactoring following some suggestions from clippy.

  • Overridden several clippy lints, mostly for good reasons.

  • Using the clap library for command-line parsing.

  • Using the thiserror library instead of the quick-error one, it is cleaner.

  • Using the once_cell library instead of the lazy_static one.

  • Using the anyhow library instead of expect-exit in the command-line tool.

2.3.3 - 2022-04-28

All: making the quoting style in the Debian/Ubuntu pkgfile.dep_query command consistent with that of the others.

sh updates:

  • Fixed the quoting for the Debian/Ubuntu pkgfile.dep_query command.

  • Completed the exiting-on-errors fix: two missed invocations.

  • Minor changes to implement some shellcheck suggestions.

  • Added a shellcheck test unless NO_SHELLCHECK is specified.

2.3.2 - 2022-04-27

sh: Fixed exiting on errors in some situations; local variable declarations and error-checked assignments do not mix.

2.3.1 - 2022-04-27

sh: Fixed matching the VERSION_ID variable in the /etc/os-release file: using a POSIX extended regular expression with grep -E, not a Perl-compatible one!

2.3.0 - 2022-04-26

Incompatible changes

Rust:

  • The structs and enums exported by the sp_variant crate are now marked as non-exhaustive.

  • Some functions are now marked as “must use”.

Other changes

Python:

  • Now that there is a working POSIX shell implementation that is better suited for bootstrapping, splitting the Python library into several modules.

  • Always requiring the “typing” module to be installed.

Rust:

  • Imported struct names directory for a more idiomatic Rust style.

  • Many small improvements, mostly suggested by Clippy lints.

2.2.0 - 2022-02-05

Fixes

Python: fix two bugs in the list_all_packages() convenience function:

  • Do not modify the variant structure’s command list in place!

  • Correctly recognize installed packages on Debian/Ubuntu systems.

Other changes

All: recognizing Ubuntu 22.04 (Jammy Jellyfish).

Python:

  • Reformatting with 100 characters per line.

  • Making the ArgumentParser-related type annotations a bit more precise to pass some checks in recent versions of mypy.

Rust: changed the dependency on nix to a >= relation, hoping they do not break backwards compatibility.