From d6850d3f80aa1c2cddd75f81c555c603547d7bae Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 10 Oct 2023 02:54:06 +0200 Subject: [PATCH] Release 25.0.0 --- CHANGELOG.md | 94 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 8 +++- rust2rpm/__init__.py | 2 +- 3 files changed, 101 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e547279..500439c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,97 @@ +Version 25.0.0 +============== + +This is a major release with several feature additions and fixes for some use +cases that were previously not well supported. + +- The minimum required Python version was bumped from 3.10 to 3.11. +- A dependency on the jsonschema Python package was added. +- An optional / recommended dependency on rust2rpm-helper was added. +- The default configuration file format changed from INI-based to TOML. +- Proper documentation for rust2rpm, rust2rpm.toml, and rust2rpm.conf was added + in AsciiDoc format (suitable for converting to man pages). + +Added: + +- The recommended way to specify package-specific rust2rpm settings is now with + `rust2rpm.toml`. The INI-based `rust2rpm.conf` format is deprecated. The TOML + format supports a superset of the settings that are supported by the INI-based + format, so settings can easily be migrated to the new file format. Settings + are validated against a schema definition with jsonschema. +- The "version" CLI argument is now checked to be either a valid version based + on SemVer, or a valid SemVer version *requirement*. If the argument is a + requirement (or "partial version"), rust2rpm will query crates.io for all + available versions of the specified crate and select the greatest version that + is compatible with the given requirement. +- A new spec template for "local projects" (which are neither actual "crates" + nor "cargo workspace" projects) was added. This template requires much fewer + manual modifications after running rust2rpm for projects like this. +- The `rust2rpm.toml` configuration file format adds support for storing + settings for enabling / disabling all (or specific kinds of) tests, skipping + specific tests by name. Additionally, comments for why tests are disabled can + also be stored in configuration. +- Added support for automatically generating a vendor tarball, and for wiring + up its use in generated spec files. Packages generated this way require + `cargo-rpm-macros >= 25` since only this version added support for building + against vendored dependencies and other necessary additions and changes to + the Rust / cargo RPM macros. + +Changed: + +- The algorithm for stripping non-applicable target-specific dependencies was + reimplemented in a separate project (rust2rpm-helper) in Rust, based on the + same style-preserving TOML editing library that is used by cargo. This fixes + several bugs and shortcomings compared to the basic Python implementation, + which is kept for backwards compatibility and for situations where + rust2rpm-helper is not in `$PATH`. +- All spec file templates have been updated to avoid using the potentially + broken / limited `%version_no_tilde` macro. The definition of this macro + will likely be moved (or removed) from rust-packaging in the future. +- The spec template for "cargo workspace" projects has been updated to match + recent changes in the template for "crate" packages. +- The minimum supported version of rust-packaging / cargo-rpm-macros was bumped + to `cargo-rpm-macros >= 24` for the "fedora" target. This version is available + on all current branches of Fedora and on EPEL9. + +Fixed: + +- The mechanisms for patching `Cargo.toml` were adapted to ensure that + non-temporary files are not permanently changed (i.e. when running rust2rpm + against unpacked / local sources). +- Packaging crate versions with SemVer "build" metadata is now possible without + patching `Cargo.toml` manually. This version suffix is now automatically + stripped by rust2rpm-helper, and the original upstream version is set in the + generated spec file and used where necessary. +- When targeting a local / unpacked project, passing the `-s` / `--store-crate` + command-line argument now fails gracefully instead of crashing due to an + uncaught exception. +- Heuristics for automatically determining the "version" of a "cargo workspace" + project were improved to better match expectations. +- Files under the "target/" directory are now excluded by the heuristics that + determine the list of `%doc` files in unpacked project sources. + +Removed: + +N/A + +Deprecated: + +- The `rust2rpm.conf` configuration file format is deprecated in favor of + `rust2rpm.toml`. +- The `-` / `--stdout` mode of rust2rpm will be removed in a future version. +- The `--suffix=SUFFIX` argument for rust2rpm is deprecated in favor of the + `--compat` flag. +- The `--all-features` flag is deprecated in favor of defining this setting + permanently in `rust2rpm.toml`. +- The `--show-license-map` and `--translate-license` modes of rust2rpm and + the underlying Python APIs will be removed in a future version. + +Internals: + +- Almost all code in rust2rpm (and, by extension, cargo2rpm) is now covered + by type annotations. After applying fixes for some edge cases, rust2rpm + now passes static analysis with mypy. + Version 24.4.2 ============== diff --git a/README.md b/README.md index ac5bb68..0e057f6 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ rust2rpm is a tool for automatically generating RPM spec files for Rust crates. Invoking `tox` will automatically run the test suite for all supported versions of Python. `tox -- -vv` can be used to show very verbose output from pytest. +The tox configuration also includes environments for running `mypy` (static +analysis) and `coverage` (running tests and writing a test coverage report +in HTML format). + ### pytest The tests can also be run manually in a virtualenv: @@ -27,5 +31,5 @@ fixtures for expected (!) changes in the spec file generator. ## Documentation Documentation for rust2rpm and its configuration file formats is available in -the `docs/` directory in AsciiDoc format. The included build script shows how -to build man pages from the AsciiDoc source files with asciidoctor. +the `docs/` directory in AsciiDoc format. The included build script can be used +to build man pages from the AsciiDoc sources with asciidoctor. diff --git a/rust2rpm/__init__.py b/rust2rpm/__init__.py index add106d..b3af0e8 100644 --- a/rust2rpm/__init__.py +++ b/rust2rpm/__init__.py @@ -10,7 +10,7 @@ from rust2rpm import licensing # release of the last minor version. # # Only the major version is included in the header of generated spec files. -__version__ = "24.4.2" +__version__ = "25.0.0" TARGET_ARCHES = [ "x86_64",