-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
164 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
# https://packit.dev/docs/configuration/ | ||
# Test locally running: packit build locally | ||
# spell-checker:ignore packit specfile copr epel | ||
specfile_path: dist/python-ansible-compat.spec | ||
actions: | ||
create-archive: | ||
# packit.dev service does have these module pre-installed: | ||
- python3 -m build --sdist --outdir dist | ||
- sh -c "ls dist/ansible-compat-*.tar.gz" | ||
get-current-version: | ||
- ./tools/get-version.sh | ||
post-upstream-clone: | ||
- rm -f dist/*.tar.gz || true | ||
- ./tools/update-version.sh | ||
srpm_build_deps: | ||
- python3-build | ||
- python3-setuptools_scm | ||
- python3-pytest | ||
- python3-pytest-mock | ||
jobs: | ||
# - job: copr_build | ||
# targets: | ||
# - fedora-rawhide-aarch64 # one on PR should be enough | ||
# trigger: pull_request | ||
- job: copr_build | ||
trigger: commit | ||
branch: main | ||
targets: | ||
# See https://packit.dev/docs/configuration/#aliases | ||
# API to get available targets: https://api.dev.testing-farm.io/v0.1/composes/public | ||
- fedora-rawhide-x86_64 | ||
- fedora-rawhide-aarch64 | ||
- fedora-latest-x86_64 | ||
- fedora-latest-aarch64 | ||
# Missing python3-build see https://bugzilla.redhat.com/show_bug.cgi?id=2129071 | ||
# - centos-stream-9-aarch64 | ||
# - centos-stream-9-x86_64 | ||
- job: tests | ||
trigger: pull_request | ||
branch: main | ||
metadata: | ||
targets: | ||
- fedora-latest | ||
- fedora-rawhide | ||
# - job: propose_downstream | ||
# trigger: release | ||
# metadata: | ||
# dist-git-branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SRPMS/ | ||
*.tar.gz | ||
*-buildrequires | ||
ansible-compat-*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
%global numcomm @numcomm@ | ||
%global alphatag @alphatag@ | ||
%global dirty @dirty@ | ||
|
||
%global srcname ansible-compat | ||
%global pkgname python-ansible-compat | ||
|
||
%bcond_without tests | ||
|
||
Name: python-ansible-compat | ||
Version: VERSION_PLACEHOLDER | ||
Release: 1%{?dist} | ||
Summary: Ansible python helper functions | ||
|
||
License: MIT | ||
URL: https://github.com/ansible/ansible-compat | ||
Source0: %{pypi_source} | ||
BuildArch: noarch | ||
|
||
BuildRequires: pyproject-rpm-macros | ||
BuildRequires: ansible-core | ||
|
||
%if %{with tests} | ||
BuildRequires: python3-pytest | ||
BuildRequires: python3-pytest-mock | ||
%endif | ||
|
||
%global common_description %{expand: | ||
A python package containing functions that help interacting with | ||
various versions of Ansible} | ||
|
||
%description %{common_description} | ||
|
||
%package -n python-%{srcname}-doc | ||
Summary: %summary | ||
|
||
%description -n python-%{srcname}-doc | ||
Documentation for python-ansible-compat | ||
|
||
%package -n python3-%{srcname} | ||
Summary: %summary | ||
|
||
|
||
%description -n python3-%{srcname} %{common_description} | ||
|
||
%prep | ||
%autosetup | ||
|
||
%generate_buildrequires | ||
%pyproject_buildrequires | ||
|
||
%build | ||
%pyproject_wheel | ||
|
||
%if %{with doc} | ||
PYTHONPATH=src sphinx-build-3 docs html | ||
rm -rf html/.{doctrees,buildinfo} | ||
%endif | ||
|
||
%install | ||
%pyproject_install | ||
%pyproject_save_files ansible_compat | ||
|
||
%if %{with tests} | ||
%check | ||
%pytest -vv test -k \ | ||
%{shrink: | ||
' | ||
not test_prepare_environment_with_collections | ||
and not test_prerun_reqs_v1 | ||
and not test_prerun_reqs_v2 | ||
and not test_install_collection_from_disk | ||
and not test_require_collection | ||
' | ||
} | ||
%endif | ||
|
||
%files -n python3-%{srcname} -f %{pyproject_files} | ||
%license LICENSE | ||
|
||
%if %{with doc} | ||
%files -n python-%{srcname}-doc | ||
%license LICENSE | ||
%doc *.rst | ||
%doc html/ | ||
%endif | ||
|
||
%changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -e | ||
{ | ||
python3 -c "import setuptools_scm" || python3 -m pip install --user setuptools-scm | ||
} 1>&2 # redirect stdout to stderr to avoid polluting the output | ||
python3 -m setuptools_scm | \ | ||
sed 's/Guessed Version\([^+]\+\).*/\1/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
DIR=$(dirname "$0") | ||
VERSION=$(./tools/get-version.sh) | ||
mkdir -p "${DIR}/../dist" | ||
sed -e "s/VERSION_PLACEHOLDER/${VERSION}/" \ | ||
"${DIR}/../dist/python-ansible-compat.spec.in" \ | ||
> "${DIR}/../dist/python-ansible-compat.spec" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters