Skip to content

Commit

Permalink
Switch to packit
Browse files Browse the repository at this point in the history
- Run `copr_build` jobs for:
  - Pull requests CI -> `scikit-build-core`
  - Commits on `main` branch -> `nightly`
  - Releases -> `release`
- Run `propose_downstream` to create automatic PR at src.fedoraproject.org
- `koji_build` and `bodhi_update` are only run on src.fedoraproject.org

Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Mar 31, 2023
1 parent c8b0d8e commit b6a16ef
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 28 deletions.
1 change: 1 addition & 0 deletions .distro/python-scikit-build-core.rpmlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addFilter("files-duplicate .*/__init__.py")
32 changes: 13 additions & 19 deletions scikit-build-core.spec → .distro/scikit-build-core.spec
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
%global pypi_name scikit_build_core

Name: python-scikit-build-core
Version: 0.2.2
Version: 0.0.0
Release: %{autorelease}
Summary: Build backend for CMake based projects

License: Apache-2.0
URL: https://github.com/scikit-build/scikit-build-core
Source0: https://github.com/scikit-build/scikit-build-core/archive/refs/tags/v%{version}.tar.gz
Source0: %{pypi_source %{pypi_name}}
Source1: %{name}.rpmlintrc

BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: cmake
BuildRequires: ninja-build
BuildRequires: gcc
BuildRequires: gcc-c++
Requires: cmake
Recommends: (ninja-build or make)
Recommends: python3dist(pyproject-metadata)
Recommends: python3dist(pathspec)
Suggests: ninja-build
Suggests: gcc

%global _description %{expand:
A next generation Python CMake adaptor and Python API for plugins}
Expand All @@ -27,19 +24,16 @@ A next generation Python CMake adaptor and Python API for plugins}

%package -n python3-scikit-build-core
Summary: %{summary}
Requires: cmake
Recommends: (ninja-build or make)
Recommends: python3dist(pyproject-metadata)
Recommends: python3dist(pathspec)
Suggests: ninja-build
Suggests: gcc
%description -n python3-scikit-build-core %_description

%prep
# This assumes the source is not retrieved from tar ball, but built in place
# This makes it possible to build with `tito build --test`
# Change to `%%autosetup -n %%{pypi_name}-%%{version}` for release
# TODO: There should be a format to satisfy both
%setup -q
# TODO: Remove when tito upstream issue is fixed
# https://github.com/rpm-software-management/tito/issues/444
if grep -q "describe-name: \$Format" .git_archival.txt; then
sed -i "s/describe-name:.*/describe-name: v%{version}/g" .git_archival.txt
fi
%autosetup -n %{pypi_name}-%{version}

%generate_buildrequires
%pyproject_buildrequires -x test
Expand All @@ -50,7 +44,7 @@ fi

%install
%pyproject_install
%pyproject_save_files scikit_build_core
%pyproject_save_files %{pypi_name}


%check
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,6 @@ tests/**/build/
*~

# RPM spec file
!/scikit-build-core.spec
!/.distro/scikit-build-core.spec
/.distro/*.tar.gz
*.rpm
57 changes: 57 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/

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

files_to_sync:
- src: .distro/scikit-build-core.spec
dest: python-scikit-build-core.spec
- .packit.yaml
- src: .distro/python-scikit-build-core.rpmlintrc
dest: python-scikit-build-core.rpmlintrc
upstream_package_name: scikit_build_core
downstream_package_name: python-scikit-build-core
update_release: false
upstream_tag_template: v{version}

jobs:
- job: copr_build
trigger: pull_request
owner: "@scikit-build"
project: scikit-build-core
update_release: true
release_suffix: "{PACKIT_RPMSPEC_RELEASE}"
targets:
- fedora-development
- job: copr_build
trigger: commit
branch: main
owner: "@scikit-build"
project: nightly
targets:
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- job: copr_build
trigger: release
owner: "@scikit-build"
project: release
targets:
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- job: propose_downstream
trigger: release
dist_git_branches:
- fedora-development
- fedora-latest
- job: koji_build
trigger: commit
dist_git_branches:
- fedora-all
- job: bodhi_update
trigger: commit
dist_git_branches:
- fedora-branched
3 changes: 0 additions & 3 deletions .tito/packages/.readme

This file was deleted.

5 changes: 0 additions & 5 deletions .tito/tito.props

This file was deleted.

0 comments on commit b6a16ef

Please sign in to comment.