From 7d44f61cc0633df521f20150fe878e267640b5b6cf918addf05d1b02e1b10eb4 Mon Sep 17 00:00:00 2001 From: Todd R Date: Mon, 13 Nov 2017 18:44:43 +0000 Subject: [PATCH] Accepting request 541579 from home:TheBlackCat:branches:devel:languages:python - Add namespace package that other jaraco packages can use. - Add namespace package that other jaraco packages can use. - Properly handle namespace package structure. This guarantees the module is importable. OBS-URL: https://build.opensuse.org/request/show/541579 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jaraco.packaging?expand=0&rev=2 --- python-jaraco.base.changes | 5 +++ python-jaraco.base.spec | 62 +++++++++++++++++++++++++++++++++ python-jaraco.packaging.changes | 7 ++++ python-jaraco.packaging.spec | 22 ++++++++++-- 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 python-jaraco.base.changes create mode 100644 python-jaraco.base.spec diff --git a/python-jaraco.base.changes b/python-jaraco.base.changes new file mode 100644 index 0000000..3467116 --- /dev/null +++ b/python-jaraco.base.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Mon Nov 13 17:25:52 UTC 2017 - toddrme2178@gmail.com + +- Add namespace package that other jaraco packages can use. + diff --git a/python-jaraco.base.spec b/python-jaraco.base.spec new file mode 100644 index 0000000..068891a --- /dev/null +++ b/python-jaraco.base.spec @@ -0,0 +1,62 @@ +# +# spec file for package python-jaraco.base +# +# 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-jaraco.base +Version: 4.1 +Release: 0 +Summary: Base namespace for jaraco packages +License: MIT +Group: Development/Languages/Python +Url: https://github.com/jaraco/jaraco.packaging +Source: https://files.pythonhosted.org/packages/source/j/jaraco.packaging/jaraco.packaging-%{version}.tar.gz +BuildRequires: %{python_module base} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +This package provides a base namespace to guarantee +that other jaraco packages can be imported. + +This should not be installed directly, all packages +using the "jaraco" namespace should depend on it. + +%prep +%setup -q -n jaraco.packaging-%{version} +rm -rf jaraco.packaging.egg-info + +%build +# Not needed + +%install +%{python_expand install -D -m 644 jaraco/__init__.py %{buildroot}%{$python_sitelib}/jaraco/__init__.py +$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/jaraco/ +$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/jaraco/ +%fdupes %{buildroot}%{$python_sitelib} +} + +%files %{python_files} +%defattr(-,root,root) +%dir %{python_sitelib}/jaraco/ +%{python_sitelib}/jaraco/__init__.py* +%pycache_only %dir %{python_sitelib}/jaraco/__pycache__/ +%pycache_only %{python_sitelib}/jaraco/__pycache__/__init__*.py* + +%changelog diff --git a/python-jaraco.packaging.changes b/python-jaraco.packaging.changes index 5a4bd98..19b13ee 100644 --- a/python-jaraco.packaging.changes +++ b/python-jaraco.packaging.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Nov 13 17:25:52 UTC 2017 - toddrme2178@gmail.com + +- Add namespace package that other jaraco packages can use. +- Properly handle namespace package structure. + This guarantees the module is importable. + ------------------------------------------------------------------- Wed Jul 5 08:00:46 UTC 2017 - aloisio@gmx.com diff --git a/python-jaraco.packaging.spec b/python-jaraco.packaging.spec index e623ce5..b46dfde 100644 --- a/python-jaraco.packaging.spec +++ b/python-jaraco.packaging.spec @@ -17,6 +17,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%bcond_with test Name: python-jaraco.packaging Version: 4.1 Release: 0 @@ -26,13 +27,17 @@ Group: Development/Languages/Python Url: https://github.com/jaraco/jaraco.packaging Source: https://files.pythonhosted.org/packages/source/j/jaraco.packaging/jaraco.packaging-%{version}.tar.gz BuildRequires: %{python_module base} +BuildRequires: %{python_module jaraco.base} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools_scm} BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{with test} +BuildRequires: %{python_module pytest} +%endif +Requires: python-jaraco.base Requires(post): update-alternatives Requires(preun): update-alternatives -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %python_subpackages @@ -48,7 +53,12 @@ rm -rf jaraco.packaging.egg-info %install %python_install -%python_expand %fdupes -s %{buildroot}%{$python_sitelib} +# We will package the namespace __init__.py separately +%{python_expand rm %{buildroot}%{$python_sitelib}/jaraco/__init__.py* +rm -rf %{buildroot}%{$python_sitelib}/jaraco/__pycache__/ +%fdupes -s %{buildroot}%{$python_sitelib} +} + %python_clone -a %{buildroot}%{_bindir}/dependency-tree %python_clone -a %{buildroot}%{_bindir}/upload-package @@ -59,11 +69,17 @@ rm -rf jaraco.packaging.egg-info %postun %python_uninstall_alternative dependency-tree +%if %{with test} +%check +%python_expand py.test-%{$python_bin_suffix} +%endif + %files %{python_files} %defattr(-,root,root) %doc CHANGES.rst README.rst %python_alternative %{_bindir}/dependency-tree %python_alternative %{_bindir}/upload-package -%{python_sitelib}/* +%{python_sitelib}/jaraco.packaging-%{version}-py*.egg-info +%{python_sitelib}/jaraco/packaging/ %changelog