Accepting request 1243428 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1243428 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-zope.location?expand=0&rev=8
This commit is contained in:
commit
a72efdfc80
@ -1,121 +0,0 @@
|
|||||||
From bbe277f55cd69de23cdd32d277cc30e837ef70b3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michael Howitz <icemac@gmx.net>
|
|
||||||
Date: Thu, 30 Jan 2025 09:14:32 +0100
|
|
||||||
Subject: [PATCH] Add tests for minimal dependencies.
|
|
||||||
|
|
||||||
Add `copy` extra to include the `zope.copy` dependency.
|
|
||||||
|
|
||||||
Fixes #5.
|
|
||||||
---
|
|
||||||
.meta.toml | 16 +++++++++++++++-
|
|
||||||
CHANGES.rst | 3 +++
|
|
||||||
setup.py | 17 ++++++++++++++---
|
|
||||||
src/zope/location/testing.py | 10 ++++++++++
|
|
||||||
src/zope/location/tests/test_configure.py | 12 +++++++++++-
|
|
||||||
src/zope/location/tests/test_pickling.py | 3 +++
|
|
||||||
tox.ini | 10 ++++++++++
|
|
||||||
7 files changed, 66 insertions(+), 5 deletions(-)
|
|
||||||
create mode 100644 src/zope/location/testing.py
|
|
||||||
|
|
||||||
diff --git a/setup.py b/setup.py
|
|
||||||
index c12779a..f5b72bd 100644
|
|
||||||
--- a/setup.py
|
|
||||||
+++ b/setup.py
|
|
||||||
@@ -37,8 +37,11 @@ def read(*rnames):
|
|
||||||
'zope.component >= 4.0.1',
|
|
||||||
]
|
|
||||||
|
|
||||||
-TESTS_REQUIRE = ZCML_REQUIRES + COMPONENT_REQUIRES + [
|
|
||||||
+COPY_REQUIRES = [
|
|
||||||
'zope.copy >= 4.0',
|
|
||||||
+]
|
|
||||||
+
|
|
||||||
+TESTS_REQUIRE = [
|
|
||||||
'zope.testrunner',
|
|
||||||
]
|
|
||||||
|
|
||||||
@@ -57,7 +60,7 @@ def read(*rnames):
|
|
||||||
+ '\n\n' +
|
|
||||||
read('CHANGES.rst')
|
|
||||||
),
|
|
||||||
- license='ZPL 2.1',
|
|
||||||
+ license='ZPL-2.1',
|
|
||||||
keywords=('zope location structural'),
|
|
||||||
classifiers=[
|
|
||||||
'Development Status :: 5 - Production/Stable',
|
|
||||||
@@ -93,7 +96,15 @@ def read(*rnames):
|
|
||||||
extras_require={
|
|
||||||
'zcml': ZCML_REQUIRES,
|
|
||||||
'component': COMPONENT_REQUIRES,
|
|
||||||
- 'test': TESTS_REQUIRE,
|
|
||||||
+ 'copy': COPY_REQUIRES,
|
|
||||||
+ 'test-minimal': TESTS_REQUIRE,
|
|
||||||
+ 'test-component': TESTS_REQUIRE + COMPONENT_REQUIRES + ZCML_REQUIRES,
|
|
||||||
+ 'test': (
|
|
||||||
+ TESTS_REQUIRE
|
|
||||||
+ + ZCML_REQUIRES
|
|
||||||
+ + COMPONENT_REQUIRES
|
|
||||||
+ + COPY_REQUIRES
|
|
||||||
+ ),
|
|
||||||
'docs': DOCS_REQUIRE,
|
|
||||||
},
|
|
||||||
include_package_data=True,
|
|
||||||
diff --git a/src/zope/location/testing.py b/src/zope/location/testing.py
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..bf28b3f
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/zope/location/testing.py
|
|
||||||
@@ -0,0 +1,10 @@
|
|
||||||
+import importlib
|
|
||||||
+import unittest
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def skipUnlessImportable(module: str):
|
|
||||||
+ try:
|
|
||||||
+ importlib.import_module(module)
|
|
||||||
+ except ModuleNotFoundError: # pragma: no cover
|
|
||||||
+ return unittest.skip(f"{module!r} not importable")
|
|
||||||
+ return lambda func: func
|
|
||||||
diff --git a/src/zope/location/tests/test_configure.py b/src/zope/location/tests/test_configure.py
|
|
||||||
index 332faa5..5f1bf4f 100644
|
|
||||||
--- a/src/zope/location/tests/test_configure.py
|
|
||||||
+++ b/src/zope/location/tests/test_configure.py
|
|
||||||
@@ -15,12 +15,22 @@
|
|
||||||
"""
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
+from zope.location.testing import skipUnlessImportable
|
|
||||||
|
|
||||||
+
|
|
||||||
+@skipUnlessImportable('zope.component')
|
|
||||||
class Test_ZCML_loads(unittest.TestCase):
|
|
||||||
|
|
||||||
def test_it(self):
|
|
||||||
import zope.component # no registrations made if not present
|
|
||||||
- ADAPTERS_REGISTERED = 4
|
|
||||||
+
|
|
||||||
+ try:
|
|
||||||
+ import zope.copy
|
|
||||||
+ ADAPTERS_REGISTERED = 4
|
|
||||||
+ except ModuleNotFoundError: # pragma: no cover
|
|
||||||
+ ADAPTERS_REGISTERED = 3
|
|
||||||
+ else:
|
|
||||||
+ del zope.copy
|
|
||||||
from zope.configuration.xmlconfig import XMLConfig
|
|
||||||
from zope.configuration.xmlconfig import _clearContext
|
|
||||||
from zope.configuration.xmlconfig import _getContext
|
|
||||||
diff --git a/src/zope/location/tests/test_pickling.py b/src/zope/location/tests/test_pickling.py
|
|
||||||
index ddcc274..4c19709 100644
|
|
||||||
--- a/src/zope/location/tests/test_pickling.py
|
|
||||||
+++ b/src/zope/location/tests/test_pickling.py
|
|
||||||
@@ -13,7 +13,10 @@
|
|
||||||
##############################################################################
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
+from zope.location.testing import skipUnlessImportable
|
|
||||||
|
|
||||||
+
|
|
||||||
+@skipUnlessImportable('zope.copy')
|
|
||||||
class LocationCopyHookTests(unittest.TestCase):
|
|
||||||
|
|
||||||
def _getTargetClass(self):
|
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 5 13:01:45 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||||
|
|
||||||
|
- Update to 5.1
|
||||||
|
* Add support for Python 3.12, 3.13.
|
||||||
|
* Drop support for Python 3.7, 3.8.
|
||||||
|
* Add tests for minimal dependencies.
|
||||||
|
* Add ``copy`` extra to include the ``zope.copy`` dependency.
|
||||||
|
- Adjust upstream source name in spec file
|
||||||
|
- Drop minimal-dependencies.patch, merged upstream
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jan 30 12:35:12 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
Thu Jan 30 12:35:12 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
@ -27,15 +27,13 @@
|
|||||||
%endif
|
%endif
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-zope.location%{psuffix}
|
Name: python-zope.location%{psuffix}
|
||||||
Version: 5.0
|
Version: 5.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Zope Location
|
Summary: Zope Location
|
||||||
License: ZPL-2.1
|
License: ZPL-2.1
|
||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://www.python.org/pypi/zope.location
|
URL: https://www.python.org/pypi/zope.location
|
||||||
Source: https://files.pythonhosted.org/packages/source/z/zope.location/zope.location-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/z/zope_location/zope_location-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM https://github.com/zopefoundation/zope.location/pull/14 Add tests for minimal dependencies.
|
|
||||||
Patch: minimal-dependencies.patch
|
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: %{python_module zope.schema >= 4.2.2}
|
BuildRequires: %{python_module zope.schema >= 4.2.2}
|
||||||
@ -58,7 +56,7 @@ BuildRequires: %{python_module zope.testrunner}
|
|||||||
In Zope3, location are special objects that has a structural location.
|
In Zope3, location are special objects that has a structural location.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n zope.location-%{version}
|
%autosetup -p1 -n zope_location-%{version}
|
||||||
rm -rf src/zope.location.egg-info
|
rm -rf src/zope.location.egg-info
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
BIN
zope.location-5.0.tar.gz
(Stored with Git LFS)
BIN
zope.location-5.0.tar.gz
(Stored with Git LFS)
Binary file not shown.
3
zope_location-5.1.tar.gz
Normal file
3
zope_location-5.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:e4e01d4ef46253a8e07fd59dcbd7bb0b81819bffe5d0dc2d5843bc201afa4ad9
|
||||||
|
size 30516
|
Loading…
x
Reference in New Issue
Block a user