From 05d0d790171a0255673f0f35e6edecc776f37e82304622ee2f1e654a6b59a29e Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Thu, 23 Feb 2017 13:18:40 +0000 Subject: [PATCH] - update for single-spec - drop setuptools dependency, as this is itself now a dependency of setuptools - run tests conditionally, to minimize dependency tree - ensure egg-info is a directory (distutils would install it as file) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=14 --- python-packaging.changes | 9 ++++++++ python-packaging.spec | 45 ++++++++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/python-packaging.changes b/python-packaging.changes index 6afc3e3..44cbd4a 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Feb 23 11:45:52 UTC 2017 - jmatejek@suse.com + +- update for single-spec +- drop setuptools dependency, as this is itself now a dependency + of setuptools +- run tests conditionally, to minimize dependency tree +- ensure egg-info is a directory (distutils would install it as file) + ------------------------------------------------------------------- Fri Dec 2 17:55:31 UTC 2016 - tbechtold@suse.com diff --git a/python-packaging.spec b/python-packaging.spec index c10ff60..32df18a 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -1,7 +1,7 @@ # # spec file for package python-packaging # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,9 @@ # +%bcond_with test + +%{?!python_module:%define python_module() python-%{1} python3-%{1}} Name: python-packaging Version: 16.8 Release: 0 @@ -24,20 +27,23 @@ License: Apache-2.0 Group: Development/Languages/Python Url: https://github.com/pypa/packaging Source: https://pypi.io/packages/source/p/packaging/packaging-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python-pretend -BuildRequires: python-pyparsing -BuildRequires: python-pytest -BuildRequires: python-setuptools -BuildRequires: python-six +BuildRequires: %{python_module base} +BuildRequires: %{python_module pyparsing} +BuildRequires: %{python_module six} +BuildRequires: python-rpm-macros +# do not add setuptools dependency, this is now a dependency +# of setuptools. Ensure that all dependencies also don't depend +# on setuptools +# (at the moment, six and pyparsing are ok) +%if %{with test} +BuildRequires: %{python_module pretend} +BuildRequires: %{python_module pytest} +%endif Requires: python-pyparsing Requires: python-six 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 Core utilities for Python packages @@ -46,17 +52,24 @@ Core utilities for Python packages %setup -q -n packaging-%{version} %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +# ensure egg-info is a directory +%{python_expand rm %{buildroot}%{$python_sitelib}/*.egg-info +cp -r packaging.egg-info %{buildroot}%{$python_sitelib}/packaging-%{version}-py%{$python_version}.egg-info +} +%if %{with test} %check -py.test +%python_exec %{_bindir}/py.test +%endif -%files +%files %{python_files} %defattr(-,root,root,-) %doc CHANGELOG.rst LICENSE README.rst -%{python_sitelib}/* +%{python_sitelib}/packaging +%{python_sitelib}/packaging-%{version}-py*.egg-info/ %changelog