Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-python-rpm-spec for openSUSE:Leap:16.0 checked in at 2025-07-24 08:31:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:16.0/python-python-rpm-spec (Old) and /work/SRC/openSUSE:Leap:16.0/.python-python-rpm-spec.new.8875 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-rpm-spec" Thu Jul 24 08:31:15 2025 rev:2 rq:1293737 version:0.16.0 Changes: -------- --- /work/SRC/openSUSE:Leap:16.0/python-python-rpm-spec/python-python-rpm-spec.changes 2025-03-19 11:55:44.924437022 +0100 +++ /work/SRC/openSUSE:Leap:16.0/.python-python-rpm-spec.new.8875/python-python-rpm-spec.changes 2025-07-24 08:31:36.467320183 +0200 @@ -1,0 +2,7 @@ +Fri Jan 10 11:07:08 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to 0.16.0 + * Add support for Python 3.13. + * Drop support for Python 3.8 version. + +------------------------------------------------------------------- Old: ---- python_rpm_spec-0.15.0.tar.gz New: ---- python_rpm_spec-0.16.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-rpm-spec.spec ++++++ --- /var/tmp/diff_new_pack.vpUxme/_old 2025-07-24 08:31:36.747331825 +0200 +++ /var/tmp/diff_new_pack.vpUxme/_new 2025-07-24 08:31:36.747331825 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-python-rpm-spec # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-python-rpm-spec -Version: 0.15.0 +Version: 0.16.0 Release: 0 Summary: Python module for parsing RPM spec files License: MIT ++++++ python_rpm_spec-0.15.0.tar.gz -> python_rpm_spec-0.16.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.github/dependabot.yml new/python_rpm_spec-0.16.0/.github/dependabot.yml --- old/python_rpm_spec-0.15.0/.github/dependabot.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/python_rpm_spec-0.16.0/.github/dependabot.yml 2025-01-03 12:23:21.050335200 +0100 @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + assignees: + - "bkircher" + ignore: + - dependency-name: "black" + groups: + minor-and-patch-updates: + update-types: + - "minor" + - "patch" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.github/workflows/fedora-sources.yml new/python_rpm_spec-0.16.0/.github/workflows/fedora-sources.yml --- old/python_rpm_spec-0.15.0/.github/workflows/fedora-sources.yml 2024-02-17 13:04:30.109053100 +0100 +++ new/python_rpm_spec-0.16.0/.github/workflows/fedora-sources.yml 2025-01-03 12:23:21.050335200 +0100 @@ -9,12 +9,12 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 cache: pip - name: Install dependencies @@ -30,4 +30,3 @@ - name: Parse Fedora package sources run: | PYTHONPATH=. python scripts/fedora_sources.py fedora-latest - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.github/workflows/publish.yml new/python_rpm_spec-0.16.0/.github/workflows/publish.yml --- old/python_rpm_spec-0.15.0/.github/workflows/publish.yml 2024-02-17 13:04:30.109053100 +0100 +++ new/python_rpm_spec-0.16.0/.github/workflows/publish.yml 2025-01-03 12:23:21.050335200 +0100 @@ -13,12 +13,12 @@ publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 cache: pip - name: Publish to PyPI using flit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.github/workflows/release.yml new/python_rpm_spec-0.16.0/.github/workflows/release.yml --- old/python_rpm_spec-0.15.0/.github/workflows/release.yml 2024-02-17 13:04:30.109053100 +0100 +++ new/python_rpm_spec-0.16.0/.github/workflows/release.yml 2025-01-03 12:23:21.050335200 +0100 @@ -8,12 +8,12 @@ build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 cache: pip - name: Test build wheel package @@ -27,7 +27,7 @@ permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create release uses: ncipollo/release-action@v1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.github/workflows/test.yml new/python_rpm_spec-0.16.0/.github/workflows/test.yml --- old/python_rpm_spec-0.15.0/.github/workflows/test.yml 2024-02-17 13:04:30.109053100 +0100 +++ new/python_rpm_spec-0.16.0/.github/workflows/test.yml 2025-01-03 12:23:21.050335200 +0100 @@ -14,14 +14,14 @@ matrix: # We try to go with the currently active Python branches: # https://devguide.python.org/versions/#versions - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: pip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.vscode/extensions.json new/python_rpm_spec-0.16.0/.vscode/extensions.json --- old/python_rpm_spec-0.15.0/.vscode/extensions.json 2024-02-17 13:04:30.109053100 +0100 +++ new/python_rpm_spec-0.16.0/.vscode/extensions.json 2025-01-03 12:23:21.050335200 +0100 @@ -1,7 +1,7 @@ { - "recommendations": [ - "ms-python.black-formatter", - "ms-python.pylint", - "ms-python.python" - ] + "recommendations": [ + "ms-python.black-formatter", + "ms-python.pylint", + "ms-python.python" + ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.vscode/launch.json new/python_rpm_spec-0.16.0/.vscode/launch.json --- old/python_rpm_spec-0.15.0/.vscode/launch.json 2024-02-17 13:04:30.109053100 +0100 +++ new/python_rpm_spec-0.16.0/.vscode/launch.json 2025-01-03 12:23:21.050335200 +0100 @@ -1,13 +1,13 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Python: Current File", - "type": "python", - "request": "launch", - "program": "${file}", - "console": "integratedTerminal", - "justMyCode": false - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "justMyCode": false + } + ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/.vscode/settings.json new/python_rpm_spec-0.16.0/.vscode/settings.json --- old/python_rpm_spec-0.15.0/.vscode/settings.json 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/.vscode/settings.json 2025-01-03 12:23:21.050335200 +0100 @@ -1,21 +1,21 @@ { - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", - "editor.rulers": [ - 130 - ], - }, - "black-formatter.args": [ - "--line-length", - "130", - "--target-version", - "py312" - ], - "python.testing.pytestArgs": [ - "tests", - ], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "python.testing.autoTestDiscoverOnSaveEnabled": true, - "editor.formatOnSaveMode": "modifications", + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.rulers": [ + 130 + ] + }, + "black-formatter.args": [ + "--line-length", + "130", + "--target-version", + "py313" + ], + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "python.testing.autoTestDiscoverOnSaveEnabled": true, + "editor.formatOnSaveMode": "modifications" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/CHANGELOG.md new/python_rpm_spec-0.16.0/CHANGELOG.md --- old/python_rpm_spec-0.15.0/CHANGELOG.md 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/CHANGELOG.md 2025-01-03 12:23:21.050335200 +0100 @@ -1,66 +1,100 @@ # Changelog +## 0.16.0 (2025-01-03) + +- Add support for Python 3.13. +- Drop support for Python 3.8 version. + ## 0.15.0 (2024-02-17) -* Add a [GitHub workflow](https://github.com/bkircher/python-rpm-spec/actions/workflows/fedora-sources.yml) that parses all of Fedora's spec files. The workflow runs on each PR. -* The `replace_macro` function gained a new `max_attempts` parameter that prevents endless recursion in certain scenarios. Thanks [@kraptor](https://github.com/kraptor). -* Add support for Python 3.12. -* Drop support for Python 3.7. It is EOL and no longer supported by the Python core team. +- Add a + [GitHub workflow](https://github.com/bkircher/python-rpm-spec/actions/workflows/fedora-sources.yml) + that parses all of Fedora's spec files. The workflow runs on each PR. +- The `replace_macro` function gained a new `max_attempts` parameter that + prevents endless recursion in certain scenarios. Thanks + [@kraptor](https://github.com/kraptor). +- Add support for Python 3.12. +- Drop support for Python 3.7. It is EOL and no longer supported by the Python + core team. ## 0.14.1 (2023-03-11) -* Fix replace_macro's behavior with user-defined conditional macros (PR [#56](https://github.com/bkircher/python-rpm-spec/pull/59)). Thanks [@imphil](https://github.com/imphil). -* The parsing of package names was wrong when tab characters where used in %package ([#57](https://github.com/bkircher/python-rpm-spec/issues/57)). This has been fixed by [@tagoh](https://github.com/tagoh). -* Implement parsing of spec files where sub-packages (`%package`) have their own sources and patches defined. Previously, the parser would just fail with an error message like `AttributeError: 'Package' object has no attribute 'sources'`. This is now fixed. -* Use SemVer for versioning. git tags are now prefixed with `v`, e.g. `v0.15.0` instead of `0.15.0`. +- Fix replace_macro's behavior with user-defined conditional macros (PR + [#56](https://github.com/bkircher/python-rpm-spec/pull/59)). Thanks + [@imphil](https://github.com/imphil). +- The parsing of package names was wrong when tab characters where used in + %package ([#57](https://github.com/bkircher/python-rpm-spec/issues/57)). This + has been fixed by [@tagoh](https://github.com/tagoh). +- Implement parsing of spec files where sub-packages (`%package`) have their own + sources and patches defined. Previously, the parser would just fail with an + error message like + `AttributeError: 'Package' object has no attribute 'sources'`. This is now + fixed. +- Use SemVer for versioning. git tags are now prefixed with `v`, e.g. `v0.15.0` + instead of `0.15.0`. ## 0.14 (2023-01-22) -* Teach replace_macro how to deal with macros that are not wrapped in curly braces (PR [#54](https://github.com/bkircher/python-rpm-spec/pull/54)). -* Add type annotations for tools like mypy, your IDE, and your brain (PR [#55](https://github.com/bkircher/python-rpm-spec/pull/55)). +- Teach replace_macro how to deal with macros that are not wrapped in curly + braces (PR [#54](https://github.com/bkircher/python-rpm-spec/pull/54)). +- Add type annotations for tools like mypy, your IDE, and your brain (PR + [#55](https://github.com/bkircher/python-rpm-spec/pull/55)). ## 0.13 (2022-11-01) -* Fix parsing of BuildRequires:, Requires:, Conflicts:, Obsoletes:, Provides: with comments at end of line. Thanks [@SuoXC](https://github.com/SuoXC). -* Add CI for Python 3.11. +- Fix parsing of BuildRequires:, Requires:, Conflicts:, Obsoletes:, Provides: + with comments at end of line. Thanks [@SuoXC](https://github.com/SuoXC). +- Add CI for Python 3.11. ## 0.12 (2022-07-13) -* Fix %description and %changelog with multi-line strings [#46](https://github.com/bkircher/python-rpm-spec/issues/46). Thanks [@tagoh](https://github.com/tagoh). +- Fix %description and %changelog with multi-line strings + [#46](https://github.com/bkircher/python-rpm-spec/issues/46). Thanks + [@tagoh](https://github.com/tagoh). ## 0.11 (2021-08-05) Changes: -* Add type annotations for tools like mypy, your IDE, and your brain. Thanks [@KOLANICH](https://github.com/KOLANICH). -* `replace_macros()` function now always expects a Spec instance as second argument. Does not make much sense without. -* Add support for parsing %description and %changelog (see PR [#42](https://github.com/bkircher/python-rpm-spec/pull/42)). Thanks [@BrunoVernay](https://github.com/BrunoVernay). -* Add support for ExcludeArch and ExclusiveArch ([#45](https://github.com/bkircher/python-rpm-spec/pull/45)). Thanks [@tonsh](https://github.com/tonsh). -* Add `warnings_enabled` knob to issue [warnings](https://docs.python.org/3/library/warnings.html#module-warnings) of type `UserWarning` during spec file parsing. +- Add type annotations for tools like mypy, your IDE, and your brain. Thanks + [@KOLANICH](https://github.com/KOLANICH). +- `replace_macros()` function now always expects a Spec instance as second + argument. Does not make much sense without. +- Add support for parsing %description and %changelog (see PR + [#42](https://github.com/bkircher/python-rpm-spec/pull/42)). Thanks + [@BrunoVernay](https://github.com/BrunoVernay). +- Add support for ExcludeArch and ExclusiveArch + ([#45](https://github.com/bkircher/python-rpm-spec/pull/45)). Thanks + [@tonsh](https://github.com/tonsh). +- Add `warnings_enabled` knob to issue + [warnings](https://docs.python.org/3/library/warnings.html#module-warnings) of + type `UserWarning` during spec file parsing. ## 0.10 (2020-09-19) Changes: -* Ignore spaces before ':' separator (see PR [#32](https://github.com/bkircher/python-rpm-spec/pull/32)) -* Fix behavior of replace_macro function when macro is a tag, too (see issue [#33](https://github.com/bkircher/python-rpm-spec/issues/33)). +- Ignore spaces before ':' separator (see PR + [#32](https://github.com/bkircher/python-rpm-spec/pull/32)) +- Fix behavior of replace_macro function when macro is a tag, too (see issue + [#33](https://github.com/bkircher/python-rpm-spec/issues/33)). ## 0.9 (2020-05-02) Changes: -* Ignore case when parsing directives +- Ignore case when parsing directives ## 0.8 (2018-09-18) New Features: -* Enable parsing versions in `BuildRequires:` and `Requires:` -* Add support for conditional macros, e.g. `%{?test_macro:expression}` -* Use flit for packaging +- Enable parsing versions in `BuildRequires:` and `Requires:` +- Add support for conditional macros, e.g. `%{?test_macro:expression}` +- Use flit for packaging ## 0.7 (2017-08-10) New Features: -* Add `Spec.sources_dict` and `Spec.patches_dict` +- Add `Spec.sources_dict` and `Spec.patches_dict` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/PKG-INFO new/python_rpm_spec-0.16.0/PKG-INFO --- old/python_rpm_spec-0.15.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/python_rpm_spec-0.16.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +1,11 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.3 Name: python-rpm-spec -Version: 0.15.0 +Version: 0.16.0 Summary: python-rpm-spec is a Python library for parsing RPM spec files. Home-page: https://github.com/bkircher/python-rpm-spec Author: Ben Kircher Author-email: bkirc...@0xadd.de -Requires-Python: >=3.8 +Requires-Python: >=3.9 Description-Content-Type: text/markdown # python-rpm-spec @@ -13,39 +13,47 @@ [](https://github.com/bkircher/python-rpm-spec/actions/workflows/test.yml) [](https://badge.fury.io/py/python-rpm-spec) -python-rpm-spec is a Python library for parsing RPM spec files. +python-rpm-spec is a Python-only library for parsing RPM spec files. -*tl;dr* If you want to quickly parse a spec file on the command line you might want to give `rpmspec --parse` a try. +_tl;dr_ If you want to quickly parse a spec file on the command line you might +want to give `rpmspec --parse` a try. ```sh rpmspec --parse file.spec | awk '/Source/ {print $2}' ``` -If you write Python, have no `/usr/bin/rpm` around, or want to do something slightly more complicated, try using this Python library. +If you write Python, have no `/usr/bin/rpm` around, or want to do something +slightly more complicated, try using this Python library. -RPMs are build from a package's sources along with a spec file. The spec file controls how the RPM is built. This library allows you to parse spec files and gives you simple access to various bits of information that is contained in the spec file. +RPMs are build from a package's sources along with a spec file. The spec file +controls how the RPM is built. This library allows you to parse spec files and +gives you simple access to various bits of information that is contained in the +spec file. ## Features - No extra dependencies other than Python 3. - Available on all platforms, parse spec files on Windows. -- Read-only (for manipulating spec files see [Alternatives](#alternatives) below). +- Read-only (for manipulating spec files see [Alternatives](#alternatives) + below). ## Supported Python versions -All [current Python branches](https://devguide.python.org/versions/#versions) are supported. +All [current Python branches](https://devguide.python.org/versions/#versions) +are supported. | Python Version | Supported Until | | :------------- | --------------: | -| 3.12 | 2028-10 | -| 3.11 | 2027-10 | -| 3.10 | 2026-10 | -| 3.9 | 2025-10 | -| 3.8 | 2024-10 | +| 3.13 | 2029-10 | +| 3.12 | 2028-10 | +| 3.11 | 2027-10 | +| 3.10 | 2026-10 | +| 3.9 | 2025-10 | ## Install -python-rpm-spec is [hosted](https://pypi.org/project/python-rpm-spec/) on PyPI - the Python Package Index. All you need to do is +python-rpm-spec is [hosted](https://pypi.org/project/python-rpm-spec/) on PyPI - +the Python Package Index. All you need to do is ```sh pip install python-rpm-spec @@ -55,6 +63,10 @@ ## Examples +The libraries main API objects are the `Spec` object, representing an entire +spec file and the `replace_macros` function which is used to expand macro's into +absolute string values. + This is how you access a spec file's various definitions: ```python @@ -73,7 +85,6 @@ # llvm-doc: Documentation for LLVM # llvm-libs: LLVM shared libraries # llvm-static: LLVM static libraries - ``` Example showing how to retrieve named source or patch files from a spec: @@ -98,7 +109,8 @@ # llvm-config.h ``` -Example showing how to get versioned `BuildRequires:` and `Requires:` out of a spec file: +Example showing how to get versioned `BuildRequires:` and `Requires:` out of a +spec file: ```python from pyrpm.spec import Spec @@ -118,7 +130,9 @@ # cmake(Qt5Network) >= 5.6.0 ``` -If you want that the library [create warnings](https://docs.python.org/3/library/warnings.html) during parsing, for example on unknown macros, set `warnings_enabled` to `True`: +If you want that the library +[create warnings](https://docs.python.org/3/library/warnings.html) during +parsing, for example on unknown macros, set `warnings_enabled` to `True`: ```python import pyrpm.spec @@ -129,27 +143,43 @@ ## Dependencies -No extra dependencies are required except for Python 3.7 or newer. +No extra dependencies are required except for Python 3.8 or newer. ## Current status -This library is an ambitious Python script that became a library. It is not complete and it does not fit every use case. +This library is an ambitious Python script that became a library. It is not +complete and it does not fit every use case. - It is probably very slow and it relies on regular expressions for parsing. -- It does not parse everything in a spec file, only the pieces myself and others needed so far. +- It does not parse everything in a spec file, only the pieces myself and others + needed so far. -So there is probably still plenty of stuff missing (i.e. support for [`%include`](https://github.com/bkircher/python-rpm-spec/issues/51)). However, it should not be too complicated to add support for the missing pieces. +So there is probably still plenty of stuff missing (i.e. support for +[`%include`](https://github.com/bkircher/python-rpm-spec/issues/51)). However, +it should not be too complicated to add support for the missing pieces. + +Also note that there is a +[GitHub workflow](https://github.com/bkircher/python-rpm-spec/actions/workflows/fedora-sources.yml) +that runs the parser on Fedora's spec files. ## Alternatives Here is a list of alternatives to this library: -- [packit/specfile](https://github.com/packit/specfile) - Allows parsing and, different to python-rpm-spec, the manipulation of spec files. Part of packit. Actively developed as of Mar 2023. -- If you are on a Linux system that has the RPM package manager installed, consider using system tools like - - `rpmspec(8)` from rpm-build package. Example: `rpmspec --parse foo.spec` will parse a spec file to stdout, expanding all the macros installed on the system. Still relies on `$HOME/rpmbuild` to work. - - `rpmdev-spectool(1)` from rpmdevtools package. Example: `spectool --get-files foo.spec` will download all sources and patches from a spec file. +- [packit/specfile](https://github.com/packit/specfile) - Allows parsing and, + different to python-rpm-spec, the manipulation of spec files. Part of packit. + Actively developed as of March 2023. +- If you are on a Linux system that has the RPM package manager installed, + consider using system tools like + - `rpmspec(8)` from rpm-build package. Example: `rpmspec --parse foo.spec` + will parse a spec file to stdout, expanding all the macros installed on the + system. Still relies on `$HOME/rpmbuild` to work. + - `rpmdev-spectool(1)` from rpmdevtools package. Example: + `spectool --get-files foo.spec` will download all sources and patches from a + spec file. - The parsers are probably more up to date and less buggy than this library. + The parsers of those system tools are probably more up to date and less buggy + than this library. ## Development @@ -165,12 +195,20 @@ mypy . # Run the type checker ``` -That's it. +That's it. Make sure to check out the +[issue tracker](https://github.com/bkircher/python-rpm-spec/issues) for things +to work on or open a +[new issue](https://github.com/bkircher/python-rpm-spec/issues/new/choose) to +let others know what you are working on. ## Further references -- [RPM project documentation](https://rpm.org/documentation.html) with a couple of links to books or Fedora project documentation. -- Take a look at the excellent [RPM Packaging Guide](https://rpm-guide.readthedocs.io/en/latest/index.html), especially the section [What is a SPEC File?](https://rpm-guide.readthedocs.io/en/latest/rpm-guide.html#what-is-a-spec-file) +- [RPM project documentation](https://rpm.org/documentation.html) with a couple + of links to books or Fedora project documentation. +- Take a look at the excellent + [RPM Packaging Guide](https://rpm-guide.readthedocs.io/en/latest/index.html), + especially the section + [What is a SPEC File?](https://rpm-guide.readthedocs.io/en/latest/rpm-guide.html#what-is-a-spec-file) Happy hacking! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/README.md new/python_rpm_spec-0.16.0/README.md --- old/python_rpm_spec-0.15.0/README.md 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/README.md 2025-01-03 12:23:21.051335000 +0100 @@ -3,39 +3,47 @@ [](https://github.com/bkircher/python-rpm-spec/actions/workflows/test.yml) [](https://badge.fury.io/py/python-rpm-spec) -python-rpm-spec is a Python library for parsing RPM spec files. +python-rpm-spec is a Python-only library for parsing RPM spec files. -*tl;dr* If you want to quickly parse a spec file on the command line you might want to give `rpmspec --parse` a try. +_tl;dr_ If you want to quickly parse a spec file on the command line you might +want to give `rpmspec --parse` a try. ```sh rpmspec --parse file.spec | awk '/Source/ {print $2}' ``` -If you write Python, have no `/usr/bin/rpm` around, or want to do something slightly more complicated, try using this Python library. +If you write Python, have no `/usr/bin/rpm` around, or want to do something +slightly more complicated, try using this Python library. -RPMs are build from a package's sources along with a spec file. The spec file controls how the RPM is built. This library allows you to parse spec files and gives you simple access to various bits of information that is contained in the spec file. +RPMs are build from a package's sources along with a spec file. The spec file +controls how the RPM is built. This library allows you to parse spec files and +gives you simple access to various bits of information that is contained in the +spec file. ## Features - No extra dependencies other than Python 3. - Available on all platforms, parse spec files on Windows. -- Read-only (for manipulating spec files see [Alternatives](#alternatives) below). +- Read-only (for manipulating spec files see [Alternatives](#alternatives) + below). ## Supported Python versions -All [current Python branches](https://devguide.python.org/versions/#versions) are supported. +All [current Python branches](https://devguide.python.org/versions/#versions) +are supported. | Python Version | Supported Until | | :------------- | --------------: | -| 3.12 | 2028-10 | -| 3.11 | 2027-10 | -| 3.10 | 2026-10 | -| 3.9 | 2025-10 | -| 3.8 | 2024-10 | +| 3.13 | 2029-10 | +| 3.12 | 2028-10 | +| 3.11 | 2027-10 | +| 3.10 | 2026-10 | +| 3.9 | 2025-10 | ## Install -python-rpm-spec is [hosted](https://pypi.org/project/python-rpm-spec/) on PyPI - the Python Package Index. All you need to do is +python-rpm-spec is [hosted](https://pypi.org/project/python-rpm-spec/) on PyPI - +the Python Package Index. All you need to do is ```sh pip install python-rpm-spec @@ -45,6 +53,10 @@ ## Examples +The libraries main API objects are the `Spec` object, representing an entire +spec file and the `replace_macros` function which is used to expand macro's into +absolute string values. + This is how you access a spec file's various definitions: ```python @@ -63,7 +75,6 @@ # llvm-doc: Documentation for LLVM # llvm-libs: LLVM shared libraries # llvm-static: LLVM static libraries - ``` Example showing how to retrieve named source or patch files from a spec: @@ -88,7 +99,8 @@ # llvm-config.h ``` -Example showing how to get versioned `BuildRequires:` and `Requires:` out of a spec file: +Example showing how to get versioned `BuildRequires:` and `Requires:` out of a +spec file: ```python from pyrpm.spec import Spec @@ -108,7 +120,9 @@ # cmake(Qt5Network) >= 5.6.0 ``` -If you want that the library [create warnings](https://docs.python.org/3/library/warnings.html) during parsing, for example on unknown macros, set `warnings_enabled` to `True`: +If you want that the library +[create warnings](https://docs.python.org/3/library/warnings.html) during +parsing, for example on unknown macros, set `warnings_enabled` to `True`: ```python import pyrpm.spec @@ -119,27 +133,43 @@ ## Dependencies -No extra dependencies are required except for Python 3.7 or newer. +No extra dependencies are required except for Python 3.8 or newer. ## Current status -This library is an ambitious Python script that became a library. It is not complete and it does not fit every use case. +This library is an ambitious Python script that became a library. It is not +complete and it does not fit every use case. - It is probably very slow and it relies on regular expressions for parsing. -- It does not parse everything in a spec file, only the pieces myself and others needed so far. +- It does not parse everything in a spec file, only the pieces myself and others + needed so far. -So there is probably still plenty of stuff missing (i.e. support for [`%include`](https://github.com/bkircher/python-rpm-spec/issues/51)). However, it should not be too complicated to add support for the missing pieces. +So there is probably still plenty of stuff missing (i.e. support for +[`%include`](https://github.com/bkircher/python-rpm-spec/issues/51)). However, +it should not be too complicated to add support for the missing pieces. + +Also note that there is a +[GitHub workflow](https://github.com/bkircher/python-rpm-spec/actions/workflows/fedora-sources.yml) +that runs the parser on Fedora's spec files. ## Alternatives Here is a list of alternatives to this library: -- [packit/specfile](https://github.com/packit/specfile) - Allows parsing and, different to python-rpm-spec, the manipulation of spec files. Part of packit. Actively developed as of Mar 2023. -- If you are on a Linux system that has the RPM package manager installed, consider using system tools like - - `rpmspec(8)` from rpm-build package. Example: `rpmspec --parse foo.spec` will parse a spec file to stdout, expanding all the macros installed on the system. Still relies on `$HOME/rpmbuild` to work. - - `rpmdev-spectool(1)` from rpmdevtools package. Example: `spectool --get-files foo.spec` will download all sources and patches from a spec file. +- [packit/specfile](https://github.com/packit/specfile) - Allows parsing and, + different to python-rpm-spec, the manipulation of spec files. Part of packit. + Actively developed as of March 2023. +- If you are on a Linux system that has the RPM package manager installed, + consider using system tools like + - `rpmspec(8)` from rpm-build package. Example: `rpmspec --parse foo.spec` + will parse a spec file to stdout, expanding all the macros installed on the + system. Still relies on `$HOME/rpmbuild` to work. + - `rpmdev-spectool(1)` from rpmdevtools package. Example: + `spectool --get-files foo.spec` will download all sources and patches from a + spec file. - The parsers are probably more up to date and less buggy than this library. + The parsers of those system tools are probably more up to date and less buggy + than this library. ## Development @@ -155,11 +185,19 @@ mypy . # Run the type checker ``` -That's it. +That's it. Make sure to check out the +[issue tracker](https://github.com/bkircher/python-rpm-spec/issues) for things +to work on or open a +[new issue](https://github.com/bkircher/python-rpm-spec/issues/new/choose) to +let others know what you are working on. ## Further references -- [RPM project documentation](https://rpm.org/documentation.html) with a couple of links to books or Fedora project documentation. -- Take a look at the excellent [RPM Packaging Guide](https://rpm-guide.readthedocs.io/en/latest/index.html), especially the section [What is a SPEC File?](https://rpm-guide.readthedocs.io/en/latest/rpm-guide.html#what-is-a-spec-file) +- [RPM project documentation](https://rpm.org/documentation.html) with a couple + of links to books or Fedora project documentation. +- Take a look at the excellent + [RPM Packaging Guide](https://rpm-guide.readthedocs.io/en/latest/index.html), + especially the section + [What is a SPEC File?](https://rpm-guide.readthedocs.io/en/latest/rpm-guide.html#what-is-a-spec-file) Happy hacking! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/mypy.ini new/python_rpm_spec-0.16.0/mypy.ini --- old/python_rpm_spec-0.15.0/mypy.ini 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/mypy.ini 2025-01-03 12:23:21.051335000 +0100 @@ -5,7 +5,7 @@ # Display the codes needed for # type: ignore[code] annotations. show_error_codes = True -python_version = 3.12 +python_version = 3.13 # Stricter type checking. disallow_untyped_calls = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/pyproject.toml new/python_rpm_spec-0.16.0/pyproject.toml --- old/python_rpm_spec-0.15.0/pyproject.toml 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/pyproject.toml 2025-01-03 12:23:21.051335000 +0100 @@ -8,9 +8,9 @@ author = "Ben Kircher" author-email = "bkirc...@0xadd.de" home-page = "https://github.com/bkircher/python-rpm-spec" -requires-python = ">=3.8" +requires-python = ">=3.9" description-file = "README.md" [tool.ruff] -target-version = "py312" +target-version = "py313" line-length = 130 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/pyrpm/__init__.py new/python_rpm_spec-0.16.0/pyrpm/__init__.py --- old/python_rpm_spec-0.15.0/pyrpm/__init__.py 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/pyrpm/__init__.py 2025-01-03 12:23:21.051335000 +0100 @@ -1,3 +1,3 @@ """python-rpm-spec is a Python library for parsing RPM spec files.""" -__version__ = "0.15.0" +__version__ = "0.16.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/pyrpm/spec.py new/python_rpm_spec-0.16.0/pyrpm/spec.py --- old/python_rpm_spec-0.15.0/pyrpm/spec.py 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/pyrpm/spec.py 2025-01-03 12:23:21.051335000 +0100 @@ -163,8 +163,6 @@ ]: # Remove comments on same line value = value.split("#", 2)[0].rstrip() - # Macros are valid in requirements - value = replace_macros(value, spec=spec_obj) # It's also legal to do: # Requires: a b c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/requirements.txt new/python_rpm_spec-0.16.0/requirements.txt --- old/python_rpm_spec-0.15.0/requirements.txt 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/requirements.txt 2025-01-03 12:23:21.052335300 +0100 @@ -1,8 +1,8 @@ -black==24.2.0 -coverage==7.4.1 -flit==3.9.0 -mypy==1.8.0 -pylint==3.0.3 -pytest-cov==4.1.0 -pytest==8.0.0 -rope==1.12.0 +black==24.10.0 +coverage==7.6.10 +flit==3.10.1 +mypy==1.14.0 +pylint==3.3.3 +pytest-cov==5.0.0 +pytest==8.3.4 +rope==1.13.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python_rpm_spec-0.15.0/scripts/fedora_sources.py new/python_rpm_spec-0.16.0/scripts/fedora_sources.py --- old/python_rpm_spec-0.15.0/scripts/fedora_sources.py 2024-02-17 13:04:30.113053300 +0100 +++ new/python_rpm_spec-0.16.0/scripts/fedora_sources.py 2025-01-03 12:23:21.052335300 +0100 @@ -4,15 +4,8 @@ from pyrpm.spec import Spec -# Spec files to skip because of known issues. All of the following end up in an -# endless loop -skipfiles = ( - "cairo-dock.spec", - "ghc", - "libreoffice.spec", - "python-pyghmi.spec", - "xscreensaver.spec", -) +# Spec files to skip because of known issues. +skipfiles = () def skip(filename: str) -> bool: