Skip to content

Commit

Permalink
Configure packit (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Nov 27, 2022
1 parent 50ddd62 commit 70ea1ad
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .config/subprocess-tee.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# spell-checker:ignore bcond pkgversion buildrequires autosetup PYTHONPATH noarch buildroot bindir sitelib numprocesses clib
%bcond_with check
%bcond_with privileged_tests
#global source_date_epoch_from_changelog 0
#global clamp_mtime_to_source_date_epoch 1

Name: subprocess-tee
Version: VERSION_PLACEHOLDER
Release: 1%{?dist}
Summary: subprocess-tee

License: MIT
URL: https://github.com/pycontribs/subprocess-tee
Source0: %{pypi_source}

BuildArch: noarch

BuildRequires: pyproject-rpm-macros
BuildRequires: python%{python3_pkgversion}-build
BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-setuptools_scm
BuildRequires: python%{python3_pkgversion}-wheel
BuildRequires: python%{python3_pkgversion}-devel
%if %{with check}
# These are required for tests:
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pytest-xdist
BuildRequires: git-core
%endif


%description
subprocess-tee


%prep
%autosetup


%build
%pyproject_wheel


%generate_buildrequires
%pyproject_buildrequires


%install
%pyproject_install
%pyproject_save_files subprocess_tee

%check
%if %{with check}
pytest \
-v \
--disable-pytest-warnings \
--numprocesses=auto \
test
%endif


%files -f %{pyproject_files}
%license LICENSE
%doc README.md

%changelog
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@ dmypy.json

# Pyre type checker
.pyre/
*.rpm
37 changes: 37 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# spell-checker:ignore packit specfile copr epel
# https://packit.dev/docs/configuration/
# TODO(ssbarnea): Is there a way to template the package name in order to make
# it easier to sync this config between projects?
specfile_path: dist/subprocess-tee.spec
actions:
create-archive:
- python3 -m build --sdist --outdir dist
- sh -c "ls dist/subprocess-tee-*.tar.gz"
get-current-version:
- python3 -m setuptools_scm --strip-dev
post-upstream-clone:
- bash -c "rm -f *.src.rpm && rm -rf dist/*.*"
- mkdir -p dist
- bash -c 'sed -e "s/VERSION_PLACEHOLDER/$(python3 -m setuptools_scm --strip-dev)/" .config/subprocess-tee.spec > dist/subprocess-tee.spec'
srpm_build_deps:
- python3-build
- python3-setuptools_scm
jobs:
- job: copr_build
targets:
# See https://packit.dev/docs/configuration/#aliases
# API to get available targets: https://api.dev.testing-farm.io/v0.1/composes/public
# Fedora 37 is the first version having a setuptools(-scm) that supports our PEP-621 metadata
- fedora-37
- fedora-rawhide
trigger: pull_request
# - job: tests
# trigger: pull_request
# metadata:
# targets:
# - fedora-all
# - job: propose_downstream
# trigger: release
# metadata:
# dist-git-branch: master

0 comments on commit 70ea1ad

Please sign in to comment.