Compare commits

...
Sign in to create a new pull request.

21 commits

Author SHA1 Message Date
Packit
59eed68aac [packit] 0.17.0 upstream release
Upstream tag: 0.17.0
Upstream commit: bc4fbbdd
2023-05-11 09:49:24 +00:00
Packit
9ec0d0ccdf [packit] 0.16.0 upstream release
Upstream tag: 0.16.0
Upstream commit: 15be0aba
2023-04-20 17:03:54 +00:00
Packit
d871fc8557 [packit] 0.15.0 upstream release
Upstream tag: 0.15.0
Upstream commit: efb94f1d

Signed-off-by: Packit <hello@packit.dev>
2023-03-10 11:25:08 +00:00
Packit
38e4c433cc [packit] 0.14.0 upstream release
Upstream tag: 0.14.0
Upstream commit: 78e2e8b3

Signed-off-by: Packit <hello@packit.dev>
2023-02-23 16:16:02 +00:00
Packit
69000ae2c6 [packit] 0.13.2 upstream release
Upstream tag: 0.13.2
Upstream commit: dc2440f6

Signed-off-by: Packit <hello@packit.dev>
2023-01-30 13:29:30 +00:00
Packit
066bb2d04d [packit] 0.13.1 upstream release
Upstream tag: 0.13.1
Upstream commit: 326ceffa

Signed-off-by: Packit <hello@packit.dev>
2023-01-23 15:03:00 +00:00
Packit
67a63d0b5f [packit] 0.13.0 upstream release
Upstream tag: 0.13.0
Upstream commit: 032a6e24

Signed-off-by: Packit <hello@packit.dev>
2023-01-20 15:24:29 +00:00
Packit
3453cd5ad0 [packit] 0.12.0 upstream release
Upstream tag: 0.12.0
Upstream commit: 1f184858

Signed-off-by: Packit <hello@packit.dev>
2023-01-06 13:52:38 +00:00
Packit
88b4b5dda4 [packit] 0.11.1 upstream release
Upstream tag: 0.11.1
Upstream commit: 3581c3cd

Signed-off-by: Packit <hello@packit.dev>
2022-12-14 16:41:55 +00:00
Packit
5c59e17587 [packit] 0.11.0 upstream release
Upstream tag: 0.11.0
Upstream commit: ad039af9

Signed-off-by: Packit <hello@packit.dev>
2022-12-09 14:21:55 +00:00
Packit
0193c27479 [packit] 0.10.0 upstream release
Upstream tag: 0.10.0
Upstream commit: daf36bc3

Signed-off-by: Packit <hello@packit.dev>
2022-11-30 11:33:42 +00:00
Packit
634ea94c65 [packit] 0.9.1 upstream release
Upstream tag: 0.9.1
Upstream commit: 11b91ccc

Signed-off-by: Packit <hello@packit.dev>
2022-11-12 14:38:02 +00:00
Packit
8a36560b56 [packit] 0.9.0 upstream release
Upstream tag: 0.9.0
Upstream commit: 6b6cbeae

Signed-off-by: Packit <hello@packit.dev>
2022-10-25 17:30:40 +00:00
Packit
dcb55c492e [packit] 0.8.0 upstream release
Upstream tag: 0.8.0
Upstream commit: a3262621

Signed-off-by: Packit <hello@packit.dev>
2022-10-14 11:36:32 +00:00
Packit
81bf767dbe [packit] 0.7.0 upstream release
Upstream tag: 0.7.0
Upstream commit: e121363b

Signed-off-by: Packit <hello@packit.dev>
2022-10-07 14:31:54 +00:00
Packit
fae6c20bb6 [packit] 0.6.0 upstream release
Upstream tag: 0.6.0
Upstream commit: 8b0a6cc4

Signed-off-by: Packit <hello@packit.dev>
2022-08-25 13:15:42 +00:00
Packit
92ebe96d7f [packit] 0.5.1 upstream release
Upstream tag: 0.5.1
Upstream commit: a03b8972

Signed-off-by: Packit <hello@packit.dev>
2022-08-10 09:54:07 +00:00
Packit
44a3b5b4f5 [packit] 0.5.0 upstream release
Upstream tag: 0.5.0
Upstream commit: e4f80e56

Signed-off-by: Packit <hello@packit.dev>
2022-07-22 08:04:50 +00:00
Packit
303e08c667 [packit] 0.4.0 upstream release
Upstream tag: 0.4.0
Upstream commit: d3b97670

Signed-off-by: Packit <hello@packit.dev>
2022-06-21 13:32:34 +00:00
Packit
f7967f73f4 [packit] 0.3.0 upstream release
Upstream tag: 0.3.0
Upstream commit: df62e212

Signed-off-by: Packit <hello@packit.dev>
2022-05-16 12:14:04 +00:00
Packit
bdd90c0e32 [packit] 0.2.0 upstream release
Upstream tag: 0.2.0
Upstream commit: a15b0918

Signed-off-by: Packit <hello@packit.dev>
2022-03-31 10:07:47 +00:00
10 changed files with 318 additions and 7 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

111
.packit.yaml Normal file
View file

@ -0,0 +1,111 @@
---
# We want to use both instances for all upstream jobs including the `propose-downstream` one.
# For downstream, we need to pick just one instance (`stg` in our case)
# and redefine it for the `koji_build` and `bodhi_update` jobs.
packit_instances: ["prod", "stg"]
specfile_path: fedora/python-specfile.spec
# add or remove files that should be synced
files_to_sync:
- fedora/python-specfile.spec
- .packit.yaml
- src: plans/
dest: plans/
- src: .fmf/
dest: .fmf/
# name in upstream package repository or registry (e.g. in PyPI)
upstream_package_name: specfile
# downstream (Fedora) RPM package name
downstream_package_name: python-specfile
copy_upstream_release_description: true
upstream_project_url: https://github.com/packit/specfile
issue_repository: https://github.com/packit/specfile
actions:
# we need this b/c `git archive` doesn't put all the metadata in the tarball:
# LookupError: setuptools-scm was unable to detect version for '/builddir/build/BUILD/ogr-0.11.1'.
# Make sure you're either building from a fully intact git repository or PyPI tarballs.
create-archive:
- python3 -m build --sdist --outdir ./fedora/
- bash -c "ls -1t ./fedora/*.tar.gz | head -n 1"
get-current-version: python3 -m setuptools_scm
pre-sync:
# FMF has to be installed on system where you are calling this tool.
- python3 plans/git_reference.py
srpm_build_deps:
- python3-build
- python3-setuptools_scm
jobs:
- job: propose_downstream
trigger: release
dist_git_branches:
- fedora-all
- epel-9
- job: copr_build
trigger: pull_request
targets:
- fedora-all
- epel-9
- job: tests
trigger: pull_request
targets:
- fedora-all
- epel-9
- job: copr_build
trigger: commit
branch: main
targets:
- fedora-all
- epel-9
project: packit-dev
list_on_homepage: True
preserve_project: True
- job: copr_build
trigger: commit
branch: stable
targets:
- fedora-stable
- epel-9
project: packit-stable
list_on_homepage: True
preserve_project: True
- job: copr_build
trigger: release
targets:
- fedora-all
- epel-9
project: packit-releases
list_on_homepage: True
preserve_project: True
- job: pull_from_upstream
trigger: release
dist_git_branches:
- fedora-all
- epel-9
# downstream automation:
- job: koji_build
trigger: commit
packit_instances: ["stg"]
allowed_pr_authors: ["packit-stg", "packit"]
dist_git_branches:
- fedora-all
- epel-9
- job: bodhi_update
trigger: commit
packit_instances: ["stg"]
dist_git_branches:
- fedora-branched # rawhide updates are created automatically
- epel-9

3
README.packit Normal file
View file

@ -0,0 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.75.0.post9+g9ce4c01.

12
plans/full.fmf Normal file
View file

@ -0,0 +1,12 @@
summary:
Unit & integration tests
discover+:
filter: tier:1
adjust:
- when: "distro == rhel-9 or distro == centos-9 or distro == centos-stream-9"
because: "flexmock is not in EPEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=2120251"
prepare:
- how: install
package: python3-pip
- how: shell
script: pip3 install flexmock

29
plans/git_reference.py Normal file
View file

@ -0,0 +1,29 @@
#!/usr/bin/python
import subprocess
from pathlib import Path
import fmf
# Set discover of specfile tests to a fixed commit
tree_root = Path.cwd().absolute()
tree = fmf.Tree(tree_root)
main_node = tree.find("/plans")
with main_node as data:
data["discover"]["url"] = "https://github.com/packit/specfile.git"
data["discover"]["ref"] = (
subprocess.check_output(["git", "rev-parse", "HEAD"]).decode().strip()
)
# Set discover of packit integration tests to the current main
packit_node = tree.find("/plans/packit-integration")
with packit_node as data:
data["discover"]["ref"] = (
subprocess.check_output(
["git", "ls-remote", "https://github.com/packit/packit", "main"]
)
.decode()
.strip()
.split()[0]
)

6
plans/main.fmf Normal file
View file

@ -0,0 +1,6 @@
discover:
how: fmf
url: https://github.com/packit/specfile.git
ref: bc4fbbdd7073f69b8ab9a1e1e3afc5140b5c348f
execute:
how: tmt

View file

@ -0,0 +1,24 @@
discover:
how: fmf
url: https://github.com/packit/packit
filter: tier:0 | tier:1
ref: 33d32c702b3d26a81e12984d925222ce9935dee7
prepare:
- how: install
copr: packit/packit-dev
- how: shell
script: dnf -y config-manager --save --setopt="*:packit:packit-dev.priority=5"
adjust:
- when: how == integration
because: provide latest python-specfile rpm when running locally
prepare+:
- name: python3-specfile rpm
how: install
directory: noarch/
- when: distro == rhel-9 or distro == centos-9 or distro == centos-stream-9
because: 'flexmock and deepdiff are not in EPEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=2120251'
prepare+:
- how: install
package: python3-pip
- how: shell
script: pip3 install flexmock deepdiff

4
plans/smoke.fmf Normal file
View file

@ -0,0 +1,4 @@
summary:
Basic smoke test
discover+:
filter: tier:0

View file

@ -1,3 +1,11 @@
%if 0%{?rhel} == 9
# RHEL 9 is missing python-flexmock
%bcond_with tests
%else
%bcond_without tests
%endif
%global desc %{expand:
Python library for parsing and manipulating RPM spec files.
Main focus is on modifying existing spec files, any change should result
@ -5,18 +13,22 @@ in a minimal diff.}
Name: python-specfile
Version: 0.1.1
Version: 0.17.0
Release: 1%{?dist}
Summary: A library for parsing and manipulating RPM spec files
License: MIT
URL: https://github.com/packit/specfile
Source0: https://github.com/packit/specfile/archive/%{version}/specfile-%{version}.tar.gz
Source0: %{pypi_source specfile}
BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel
%if %{with tests}
# tests/unit/test_guess_packager.py
BuildRequires: git-core
%endif
%description
@ -31,14 +43,14 @@ Summary: %{summary}
%{desc}
%generate_buildrequires
%pyproject_buildrequires -x testing
%prep
%autosetup -p1 -n specfile-%{version}
%generate_buildrequires
%pyproject_buildrequires %{?with_tests: -x testing}
%build
%pyproject_wheel
@ -48,8 +60,10 @@ Summary: %{summary}
%pyproject_save_files specfile
%if %{with tests}
%check
%pytest
%endif
%files -n python%{python3_pkgversion}-specfile -f %{pyproject_files}
@ -57,6 +71,113 @@ Summary: %{summary}
%changelog
* Thu May 11 2023 Packit <hello@packit.dev> - 0.17.0-1
- Added a new `guess_packager()` function that uses similar heuristics as `rpmdev-packager`, meaning that the `Specfile.add_changelog_entry()` method no longer requires `rpmdev-packager` to guess the changelog entry author. (#220)
- The `Specfile.add_changelog_entry()` method now uses dates based on UTC instead of the local timezone. (#223)
* Thu Apr 20 2023 Packit <hello@packit.dev> - 0.16.0-1
- Added `Specfile.has_autorelease` property to detect if a spec file uses the `%%autorelease` macro. (#221)
* Fri Mar 10 2023 Packit <hello@packit.dev> - 0.15.0-1
- Parsing the spec file by RPM is now performed only if really necessary, greatly improving performance in certain scenarios. (#212)
- Checked that license is a valid SPDX license.
* Thu Feb 23 2023 Packit <hello@packit.dev> - 0.14.0-1
- Fixed a bug that broke parsing in case spec file contained conditionalized macro definitions or similar constructs. (#209)
- Specfile no longer depends on rpm-py-installer, it now depends directly on rpm. (#207)
* Mon Jan 30 2023 Packit <hello@packit.dev> - 0.13.2-1
- Fixed infinite loop that occured when section options were followed by whitespace. (#197)
* Mon Jan 23 2023 Packit <hello@packit.dev> - 0.13.1-1
- Fixed a bug in section parsing that caused sections to be ignored when there were macro definitions spread across the spec file and not cumulated at the top. (#191)
* Fri Jan 20 2023 Packit <hello@packit.dev> - 0.13.0-1
- Added `Section.options` attribute for convenient manipulation of section options. (#183)
- specfile now supports single-line sections where section content is represented by a macro starting with a newline. (#182)
- Added `evr` argument to `Specfile.add_changelog_entry()`. This allows adding a changelog entry with an EVR value that's different from the current specfile's value. This makes it easier to reconstruct a specfile's `%changelog` based on another source using the higher level interface. (#181)
* Fri Jan 06 2023 Packit <hello@packit.dev> - 0.12.0-1
- All classes including `Specfile` itself can now be copied using the standard `copy()` and `deepcopy()` functions from `copy` module. (#176)
- `Section.name` attribute has been renamed to a more fitting `Section.id`. (#167)
- `setup.cfg` now uses `license_files` instead of deprecated `license_file`. (#162)
* Wed Dec 14 2022 Packit <hello@packit.dev> - 0.11.1-1
- Tags enclosed in conditional macro expansions are not ignored anymore. (#156)
- Fixed context managers being shared between Specfile instances. (#157)
* Fri Dec 09 2022 Packit <hello@packit.dev> - 0.11.0-1
- Context managers (`Specfile.sections()`, `Specfile.tags()` etc.) can now be nested and combined together (with one exception - `Specfile.macro_definitions()`), and it is also possible to use tag properties (e.g. `Specfile.version`, `Specfile.license`) inside them. It is also possible to access the data directly, avoiding the `with` statement, by using the `content` property (e.g. `Specfile.tags().content`), but be aware that no modifications done to such data will be preserved. You must use `with` to make changes. (#153)
* Wed Nov 30 2022 Packit <hello@packit.dev> - 0.10.0-1
- Fixed an issue that caused empty lines originally inside changelog entries to appear at the end. (#140)
- Renamed the `ignore_missing_includes` option to a more general `force_parse`. If specified, it allows to attempt to parse the spec file even if one or more sources required to be present at parsing time are not available. Such sources include sources referenced from shell expansions in tag values and sources included using the `%include` directive. (#137)
* Sat Nov 12 2022 Packit <hello@packit.dev> - 0.9.1-1
- `specfile` now supports localized tags (e.g. `Summary(fr)`) and tags with qualifiers (e.g. `Requires(post)`).
It also follows more closely rpm parsing logic and doesn't fail on invalid section names. (#132)
* Tue Oct 25 2022 Packit <hello@packit.dev> - 0.9.0-1
- Added utility classes for working with (N)EVR. (#113)
- Fixed an issue with multiple instances of `Specfile` not expanding macros in the right context. (#117)
* Fri Oct 14 2022 Packit <hello@packit.dev> - 0.8.0-1
- Added `Specfile.update_tag()` method that allows updating tag values while trying to preserve macro expansions. You can watch a demo on [YouTube](https://youtu.be/yzMfBPdFXZY). (#101)
* Fri Oct 07 2022 Packit <hello@packit.dev> - 0.7.0-1
- It is now possible to filter changelog entries by specifying lower bound EVR, upper bound EVR or both. (#104)
- Added support for filenames specified in source URL fragments, for example: `https://example.com/foo/1.0/download.cgi#/%{name}-%{version}.tar.gz` (#100)
* Thu Aug 25 2022 Packit <hello@packit.dev> - 0.6.0-1
- Switched to our own implementation of working with `%changelog` timestamps and removed dependency on arrow (#88)
- Fixed requires of EPEL 8 rpm (#86)
* Wed Aug 10 2022 Packit <hello@packit.dev> - 0.5.1-1
- Added new `%conf` section (#74)
- Switched to rpm-py-installer (#75)
- Fixed detecting extended timestamp format in `%changelog` (#77, #81)
* Fri Jul 22 2022 Packit <hello@packit.dev> - 0.5.0-1
- Strict optional typing is now enforced (#68)
- Fixed deduplication of tag names (#69)
- Sources and patches can now be removed by number (#69)
- Number of digits in a source number is now expressed the same way as packit does it (#69)
- Empty lines are now compressed when deleting tags (#69)
- Added convenience property for getting texts of tag comments (#69)
- Added convenience method for adding a patch (#69)
* Tue Jun 21 2022 Packit <hello@packit.dev> - 0.4.0-1
- Added convenience properties for most used tags (#63)
- Hardened linting by ignoring only specific mypy errors (#64)
- Fixed list of valid tag names and ensured newly added tags are not part of a condition block (#66)
- Initial patch number and its default number of digits are now honored (#66)
- Fixed a bug in `%prep` macro stringification (#67)
* Mon May 16 2022 Packit <hello@packit.dev> - 0.3.0-1
- Made `Sources` a `MutableSequence` (#36)
- Started using consistent terminology for source numbers and added the option to insert a source with a specific number (#47)
- Added support for implicit source numbering (#48)
- Documented sources and `%prep` macros in README (#49)
- Implemented high-level manipulation of version and release (#54)
- Added support for `* Mon May 16 2022 John Doe <packager@example.com> - 0.3.0-1.fc35
- local build` (#56)
- Added `remote` property to sources and enabled addition of `Sources` (#59)
- Implemented mid-level manipulation of `%prep` section, including modification of `%prep` macros (#37, #52)
* Thu Mar 31 2022 Packit <hello@packit.dev> - 0.2.0-1
- Enabled Zuul CI (#8)
- Switched from git:// to https:// for rebase hook (#22)
- Updated pre-commit configuration and adapted to type changes brought by new version of mypy (#24)
- Non-lowercase section names are now supported (#26)
- Added `Sections.get()` convenience method (#29)
- Added packit configuration and enabled packit (#25)
- Fixed infinite recursion when deep-copying instances of `Sections` and `Tags` (#30)
- Updated Fedora and EPEL spec files (#32)
- Fixed issues caused by older versions of dependencies on EPEL 8 (#33)
- Implemented high-level manipulation of sources and patches (#20, #36)
- It is now possible to parse spec files with missing local sources (#23)
* Mon Feb 21 2022 Nikola Forró <nforro@redhat.com> - 0.1.1-1
- New upstream release 0.1.1

View file

@ -1 +1 @@
SHA512 (specfile-0.1.1.tar.gz) = c4714e7170ea27cb309d0137b831e067361d00d384646dd2e07876221256de3f4b32b06addfe78924f17046b96d63f53f33e4fe6f22ca20561e154629c49fbed
SHA512 (specfile-0.17.0.tar.gz) = 236c9a3b74b0c767d1ea0b40a459fb082f59c3e6ce4e0c1fc93525f67d1aa176e56a230d181d0007799b1cb781fccfa94d226cbac06550bde3cc2f8259a8eb09