Accepting request 460703 from devel:languages:python
- update for singlespec - use hardlinks instead of symlinks for %fdupes, because symlinks would point across subpackages OBS-URL: https://build.opensuse.org/request/show/460703 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pbr?expand=0&rev=27
This commit is contained in:
commit
713f3428b1
96
0001-Don-t-ignore-data-files.patch
Normal file
96
0001-Don-t-ignore-data-files.patch
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
From a432bc2930ad0c5463163654bc18a18f8e2b417e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sachi King <nakato@nakato.io>
|
||||||
|
Date: Thu, 21 Jul 2016 17:15:34 +1000
|
||||||
|
Subject: [PATCH] Don't ignore data-files
|
||||||
|
|
||||||
|
We're currently ignoring data-files, and it looks like the problem
|
||||||
|
would sometimes be present starting with 2796f9, 0.5.7, and always be present
|
||||||
|
from 04984a, 0.5.15.
|
||||||
|
|
||||||
|
This normalises all config keys from - to _ as soon as we read the
|
||||||
|
config, which means future access and modification does not need to
|
||||||
|
concern itself with the possibility of the key being a '-' instead '_'.
|
||||||
|
|
||||||
|
This should make it more difficult for code accessing/modifying values
|
||||||
|
in the config to clobber user set values or be unaware of them, like
|
||||||
|
in the case of the files hook.
|
||||||
|
|
||||||
|
As well, support download-url, but properly expose it as download_url.
|
||||||
|
|
||||||
|
Co-Authored-By: Julien Danjou <julien@danjou.info>
|
||||||
|
Change-Id: I062774c706b8f7339dda46689a226b80ae6ac277
|
||||||
|
---
|
||||||
|
pbr/tests/test_packaging.py | 11 +++++++++++
|
||||||
|
pbr/tests/testpackage/setup.cfg | 2 +-
|
||||||
|
pbr/util.py | 6 +++---
|
||||||
|
3 files changed, 15 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py
|
||||||
|
index f532b76..b84cc9a 100644
|
||||||
|
--- a/pbr/tests/test_packaging.py
|
||||||
|
+++ b/pbr/tests/test_packaging.py
|
||||||
|
@@ -304,6 +304,17 @@ class TestPackagingInGitRepoWithCommit(base.BaseTestCase):
|
||||||
|
self.expectThat(stdout, matchers.Contains('Generating ChangeLog'))
|
||||||
|
|
||||||
|
|
||||||
|
+class TestExtrafileInstallation(base.BaseTestCase):
|
||||||
|
+ def test_install_glob(self):
|
||||||
|
+ stdout, _, _ = self.run_setup(
|
||||||
|
+ 'install', '--root', self.temp_dir + 'installed',
|
||||||
|
+ allow_fail=False)
|
||||||
|
+ self.expectThat(
|
||||||
|
+ stdout, matchers.Contains('copying data_files/a.txt'))
|
||||||
|
+ self.expectThat(
|
||||||
|
+ stdout, matchers.Contains('copying data_files/b.txt'))
|
||||||
|
+
|
||||||
|
+
|
||||||
|
class TestPackagingInGitRepoWithoutCommit(base.BaseTestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
diff --git a/pbr/tests/testpackage/setup.cfg b/pbr/tests/testpackage/setup.cfg
|
||||||
|
index c4ba378..a6d127a 100644
|
||||||
|
--- a/pbr/tests/testpackage/setup.cfg
|
||||||
|
+++ b/pbr/tests/testpackage/setup.cfg
|
||||||
|
@@ -30,7 +30,7 @@ keywords = packaging, distutils, setuptools
|
||||||
|
[files]
|
||||||
|
packages = pbr_testpackage
|
||||||
|
package-data = testpackage = package_data/*.txt
|
||||||
|
-data-files = testpackage/data_files = data_files/*.txt
|
||||||
|
+data-files = testpackage/data_files = data_files/*
|
||||||
|
extra-files = extra-file.txt
|
||||||
|
|
||||||
|
[entry_points]
|
||||||
|
diff --git a/pbr/util.py b/pbr/util.py
|
||||||
|
index daad138..30853c6 100644
|
||||||
|
--- a/pbr/util.py
|
||||||
|
+++ b/pbr/util.py
|
||||||
|
@@ -105,7 +105,7 @@ D1_D2_SETUP_ARGS = {
|
||||||
|
"description": ("metadata", "summary"),
|
||||||
|
"keywords": ("metadata",),
|
||||||
|
"long_description": ("metadata", "description"),
|
||||||
|
- "download-url": ("metadata",),
|
||||||
|
+ "download_url": ("metadata",),
|
||||||
|
"classifiers": ("metadata", "classifier"),
|
||||||
|
"platforms": ("metadata", "platform"), # **
|
||||||
|
"license": ("metadata",),
|
||||||
|
@@ -212,6 +212,8 @@ def cfg_to_args(path='setup.cfg', script_args=()):
|
||||||
|
config = {}
|
||||||
|
for section in parser.sections():
|
||||||
|
config[section] = dict(parser.items(section))
|
||||||
|
+ for k in config[section]:
|
||||||
|
+ config[section][k.replace('-', '_')] = config[section].pop(k)
|
||||||
|
|
||||||
|
# Run setup_hooks, if configured
|
||||||
|
setup_hooks = has_get_option(config, 'global', 'setup_hooks')
|
||||||
|
@@ -649,8 +651,6 @@ def run_command_hooks(cmd_obj, hook_kind):
|
||||||
|
def has_get_option(config, section, option):
|
||||||
|
if section in config and option in config[section]:
|
||||||
|
return config[section][option]
|
||||||
|
- elif section in config and option.replace('_', '-') in config[section]:
|
||||||
|
- return config[section][option.replace('_', '-')]
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
--
|
||||||
|
2.11.0
|
||||||
|
|
50
0001-Don-t-raise-exception-on-missing-man-pages.patch
Normal file
50
0001-Don-t-raise-exception-on-missing-man-pages.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
From 9fd7aa2cc7fe50f68bd9c86c3db7a8f7ae710c05 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dirk Mueller <dirk@dmllr.de>
|
||||||
|
Date: Wed, 21 Dec 2016 23:29:52 +0100
|
||||||
|
Subject: [PATCH] Don't raise exception on missing man pages
|
||||||
|
|
||||||
|
The revert in Ia6cfbfe5b10a5b714fbb9f21ca61380aaf231638 actually
|
||||||
|
broke Sphinx 1.3.x support again. Try to fix it for real this
|
||||||
|
time by avoiding an exception on missing man_pages.
|
||||||
|
|
||||||
|
NOTE(dmllr): don't change dict while iterating over it, hopefully
|
||||||
|
this fixes the gating failure with python 3.5.x
|
||||||
|
|
||||||
|
Change-Id: I52d45fa0a0d42de690d3a492068f7bb03483a224
|
||||||
|
Related-Bug: 1379998
|
||||||
|
---
|
||||||
|
pbr/builddoc.py | 3 ++-
|
||||||
|
pbr/util.py | 6 +++---
|
||||||
|
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
Index: pbr-1.10.0/pbr/builddoc.py
|
||||||
|
===================================================================
|
||||||
|
--- pbr-1.10.0.orig/pbr/builddoc.py
|
||||||
|
+++ pbr-1.10.0/pbr/builddoc.py
|
||||||
|
@@ -138,7 +138,8 @@ class LocalBuildDoc(setup_command.BuildD
|
||||||
|
sphinx_config.init_values(warnings.warn)
|
||||||
|
else:
|
||||||
|
sphinx_config.init_values()
|
||||||
|
- if self.builder == 'man' and len(sphinx_config.man_pages) == 0:
|
||||||
|
+ if self.builder == 'man' and len(
|
||||||
|
+ getattr(sphinx_config, 'man_pages', '')) == 0:
|
||||||
|
return
|
||||||
|
app = application.Sphinx(
|
||||||
|
self.source_dir, self.config_dir,
|
||||||
|
Index: pbr-1.10.0/pbr/util.py
|
||||||
|
===================================================================
|
||||||
|
--- pbr-1.10.0.orig/pbr/util.py
|
||||||
|
+++ pbr-1.10.0/pbr/util.py
|
||||||
|
@@ -211,9 +211,9 @@ def cfg_to_args(path='setup.cfg', script
|
||||||
|
parser.read(path)
|
||||||
|
config = {}
|
||||||
|
for section in parser.sections():
|
||||||
|
- config[section] = dict(parser.items(section))
|
||||||
|
- for k in config[section]:
|
||||||
|
- config[section][k.replace('-', '_')] = config[section].pop(k)
|
||||||
|
+ config[section] = dict()
|
||||||
|
+ for k, value in parser.items(section):
|
||||||
|
+ config[section][k.replace('-', '_')] = value
|
||||||
|
|
||||||
|
# Run setup_hooks, if configured
|
||||||
|
setup_hooks = has_get_option(config, 'global', 'setup_hooks')
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 23 15:22:44 UTC 2017 - jmatejek@suse.com
|
||||||
|
|
||||||
|
- change to build only with python3 Sphinx
|
||||||
|
- provide $flavor-doc for all pythons
|
||||||
|
- include patches so that build doesn't fail
|
||||||
|
on manpages
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 24 05:15:23 UTC 2016 - tbechtold@suse.com
|
Tue May 24 05:15:23 UTC 2016 - tbechtold@suse.com
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pbr-doc
|
# spec file for package python-pbr-doc
|
||||||
#
|
#
|
||||||
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -16,6 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
Name: python-pbr-doc
|
Name: python-pbr-doc
|
||||||
Version: 1.10.0
|
Version: 1.10.0
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -25,27 +26,29 @@ Group: Development/Languages/Python
|
|||||||
Url: http://pypi.python.org/pypi/pbr
|
Url: http://pypi.python.org/pypi/pbr
|
||||||
Source: https://pypi.python.org/packages/c3/2c/63275fab26a0fd8cadafca71a3623e4d0f0ee8ed7124a5bb128853d178a7/pbr-%{version}.tar.gz
|
Source: https://pypi.python.org/packages/c3/2c/63275fab26a0fd8cadafca71a3623e4d0f0ee8ed7124a5bb128853d178a7/pbr-%{version}.tar.gz
|
||||||
Source1: python-pbr-rpmlintrc
|
Source1: python-pbr-rpmlintrc
|
||||||
|
Patch0: 0001-Don-t-ignore-data-files.patch
|
||||||
|
Patch1: 0001-Don-t-raise-exception-on-missing-man-pages.patch
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-devel
|
|
||||||
# Documentation requirements:
|
# Documentation requirements:
|
||||||
BuildRequires: python-Sphinx >= 1.1.2
|
BuildRequires: python3-Sphinx >= 1.1.2
|
||||||
|
BuildRequires: python3-setuptools
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
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
|
BuildArch: noarch
|
||||||
%endif
|
Provides: %{python_module pbr-doc = %{version}}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains documentation files for python-pbr
|
This package contains documentation files for python-pbr
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pbr-%{version}
|
%setup -q -n pbr-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
%patch1 -p1
|
||||||
# Get rid of ugly build-time deps that require network:
|
# Get rid of ugly build-time deps that require network:
|
||||||
sed -i "s/, 'sphinx\.ext\.intersphinx'//" doc/source/conf.py
|
sed -i "s/, 'sphinx\.ext\.intersphinx'//" doc/source/conf.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
python setup.py build_sphinx && rm doc/build/html/.buildinfo
|
python3 setup.py build_sphinx
|
||||||
|
rm doc/build/html/.buildinfo
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p %{buildroot}%{_docdir}/python-pbr
|
mkdir -p %{buildroot}%{_docdir}/python-pbr
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 27 13:11:37 UTC 2017 - jmatejek@suse.com
|
||||||
|
|
||||||
|
- use hardlinks instead of symlinks for %fdupes, because
|
||||||
|
symlinks would point across subpackages
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 21 14:11:09 UTC 2017 - jmatejek@suse.com
|
||||||
|
|
||||||
|
- update for singlespec
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 20 22:03:16 UTC 2017 - dmueller@suse.com
|
||||||
|
|
||||||
|
- add 0001-Don-t-raise-exception-on-missing-man-pages.patch,
|
||||||
|
0001-Don-t-ignore-data-files.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 27 18:32:25 UTC 2016 - tbechtold@suse.com
|
Tue Sep 27 18:32:25 UTC 2016 - tbechtold@suse.com
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pbr
|
# spec file for package python-pbr
|
||||||
#
|
#
|
||||||
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -20,6 +20,7 @@
|
|||||||
# enable testing with a build conditional (off by default):
|
# enable testing with a build conditional (off by default):
|
||||||
%bcond_with test
|
%bcond_with test
|
||||||
|
|
||||||
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
Name: python-pbr
|
Name: python-pbr
|
||||||
Version: 1.10.0
|
Version: 1.10.0
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -29,34 +30,32 @@ Group: Development/Languages/Python
|
|||||||
Url: http://pypi.python.org/pypi/pbr
|
Url: http://pypi.python.org/pypi/pbr
|
||||||
Source: https://pypi.python.org/packages/c3/2c/63275fab26a0fd8cadafca71a3623e4d0f0ee8ed7124a5bb128853d178a7/pbr-%{version}.tar.gz
|
Source: https://pypi.python.org/packages/c3/2c/63275fab26a0fd8cadafca71a3623e4d0f0ee8ed7124a5bb128853d178a7/pbr-%{version}.tar.gz
|
||||||
Source1: python-pbr-rpmlintrc
|
Source1: python-pbr-rpmlintrc
|
||||||
|
Patch0: 0001-Don-t-ignore-data-files.patch
|
||||||
|
Patch1: 0001-Don-t-raise-exception-on-missing-man-pages.patch
|
||||||
|
BuildRequires: %{python_module devel}
|
||||||
|
BuildRequires: %{python_module pip >= 1.4}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-devel
|
BuildRequires: python-rpm-macros
|
||||||
BuildRequires: python-pip >= 1.4
|
|
||||||
# Test requirements:
|
# Test requirements:
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
#BuildRequires: python-coverage >= 3.6
|
#BuildRequires: python-coverage >= 3.6
|
||||||
%if 0%{?suse_version} <= 1110
|
BuildRequires: %{python_module fixtures >= 1.3.1}
|
||||||
BuildRequires: python-discover
|
BuildRequires: %{python_module hacking >= 0.9.2}
|
||||||
%endif
|
BuildRequires: %{python_module mock >= 1.2}
|
||||||
BuildRequires: python-fixtures >= 1.3.1
|
BuildRequires: %{python_module python-subunit >= 0.0.18}
|
||||||
BuildRequires: python-hacking >= 0.9.2
|
BuildRequires: %{python_module six >= 1.9.0}
|
||||||
BuildRequires: python-mock >= 1.2
|
BuildRequires: %{python_module testrepository >= 0.0.18}
|
||||||
BuildRequires: python-python-subunit >= 0.0.18
|
BuildRequires: %{python_module testresources >= 0.2.4}
|
||||||
BuildRequires: python-six >= 1.9.0
|
BuildRequires: %{python_module testscenarios >= 0.4}
|
||||||
BuildRequires: python-testrepository >= 0.0.18
|
BuildRequires: %{python_module testtools >= 1.4.0}
|
||||||
BuildRequires: python-testresources >= 0.2.4
|
|
||||||
BuildRequires: python-testscenarios >= 0.4
|
|
||||||
BuildRequires: python-testtools >= 1.4.0
|
|
||||||
%endif
|
%endif
|
||||||
Requires: python-setuptools
|
Requires: python-setuptools
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(postun): update-alternatives
|
Requires(postun): update-alternatives
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
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
|
BuildArch: noarch
|
||||||
%endif
|
|
||||||
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
PBR is a library to automatically do a bunch of standard
|
PBR is a library to automatically do a bunch of standard
|
||||||
@ -65,44 +64,41 @@ them every time. It will set versions, process requirements
|
|||||||
files and generate AUTHORS and ChangeLog file all from git
|
files and generate AUTHORS and ChangeLog file all from git
|
||||||
information.
|
information.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pbr-%{version}
|
%setup -q -n pbr-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
%patch1 -p1
|
||||||
# Get rid of ugly build-time deps that require network:
|
# Get rid of ugly build-time deps that require network:
|
||||||
sed -i "s/, 'sphinx\.ext\.intersphinx'//" doc/source/conf.py
|
sed -i "s/, 'sphinx\.ext\.intersphinx'//" doc/source/conf.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
python setup.py build
|
%python_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
%{python_expand %$python_install
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
mv %{buildroot}%{_bindir}/pbr %{buildroot}%{_bindir}/pbr-%{$python_bin_suffix}
|
||||||
mv %{buildroot}%{_bindir}/pbr %{buildroot}%{_bindir}/pbr-%{py_ver}
|
}
|
||||||
ln -s -f %{_sysconfdir}/alternatives/pbr %{buildroot}%{_bindir}/pbr
|
%prepare_alternative pbr
|
||||||
# create a dummy target for /etc/alternatives/pbr
|
%fdupes %{buildroot}%{_prefix}
|
||||||
touch %{buildroot}%{_sysconfdir}/alternatives/pbr
|
|
||||||
%fdupes -s %{buildroot}%{python_sitelib}
|
|
||||||
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
%check
|
%check
|
||||||
testr init && testr run --parallel
|
%python_exec %{_bindir}/testr init
|
||||||
|
%python_exec %{_bindir}/testr run --parallel
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%_sbindir/update-alternatives \
|
%python_install_alternative pbr
|
||||||
--install %{_bindir}/pbr pbr %{_bindir}/pbr-%{py_ver} 20
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ $1 -eq 0 ] ; then
|
%python_uninstall_alternative pbr
|
||||||
%_sbindir/update-alternatives --remove pbr %{_bindir}/pbr-%{py_ver}
|
|
||||||
fi
|
|
||||||
|
|
||||||
%files
|
%files %{python_files}
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc AUTHORS ChangeLog CONTRIBUTING.rst LICENSE README.rst
|
%doc AUTHORS ChangeLog CONTRIBUTING.rst LICENSE README.rst
|
||||||
|
%python_alternative %{_bindir}/pbr
|
||||||
%{python_sitelib}/pbr
|
%{python_sitelib}/pbr
|
||||||
%{python_sitelib}/pbr-%{version}-py%{py_ver}.egg-info
|
%{python_sitelib}/pbr-%{version}-py%{python_version}.egg-info
|
||||||
%{_bindir}/pbr-%{py_ver}
|
|
||||||
%{_bindir}/pbr
|
|
||||||
%ghost %{_sysconfdir}/alternatives/pbr
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user