From aaf0360417ccc3d3ee89c826734047192dc39c21625f9026ca789506ba706d8e Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 4 Dec 2019 07:06:40 +0000 Subject: [PATCH] Fix sed call OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pre-commit?expand=0&rev=2 --- python-pre-commit.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python-pre-commit.spec b/python-pre-commit.spec index 4361622..adf9798 100644 --- a/python-pre-commit.spec +++ b/python-pre-commit.spec @@ -1,7 +1,7 @@ # # spec file for package python-pre-commit # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # + %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pre-commit @@ -43,7 +44,6 @@ Requires: python-importlib_resources %endif BuildArch: noarch # SECTION test requirements -BuildRequires: python3 BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module aspy.yaml} BuildRequires: %{python_module cfgv >= 1.4.0} @@ -58,6 +58,7 @@ BuildRequires: %{python_module virtualenv >= 15.2} BuildRequires: git-core BuildRequires: python2-futures BuildRequires: python2-importlib_resources +BuildRequires: python3 # /SECTION %python_subpackages @@ -67,7 +68,7 @@ A framework for managing and maintaining multi-language pre-commit hooks. %prep %setup -q -n pre-commit-%{version} rm pre_commit/color_windows.py -sed -i 's|^#!/usr/bin/env python|#!/usr/bin/python3|' pre_commit/resources/hook-tmpl +sed -i 's|^#!/usr/bin/env python|#!%{_bindir}/python|' pre_commit/resources/hook-tmpl %build %python_build