Skip to content

Commit

Permalink
chore: add rpm lint and smoke-test (scikit-build#938)
Browse files Browse the repository at this point in the history
* Refactor spec file according to downstream suggestions

https://src.fedoraproject.org/rpms/python-scikit-build/pull-request/2
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>

* Prepare for tmt

- tmt cannot navigate hidden folders- added main.fmf files so that users can edit tmt environments to their local setup
  (Can remove this when system/user config is supported)
- include tmt setup downstream

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>

* Enable packit testing

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>

* Add rpmlint jobs

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>

* Add simple smoke test

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>

* Resolve rpmlint issues

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>

---------

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT authored May 17, 2023
1 parent 2ba690d commit 4ce6b2a
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 8 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",
]
4 changes: 4 additions & 0 deletions .distro/plans/main.fmf.dist-git
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
discover:
how: fmf
dist-git-source: true
path: .distro
20 changes: 20 additions & 0 deletions .distro/plans/rpmlint.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
summary:
Perform rpmlint and rpminspect tests
prepare:
- name: Install rpmlint packages
how: install
package:
- rpmlint
- rpminspect
- rpminspect-data-fedora
- name: Download the source rpm
how: shell
script: cd /tmp && curl -O ${PACKIT_SRPM_URL}
- name: Download rpm packages
how: shell
script: cd /tmp && dnf download ${PACKIT_COPR_RPMS}
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
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
%global pypi_name scikit_build

Name: python-scikit-build
Version: 0.0.0
Release: %{autorelease}
Release: %autorelease
Summary: Improved build system generator for Python C/C++/Fortran/Cython extensions

# This project is mainly MIT but LICENSE also mentions some code
# that is BSD-2-Clause-Views licensed.
# All bundled(cmake()) files listed are Apache-2.0 licensed.
License: MIT AND BSD-2-Clause-Views AND Apache-2.0
URL: https://github.com/scikit-build/scikit-build
Source0: %{pypi_source %{pypi_name}}
Source1: %{name}.rpmlintrc
Source: %{pypi_source scikit_build}

BuildArch: noarch
BuildRequires: python3-devel
Expand Down Expand Up @@ -55,7 +52,7 @@ Provides: bundled(cmake(UsePythonExtensions))


%prep
%autosetup -n %{pypi_name}-%{version}
%autosetup -n scikit_build-%{version}


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

# Define tests
/rpmlint-spec:
summary: Rpmlint the spec files
test: rpmlint ./python-scikit-build.spec
/rpmlint-rpms:
summary: Rpmlint the rpms
test: rpmlint -c packit.toml /tmp/*.rpm
/rpminspect-rpms:
summary: Rpminspect the rpms
test: ls /tmp/*.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 skbuild; print(skbuild.__version__)"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ skbuild/_cmake_test_compile/*
skbuild/_version.py

/*env*/

# Fedora packaging
/.distro/main.fmf
/.distro/plans/main.fmf
/.distro/tests/main.fmf
26 changes: 24 additions & 2 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/

specfile_path: .distro/scikit-build.spec
specfile_path: .distro/python-scikit-build.spec

files_to_sync:
- src: .distro/scikit-build.spec
- src: .distro/python-scikit-build.spec
dest: python-scikit-build.spec
- .packit.yaml
- src: .distro/python-scikit-build.rpmlintrc
dest: python-scikit-build.rpmlintrc
# tmt setup
- src: .distro/.fmf/
dest: .fmf/
- src: .distro/plans/
dest: plans/
filters:
- "- .distro/plans/main.fmf.dist-git"
- "- .distro/plans/rpmlint.fmf"
- src: .distro/plans/main.fmf.dist-git
dest: plans/main.fmf
upstream_package_name: scikit-build
downstream_package_name: python-scikit-build
update_release: false
Expand All @@ -22,6 +32,11 @@ jobs:
release_suffix: "{PACKIT_RPMSPEC_RELEASE}"
targets:
- fedora-development
- job: tests
trigger: pull_request
targets:
- fedora-development
fmf_path: .distro
- job: copr_build
trigger: commit
branch: main
Expand All @@ -32,6 +47,13 @@ jobs:
- fedora-latest-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- job: tests
trigger: commit
branch: main
targets:
- fedora-development
- fedora-latest
fmf_path: .distro
- job: copr_build
trigger: release
owner: "@scikit-build"
Expand Down

0 comments on commit 4ce6b2a

Please sign in to comment.