14
0

Accepting request 872813 from home:robert_munteanu:branches:devel:languages:python

Fix build for multiple python flavors

OBS-URL: https://build.opensuse.org/request/show/872813
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pre-commit?expand=0&rev=12
This commit is contained in:
2021-02-16 13:34:57 +00:00
committed by Git OBS Bridge
parent cc733579a7
commit f353981562
2 changed files with 25 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Feb 16 11:29:34 UTC 2021 - Robert Munteanu <rombert@apache.org>
- Fix build for multiple python flavors
-------------------------------------------------------------------
Sat Aug 29 05:38:23 UTC 2020 - Arun Persaud <arun@gmx.de

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pre-commit
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -35,6 +35,8 @@ Requires: python-identify >= 1.0.0
Requires: python-nodeenv >= 0.11.1
Requires: python-toml
Requires: python-virtualenv >= 20.0.8
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module PyYAML >= 5.1}
@@ -46,8 +48,8 @@ BuildRequires: %{python_module pytest-env}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module toml}
BuildRequires: %{python_module virtualenv >= 20.0.8}
BuildRequires: %{pythons}
BuildRequires: git-core
BuildRequires: python3
# /SECTION
%python_subpackages
@@ -64,6 +66,9 @@ sed -i 's|^#!%{_bindir}/env python|#!%{_bindir}/python|' pre_commit/resources/ho
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/pre-commit
%python_clone -a %{buildroot}%{_bindir}/pre-commit-validate-manifest
%python_clone -a %{buildroot}%{_bindir}/pre-commit-validate-config
%check
export GIT_AUTHOR_NAME=test GIT_COMMITTER_NAME=test \
@@ -87,10 +92,20 @@ EXCLUDED_TESTS="$EXCLUDED_TESTS or conda or test_perl_hook or test_local_perl_ad
git init .
%pytest -k "not ($EXCLUDED_TESTS)"
%post
%python_install_alternative pre-commit
%python_install_alternative pre-commit-validate-config
%python_install_alternative pre-commit-validate-manifest
%postun
%python_uninstall_alternative pre-commit
%python_uninstall_alternative pre-commit-validate-config
%python_uninstall_alternative pre-commit-validate-manifest
%files %{python_files}
%{_bindir}/pre-commit-validate-manifest
%{_bindir}/pre-commit
%{_bindir}/pre-commit-validate-config
%python_alternative %{_bindir}/pre-commit-validate-manifest
%python_alternative %{_bindir}/pre-commit
%python_alternative %{_bindir}/pre-commit-validate-config
%{python_sitelib}/pre_commit
%{python_sitelib}/pre_commit-%{version}-py*.egg-info