From a3229ec511d14e2b14f6ec6d7edc1cebbb5568dbc21d9f06e6dca6305295e357 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Thu, 2 Mar 2017 14:38:21 +0000 Subject: [PATCH] osc copypac from project:devel:languages:python:singlespec package:python-setuptools_scm revision:2, using expand OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools_scm?expand=0&rev=12 --- python-setuptools_scm.spec | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/python-setuptools_scm.spec b/python-setuptools_scm.spec index c6a2f2f..33185d9 100644 --- a/python-setuptools_scm.spec +++ b/python-setuptools_scm.spec @@ -15,7 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-setuptools_scm Version: 1.15.0 Release: 0 @@ -23,22 +23,21 @@ Summary: Manage your versions by scm tags License: MIT Group: Development/Languages/Python Url: https://github.com/pypa/setuptools_scm -Source: https://pypi.io/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python-setuptools +Source: https://file.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} # Testing requirements BuildRequires: git BuildRequires: mercurial -BuildRequires: python-pytest -Requires: python-setuptools +BuildRequires: %{python_module pytest} +Requires: %{python_module setuptools} Recommends: git Recommends: mecurial BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else BuildArch: noarch -%endif + +%python_subpackages %description The setuptools_scm package handles managing your python package versions @@ -48,15 +47,15 @@ in scm metadata. It also handles file finders for the supperted scm's. %setup -q -n setuptools_scm-%{version} %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install %check -PYTHONPATH=%{buildroot}%{python_sitelib} py.test +%python_expand PYTHONPATH=%{buildroot}%{python_sitelib} py.test-%{python_version} -%files +%files %python_files %defattr(-,root,root,-) %doc README.rst LICENSE CHANGELOG.rst %{python_sitelib}/*