14
0
Files
python-zope.interface/python-zope.interface.spec

75 lines
2.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-zope.interface
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global modname zope.interface
%define oldpython python
Name: python-zope.interface
Version: 5.2.0
Release: 0
Summary: Interfaces for Python
License: ZPL-2.1
URL: https://pypi.python.org/pypi/zope.interface
Source: https://files.pythonhosted.org/packages/source/z/zope.interface/%{modname}-%{version}.tar.gz
- Update to 5.1.0: * Make @implementer(*iface) and classImplements(cls, *iface) ignore redundant interfaces. If the class already implements an interface through inheritance, it is no longer redeclared specifically for cls. This solves many instances of inconsistent resolution orders, while still allowing the interface to be declared for readability and maintenance purposes. See issue 199. * Remove all bare except: statements. Previously, when accessing special attributes such as __provides__, __providedBy__, __class__ and __conform__, this package wrapped such access in a bare except: statement, meaning that many errors could pass silently; typically this would result in a fallback path being taken and sometimes (like with providedBy()) the result would be non-sensical. This is especially true when those attributes are implemented with descriptors. Now, only AttributeError is caught. This makes errors more obvious. * In addition, ZODB errors like POSKeyError could now be propagated where previously they would ignored by this package. * Require that the second argument (bases) to InterfaceClass is a tuple. This only matters when directly using InterfaceClass to create new interfaces dynamically. Previously, an individual interface was allowed, but did not work correctly. Now it is consistent with type and requires a tuple. * Let interfaces define custom __adapt__ methods. This implements the other side of the PEP 246 adaptation protocol: objects being adapted could already implement __conform__ if they know about the interface, and now interfaces can implement __adapt__ if they know about particular objects. There is no performance penalty for interfaces that do not supply custom __adapt__ methods. * Make the internal singleton object returned by APIs like implementedBy and directlyProvidedBy for objects that implement or provide no interfaces more immutable. Previously an internal cache could be mutated. See issue 204. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.interface?expand=0&rev=42
2020-04-14 09:16:42 +00:00
# needed for tests that try to compile things
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module zope.event}
BuildRequires: %{python_module zope.testing}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
- Update to 5.1.0: * Make @implementer(*iface) and classImplements(cls, *iface) ignore redundant interfaces. If the class already implements an interface through inheritance, it is no longer redeclared specifically for cls. This solves many instances of inconsistent resolution orders, while still allowing the interface to be declared for readability and maintenance purposes. See issue 199. * Remove all bare except: statements. Previously, when accessing special attributes such as __provides__, __providedBy__, __class__ and __conform__, this package wrapped such access in a bare except: statement, meaning that many errors could pass silently; typically this would result in a fallback path being taken and sometimes (like with providedBy()) the result would be non-sensical. This is especially true when those attributes are implemented with descriptors. Now, only AttributeError is caught. This makes errors more obvious. * In addition, ZODB errors like POSKeyError could now be propagated where previously they would ignored by this package. * Require that the second argument (bases) to InterfaceClass is a tuple. This only matters when directly using InterfaceClass to create new interfaces dynamically. Previously, an individual interface was allowed, but did not work correctly. Now it is consistent with type and requires a tuple. * Let interfaces define custom __adapt__ methods. This implements the other side of the PEP 246 adaptation protocol: objects being adapted could already implement __conform__ if they know about the interface, and now interfaces can implement __adapt__ if they know about particular objects. There is no performance penalty for interfaces that do not supply custom __adapt__ methods. * Make the internal singleton object returned by APIs like implementedBy and directlyProvidedBy for objects that implement or provide no interfaces more immutable. Previously an internal cache could be mutated. See issue 204. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.interface?expand=0&rev=42
2020-04-14 09:16:42 +00:00
Requires: python-setuptools
%ifpython2
Provides: %{oldpython}-zopeinterface = %{version}
Obsoletes: %{oldpython}-zopeinterface < %{version}
Provides: %{oldpython}-zope-interface = %{version}
Obsoletes: %{oldpython}-zope-interface < %{version}
%endif
%python_subpackages
%description
This package is intended to be independently reusable in any Python
project. It is maintained by the Zope Toolkit project.
This package provides an implementation of object interfaces for Python.
Interfaces are a mechanism for labeling objects as conforming to a given
API or contract. So, this package can be considered as implementation of
the Design By Contract methodology support in Python.
%prep
%setup -q -n %{modname}-%{version}
%build
%python_build
%install
%python_install
%python_expand rm %{buildroot}%{$python_sitearch}/zope/interface/_zope_interface_coptimizations.c
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
sed -i '/coverage/d' setup.py
%python_exec setup.py test
%files %{python_files}
%license LICENSE.txt COPYRIGHT.txt
%doc CHANGES.rst README.rst
%{python_sitearch}/*
%changelog