Skip to content

Commit

Permalink
Add packit packaging (#56)
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT authored Nov 2, 2023
1 parent 8118a76 commit 01f02fb
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 0 deletions.
1 change: 1 addition & 0 deletions .distro/.fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
3 changes: 3 additions & 0 deletions .distro/packit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Filters = [
"unknown-key",
]
3 changes: 3 additions & 0 deletions .distro/plans/main.fmf.dist-git
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
discover:
how: fmf
dist-git-source: true
14 changes: 14 additions & 0 deletions .distro/plans/rpmlint.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
summary:
Perform rpmlint and rpminspect tests
prepare:
- name: Install rpmlint packages
how: install
package:
- rpmlint
- rpminspect
- rpminspect-data-fedora
discover+:
how: fmf
filter: "tag: rpmlint"
execute:
how: tmt
7 changes: 7 additions & 0 deletions .distro/plans/smoke.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
summary:
Basic smoke tests
discover+:
how: fmf
filter: "tag: smoke"
execute:
how: tmt
Empty file.
50 changes: 50 additions & 0 deletions .distro/python-click-option-group.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Name: python-click-option-group
Version: 0.0.0
Release: %autorelease
Summary: Option groups missing in Click

License: BSD-3-Clause
URL: https://github.com/click-contrib/click-option-group
Source: %{pypi_source click-option-group}

BuildArch: noarch
BuildRequires: python3-devel

%global _description %{expand:
click-option-group is a Click-extension package that adds option groups missing
in Click.}

%description %_description

%package -n python3-click-option-group
Summary: %{summary}
%description -n python3-click-option-group %_description


%prep
%autosetup -n click-option-group-%{version}


%generate_buildrequires
%pyproject_buildrequires -x test


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files click-option-group


%check
%pytest


%files -n python3-click-option-group -f %{pyproject_files}
%doc README.md


%changelog
%autochangelog
13 changes: 13 additions & 0 deletions .distro/tests/rpmlint.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Common test variables
tag:
- rpmlint
tier: 0
path: /

# Define tests
/rpmlint:
summary: Rpmlint spec and rpmfiles
test: rpmlint -c packit.toml -r python-click-option-group.rpmlintrc ./*.spec /var/share/test-artifacts/*.rpm
/rpminspect-rpms:
summary: Rpminspect the rpms
test: ls /var/share/test-artifacts/*.rpm | xargs -L1 rpminspect-fedora -E metadata,disttag
9 changes: 9 additions & 0 deletions .distro/tests/smoke.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Common test variables
tag:
- smoke
tier: 0
path: /

# Define tests
/version:
test: python3 -c "import click_option_group; print(click_option_group.__version__)"
75 changes: 75 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
specfile_path: .distro/python-click-option-group.spec

files_to_sync:
- src: .distro/python-click-option-group.spec
dest: python-click-option-group.spec
- .packit.yaml
- src: .distro/python-click-option-group.rpmlintrc
dest: python-click-option-group.rpmlintrc
# tmt setup
- src: .fmf/
dest: .fmf/
- src: .distro/plans/
dest: plans/
filters:
- "- main.fmf.dist-git"
- "- rpmlint.fmf"
- src: .distro/plans/main.fmf.dist-git
dest: plans/main.fmf
upstream_package_name: click-option-group
downstream_package_name: python-click-option-group
update_release: false
upstream_tag_template: v{version}

jobs:
- job: copr_build
trigger: pull_request
owner: lecris
project: click-option-group
update_release: true
release_suffix: "{PACKIT_RPMSPEC_RELEASE}"
targets:
- fedora-all
- epel-9
- job: tests
trigger: pull_request
targets:
- fedora-all
- epel-9
- job: copr_build
trigger: commit
branch: main
owner: lecris
project: nightly
targets:
- fedora-all
- epel-9
- job: tests
trigger: commit
branch: main
targets:
- fedora-all
- epel-9
- job: copr_build
trigger: release
owner: lecris
project: release
targets:
- fedora-all
- epel-9
- job: propose_downstream
trigger: release
dist_git_branches:
# TODO: Switch to fedora-development and fedora-latest
# There is an issue that the commits diverge on different PRs. In the meantime will create PRs on branched fedora
# manually
# https://github.com/packit/packit/issues/1724
- fedora-rawhide
- job: koji_build
trigger: commit
dist_git_branches:
- fedora-all
- job: bodhi_update
trigger: commit
dist_git_branches:
- fedora-branched

0 comments on commit 01f02fb

Please sign in to comment.