Compare commits
12 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f03fc0cbf0 | ||
|
|
8f89aac628 | ||
|
|
8729e557b7 | ||
|
|
7af5d518d3 | ||
|
|
1beb60ce7d | ||
|
|
ce016c61d3 | ||
|
|
653bdc2d34 | ||
|
|
23c8900ee9 | ||
|
|
3f2ccaba40 | ||
|
|
84a792d169 | ||
|
|
7c78511082 | ||
|
|
8d5cc741b4 |
12 changed files with 484 additions and 0 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/specfile-*.tar.gz
|
||||
245
.packit.yaml
Normal file
245
.packit.yaml
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
---
|
||||
packit_instances: ["prod", "stg"]
|
||||
|
||||
upstream_project_url: https://github.com/packit/specfile
|
||||
issue_repository: https://github.com/packit/specfile
|
||||
|
||||
# PEP440
|
||||
prerelease_suffix_pattern: "([.\\-_]?)(a(lpha)?|b(eta)?|r?c|pre(view)?)([.\\-_]?\\d+)?"
|
||||
prerelease_suffix_macro: prerelease
|
||||
|
||||
copy_upstream_release_description: true
|
||||
|
||||
packages:
|
||||
specfile: &specfile
|
||||
upstream_package_name: specfile
|
||||
downstream_package_name: python-specfile
|
||||
specfile_path: &specfile_path fedora/python-specfile.spec
|
||||
files_to_sync:
|
||||
- *specfile_path
|
||||
- .packit.yaml
|
||||
- src: plans/
|
||||
dest: plans/
|
||||
- src: .fmf/
|
||||
dest: .fmf/
|
||||
srpm_build_deps:
|
||||
- python3-build
|
||||
- python3-setuptools_scm
|
||||
actions: &actions
|
||||
pre-sync:
|
||||
- python3 plans/git_reference.py
|
||||
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
|
||||
|
||||
specfile-epel8:
|
||||
<<: *specfile
|
||||
specfile_path: &specfile_path_epel8 epel8/python-specfile.spec
|
||||
files_to_sync:
|
||||
- *specfile_path_epel8
|
||||
- .packit.yaml
|
||||
- src: plans/
|
||||
dest: plans/
|
||||
- src: .fmf/
|
||||
dest: .fmf/
|
||||
actions:
|
||||
<<: *actions
|
||||
create-archive:
|
||||
- python3 setup.py sdist --dist-dir ./epel8/
|
||||
- bash -c "ls -1t ./epel8/*.tar.gz | head -n 1"
|
||||
|
||||
# docs: https://gitlab.com/CentOS/Integration/packit-cbs/docs
|
||||
specfile-centos-integration-sig:
|
||||
<<: *specfile
|
||||
specfile_path: &specfile_path_centos_sig centos-integration-sig/python-specfile.spec
|
||||
files_to_sync:
|
||||
- *specfile_path_centos_sig
|
||||
- .packit.yaml
|
||||
- src: plans/
|
||||
dest: plans/
|
||||
- src: .fmf/
|
||||
dest: .fmf/
|
||||
actions:
|
||||
<<: *actions
|
||||
create-archive:
|
||||
- python3 -m build --sdist --outdir ./centos-integration-sig/
|
||||
- bash -c "ls -1t ./centos-integration-sig/*.tar.gz | head -n 1"
|
||||
dist_git_base_url: https://gitlab.com
|
||||
dist_git_namespace: CentOS/Integration/packit-cbs/rpms
|
||||
sig: Integration/packit-cbs
|
||||
pkg_tool: centpkg-sig
|
||||
|
||||
jobs:
|
||||
- &copr_build_pr
|
||||
job: copr_build
|
||||
trigger: pull_request
|
||||
packages: [specfile]
|
||||
targets:
|
||||
- fedora-all
|
||||
- fedora-all-aarch64
|
||||
- epel-9
|
||||
- epel-10-all
|
||||
- <<: *copr_build_pr
|
||||
packages: [specfile-epel8]
|
||||
targets:
|
||||
- epel-8
|
||||
|
||||
- &copr_build_commit_main
|
||||
job: copr_build
|
||||
trigger: commit
|
||||
branch: main
|
||||
packages: [specfile]
|
||||
targets:
|
||||
- fedora-all
|
||||
- fedora-all-aarch64
|
||||
- epel-9
|
||||
- epel-10-all
|
||||
project: packit-dev
|
||||
list_on_homepage: True
|
||||
preserve_project: True
|
||||
- <<: *copr_build_commit_main
|
||||
packages: [specfile-epel8]
|
||||
targets:
|
||||
- epel-8
|
||||
|
||||
- &copr_build_commit_stable
|
||||
job: copr_build
|
||||
trigger: commit
|
||||
branch: stable
|
||||
packages: [specfile]
|
||||
targets:
|
||||
- fedora-stable
|
||||
- fedora-stable-aarch64
|
||||
project: packit-stable
|
||||
list_on_homepage: True
|
||||
preserve_project: True
|
||||
|
||||
- &copr_build_release
|
||||
job: copr_build
|
||||
trigger: release
|
||||
packages: [specfile]
|
||||
targets:
|
||||
- fedora-all
|
||||
- fedora-all-aarch64
|
||||
- epel-9
|
||||
- epel-10-all
|
||||
project: packit-releases
|
||||
list_on_homepage: True
|
||||
preserve_project: True
|
||||
- <<: *copr_build_release
|
||||
packages: [specfile-epel8]
|
||||
targets:
|
||||
- epel-8
|
||||
|
||||
- &tests
|
||||
job: tests
|
||||
trigger: pull_request
|
||||
packages: [specfile]
|
||||
tmt_plan: "smoke|full|packit-integration"
|
||||
targets:
|
||||
- fedora-all
|
||||
- epel-9
|
||||
- epel-10-all
|
||||
- <<: *tests
|
||||
identifier: performance
|
||||
tmt_plan: performance
|
||||
targets:
|
||||
- fedora-rawhide
|
||||
- <<: *tests
|
||||
packages: [specfile-epel8]
|
||||
tmt_plan: "smoke|full"
|
||||
use_internal_tf: true
|
||||
targets:
|
||||
epel-8-x86_64:
|
||||
distros: [RHEL-8.10.0-Nightly]
|
||||
# enable EPEL
|
||||
tf_extra_params:
|
||||
environments:
|
||||
- kickstart:
|
||||
post-install: |
|
||||
%post --log=/dev/console
|
||||
set -x
|
||||
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
||||
%end
|
||||
|
||||
- &propose_downstream
|
||||
job: propose_downstream
|
||||
trigger: release
|
||||
packages: [specfile]
|
||||
dist_git_branches:
|
||||
rawhide:
|
||||
fast_forward_merge_into:
|
||||
- fedora-branched
|
||||
- eln
|
||||
epel-9: {}
|
||||
epel-10:
|
||||
fast_forward_merge_into:
|
||||
- epel-10-branched
|
||||
- <<: *propose_downstream
|
||||
packages: [specfile-epel8]
|
||||
dist_git_branches:
|
||||
- epel-8
|
||||
- <<: *propose_downstream
|
||||
packages: [specfile-centos-integration-sig]
|
||||
dist_git_branches:
|
||||
- c9-sig-integration
|
||||
|
||||
- &pull_from_upstream
|
||||
job: pull_from_upstream
|
||||
trigger: release
|
||||
packages: [specfile]
|
||||
dist_git_branches:
|
||||
rawhide:
|
||||
fast_forward_merge_into:
|
||||
- fedora-branched
|
||||
- eln
|
||||
epel-9: {}
|
||||
epel-10:
|
||||
fast_forward_merge_into:
|
||||
- epel-10-branched
|
||||
- <<: *pull_from_upstream
|
||||
packages: [specfile-epel8]
|
||||
dist_git_branches:
|
||||
- epel-8
|
||||
- <<: *pull_from_upstream
|
||||
packages: [specfile-centos-integration-sig]
|
||||
dist_git_branches:
|
||||
- c9-sig-integration
|
||||
|
||||
- &koji_build
|
||||
job: koji_build
|
||||
trigger: commit
|
||||
packages: [specfile]
|
||||
packit_instances: ["stg"]
|
||||
allowed_pr_authors: ["packit-stg", "packit"]
|
||||
dist_git_branches:
|
||||
- epel-9
|
||||
- <<: *koji_build
|
||||
packages: [specfile-epel8]
|
||||
dist_git_branches:
|
||||
- epel-8
|
||||
- <<: *koji_build
|
||||
packages: [specfile-centos-integration-sig]
|
||||
dist_git_branches:
|
||||
- c9-sig-integration
|
||||
- <<: *koji_build
|
||||
sidetag_group: packit-specfile-ogr-releases
|
||||
dependents:
|
||||
- packit
|
||||
dist_git_branches:
|
||||
- fedora-all
|
||||
- epel-10-all
|
||||
|
||||
- &bodhi_update
|
||||
job: bodhi_update
|
||||
trigger: commit
|
||||
packages: [specfile]
|
||||
packit_instances: ["stg"]
|
||||
allowed_builders: ["packit-stg", "packit"]
|
||||
dist_git_branches:
|
||||
- epel-9
|
||||
- <<: *bodhi_update
|
||||
packages: [specfile-epel8]
|
||||
dist_git_branches:
|
||||
- epel-8
|
||||
3
README.packit
Normal file
3
README.packit
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
This repository is maintained by packit.
|
||||
https://packit.dev/
|
||||
The file was generated using packit 1.16.1.post1.dev2+gf84fe2d5b.
|
||||
10
plans/full.fmf
Normal file
10
plans/full.fmf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
summary:
|
||||
Unit & integration tests
|
||||
discover+:
|
||||
filter: tier:1
|
||||
adjust:
|
||||
- when: "distro == rhel-8"
|
||||
because: "only platform-python is installed on RHEL 8 by default"
|
||||
prepare+:
|
||||
- how: install
|
||||
package: python3
|
||||
32
plans/git_reference.py
Normal file
32
plans/git_reference.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
# Copyright Contributors to the Packit project.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
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
6
plans/main.fmf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
discover:
|
||||
how: fmf
|
||||
url: https://github.com/packit/specfile.git
|
||||
ref: cc8619e5f5dc66028d95752d317d768e6e0ce64b
|
||||
execute:
|
||||
how: tmt
|
||||
29
plans/packit-integration.fmf
Normal file
29
plans/packit-integration.fmf
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
discover:
|
||||
how: fmf
|
||||
url: https://github.com/packit/packit
|
||||
filter: tag:full
|
||||
ref: f84fe2d5b3b33bf3d659411e67b754453f1a2635
|
||||
prepare:
|
||||
- how: install
|
||||
copr: packit/packit-dev
|
||||
- how: shell
|
||||
script: sed -i -n '/^priority=/!p;$apriority=5'
|
||||
/etc/yum.repos.d/*:packit:packit-dev.repo
|
||||
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: 'build 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 build 'deepdiff < 8.0.0'
|
||||
- when: |
|
||||
distro == rhel-8 or distro == centos-8 or distro == centos-stream-8 or distro == rhel-9 or distro == centos-9 or distro == centos-stream-9
|
||||
because: packit doesn't support EL 8
|
||||
enabled: false
|
||||
15
plans/performance.fmf
Normal file
15
plans/performance.fmf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
summary:
|
||||
Performance tests
|
||||
discover+:
|
||||
filter: tier:3
|
||||
prepare:
|
||||
- how: install
|
||||
package: python3-pip
|
||||
- how: shell
|
||||
script: pip3 install pytest-fail-slow
|
||||
- how: shell
|
||||
script: curl --output-dir /tmp -O https://src.fedoraproject.org/rpms/texlive/raw/rawhide/f/texlive.spec
|
||||
adjust:
|
||||
- when: "initiator != packit"
|
||||
because: "skip this plan on dist-git pull requests"
|
||||
enabled: false
|
||||
10
plans/smoke.fmf
Normal file
10
plans/smoke.fmf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
summary:
|
||||
Basic smoke test
|
||||
discover+:
|
||||
filter: tier:0
|
||||
adjust:
|
||||
- when: "distro == rhel-8"
|
||||
because: "only platform-python is installed on RHEL 8 by default"
|
||||
prepare+:
|
||||
- how: install
|
||||
package: python3
|
||||
131
python-specfile.spec
Normal file
131
python-specfile.spec
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
%bcond_without tests
|
||||
|
||||
|
||||
%global desc %{expand:
|
||||
Python library for parsing and manipulating RPM spec files.
|
||||
Main focus is on modifying existing spec files, any change should result
|
||||
in a minimal diff.}
|
||||
|
||||
|
||||
%global base_version 0.41.1
|
||||
#global prerelease rc1
|
||||
|
||||
%global package_version %{base_version}%{?prerelease:~%{prerelease}}
|
||||
%global pypi_version %{base_version}%{?prerelease}
|
||||
|
||||
|
||||
Name: python-specfile
|
||||
Version: %{package_version}
|
||||
Release: 1%{?dist}
|
||||
|
||||
Summary: A library for parsing and manipulating RPM spec files
|
||||
License: MIT
|
||||
URL: https://github.com/packit/specfile
|
||||
|
||||
Source0: %{pypi_source specfile %{pypi_version}}
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
%if %{with tests}
|
||||
# tests/unit/test_guess_packager.py
|
||||
BuildRequires: git-core
|
||||
%endif
|
||||
|
||||
# system-rpm-config pulls in packages containing SRPM macros
|
||||
# necessary for spec file preprocessing and parsing
|
||||
Recommends: system-rpm-config
|
||||
|
||||
|
||||
%description
|
||||
%{desc}
|
||||
|
||||
|
||||
%package -n python%{python3_pkgversion}-specfile
|
||||
Summary: %{summary}
|
||||
|
||||
|
||||
%description -n python%{python3_pkgversion}-specfile
|
||||
%{desc}
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n specfile-%{pypi_version}
|
||||
|
||||
# since we are building from PyPI source, we don't need git-archive
|
||||
# support in setuptools_scm
|
||||
sed -i 's/setuptools_scm\[toml\]>=7/setuptools_scm[toml]/' pyproject.toml
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires %{?with_tests: -x testing}
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files specfile
|
||||
|
||||
|
||||
%if %{with tests}
|
||||
%check
|
||||
%pytest --verbose tests/unit tests/integration
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python%{python3_pkgversion}-specfile -f %{pyproject_files}
|
||||
%doc README.md
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 20 2026 Packit <hello@packit.dev> - 0.41.1-1
|
||||
- Sanitize multi-pipe shell expansion. (#542)
|
||||
|
||||
* Fri May 29 2026 Packit <hello@packit.dev> - 0.41.0-1
|
||||
- Fixed an issue where the value of a tag could have been incorrectly expanded if the spec file contained a macro definition shadowing the tag name, e.g.:
|
||||
```
|
||||
%%global release 12
|
||||
%%global release_string %%{release}%%{?dist}
|
||||
Release: %%{release_string}
|
||||
```
|
||||
In this case, with `dist` being `.fc44`, `Specfile.expanded_release` returned `12.fc44.fc44` instead of `12.fc44`. (#539)
|
||||
|
||||
* Fri Apr 24 2026 Packit <hello@packit.dev> - 0.40.2-1
|
||||
- Trailing whitespaces at the end of specfile sections are now ignored during parsing. (#531)
|
||||
- Resolves: rhbz#2461109
|
||||
|
||||
* Wed Mar 25 2026 Packit <hello@packit.dev> - 0.40.1-1
|
||||
- Fixed issues related to introduced sanitization (#523, #524, #525).
|
||||
- Resolves: rhbz#2446536
|
||||
|
||||
* Wed Mar 11 2026 Packit <hello@packit.dev> - 0.40.0-1
|
||||
- `Specfile()` has a new `sanitize` option that enables best effort sanitization of potentially dangerous constructs such as shell expansions and unsafe Lua macros before they are passed to RPM for parsing. (#519)
|
||||
- Fixed incorrect parsing of nested macros. (#522)
|
||||
|
||||
* Sat Feb 14 2026 Packit <hello@packit.dev> - 0.39.1-1
|
||||
- Fixed whitespace padding of day of month in changelog entries. (#511)
|
||||
- Resolves: rhbz#2393435
|
||||
|
||||
* Thu Jan 8 2026 Packit <hello@packit.dev> - 0.38.0-1
|
||||
- A bug leading to incorrect EVR expansion has been fixed. (#492)
|
||||
- Prevented side-effects during condition evaluation that could occur when expanding macros that manipulate other macros, leading to misinterpreted validity of condition branches. (#499)
|
||||
|
||||
* Fri Oct 3 2025 Packit <hello@packit.dev> - 0.37.1-1
|
||||
- We have solved a FutureWarning in our codebase. (#485)
|
||||
|
||||
* Fri Sep 5 2025 Packit <hello@packit.dev> - 0.37.0-1
|
||||
- Added support for Elbrus E2K CPU architectures. (#484)
|
||||
|
||||
* Fri May 30 2025 Packit <hello@packit.dev> - 0.36.0-1
|
||||
- We have fixed a bug that caused specfile to traceback when section names with conditional macro expansions containing spaces were present in the spec file. (#476)
|
||||
|
||||
* Sun Apr 13 2025 Packit <hello@packit.dev> - 0.35.0-1
|
||||
- Added support for creating Specfile instances from file objects and strings. (#458)
|
||||
- The `context_management` type stubs now use `ParamSpec` from `typing_extensions` to support Python < 3.10. (#466)
|
||||
|
||||
* Thu Mar 20 2025 Packit <hello@packit.dev> - 0.34.2-1
|
||||
- context_management: add a type stub override to fix typing. Type checkers like mypy and pyright can now correctly determine the types for `.sources()`, `.sections()`, and the other `Specfile` methods that return context managers. (#457)
|
||||
- Resolves: rhbz#2344364
|
||||
1
sources
Normal file
1
sources
Normal file
|
|
@ -0,0 +1 @@
|
|||
SHA512 (specfile-0.41.1.tar.gz) = 28c42ed09be94c0f60cd88153f0052a00d260e1d6bb3de2810a17a2fbd2afb8af0b6d41d1a4aac8c84cb394627395be9e6d9ff13183ec14287d173e946dba068
|
||||
Loading…
Add table
Add a link
Reference in a new issue