-
Notifications
You must be signed in to change notification settings - Fork 28
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
6 changed files
with
82 additions
and
10 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# spell-checker:ignore bcond pkgversion buildrequires autosetup PYTHONPATH noarch buildroot bindir sitelib numprocesses clib | ||
# All tests require Internet access | ||
# to test in mock use: --enable-network --with check | ||
# to test in a privileged environment use: | ||
# --with check --with privileged_tests | ||
%bcond_with check | ||
%bcond_with privileged_tests | ||
|
||
Name: ansible-compat | ||
Version: VERSION_PLACEHOLDER | ||
Release: 1%{?dist} | ||
Summary: Ansible-compat library | ||
|
||
License: GPL-3.0-or-later | ||
URL: https://github.com/ansible/ansible-compat | ||
Source0: %{pypi_source} | ||
|
||
BuildArch: noarch | ||
|
||
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: python%{python3_pkgversion}-libselinux | ||
BuildRequires: git-core | ||
%endif | ||
Requires: git-core | ||
|
||
|
||
%description | ||
Ansible-compat. | ||
|
||
%prep | ||
%autosetup | ||
|
||
|
||
%generate_buildrequires | ||
%pyproject_buildrequires | ||
|
||
|
||
%build | ||
%pyproject_wheel | ||
|
||
|
||
%install | ||
%pyproject_install | ||
%pyproject_save_files ansible_compat | ||
|
||
|
||
%check | ||
%pyproject_check_import | ||
%if %{with check} | ||
%pytest \ | ||
-v \ | ||
--disable-pytest-warnings \ | ||
--numprocesses=auto \ | ||
test | ||
%endif | ||
|
||
|
||
%files -f %{pyproject_files} | ||
%license LICENSE | ||
%doc docs/ README.md | ||
|
||
%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
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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
{ | ||
python3 -c "import setuptools_scm" || python3 -m pip install --user setuptools-scm | ||
python3 -c "import setuptools_scm" >/dev/null || { | ||
if [[ "$VIRTUAL_ENV" != "" ]]; then | ||
PIPARGS="" | ||
else | ||
PIPARGS="--user" | ||
fi | ||
python3 -m pip install $PIPARGS 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
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