Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-zope.component for
openSUSE:Factory checked in at 2021-07-16 22:12:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zope.component (Old)
and /work/SRC/openSUSE:Factory/.python-zope.component.new.2632 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-zope.component"
Fri Jul 16 22:12:31 2021 rev:10 rq:905641 version:5.0.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-zope.component/python-zope.component.changes
2020-08-01 12:29:20.694353837 +0200
+++
/work/SRC/openSUSE:Factory/.python-zope.component.new.2632/python-zope.component.changes
2021-07-16 22:12:58.394732233 +0200
@@ -1,0 +2,9 @@
+Sat Jul 10 00:31:03 UTC 2021 - Jason Craig <[email protected]>
+
+- Update to 5.0.1
+ * Add support for Python 3.9.
+ * Many other changes, see CHANGES.rst
+- Update requirements as changed in setup.py.
+- Mark LICENSE.txt, COPYRIGHT.txt with %license.
+
+-------------------------------------------------------------------
Old:
----
zope.component-4.6.2.tar.gz
New:
----
zope.component-5.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-zope.component.spec ++++++
--- /var/tmp/diff_new_pack.5ZqkNp/_old 2021-07-16 22:12:58.894728699 +0200
+++ /var/tmp/diff_new_pack.5ZqkNp/_new 2021-07-16 22:12:58.894728699 +0200
@@ -1,7 +1,7 @@
#
-# spec file for package python-zope.component
+# spec file
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2013 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
@@ -27,7 +27,7 @@
%bcond_with test
%endif
Name: python-zope.component%{psuffix}
-Version: 4.6.2
+Version: 5.0.1
Release: 0
Summary: Zope Component Architecture
@@ -38,11 +38,9 @@
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-zope.deferredimport >= 4.2.1
-Requires: python-zope.deprecation >= 4.3.0
Requires: python-zope.event
Requires: python-zope.hookable >= 4.2.0
-Requires: python-zope.interface >= 4.1.0
+Requires: python-zope.interface >= 5.3.0a1
#test requirements
%if %{with test}
BuildRequires: %{python_module persistent}
@@ -89,7 +87,8 @@
%if !%{with test}
%files %{python_files}
%defattr(-,root,root)
-%doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst
+%license LICENSE.txt COPYRIGHT.txt
+%doc CHANGES.rst README.rst
%{python_sitelib}/*
%endif
++++++ zope.component-4.6.2.tar.gz -> zope.component-5.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/.coveragerc
new/zope.component-5.0.1/.coveragerc
--- old/zope.component-4.6.2/.coveragerc 2020-07-03 17:25:02.000000000
+0200
+++ new/zope.component-5.0.1/.coveragerc 1970-01-01 01:00:00.000000000
+0100
@@ -1,16 +0,0 @@
-[run]
-source = zope.component
-omit =
- # Runs in a subprocess
- src/zope/component/standalonetests.py
- # Not used
- src/zope/component/hookable.py
- src/zope/component/eventtesting.py
-
-[report]
-exclude_lines =
- pragma: no cover
- pragma NO COVER
- if __name__ == '__main__':
- raise NotImplementedError
- self.fail
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/.travis.yml
new/zope.component-5.0.1/.travis.yml
--- old/zope.component-4.6.2/.travis.yml 2020-07-03 17:25:02.000000000
+0200
+++ new/zope.component-5.0.1/.travis.yml 1970-01-01 01:00:00.000000000
+0100
@@ -1,44 +0,0 @@
-language: python
-
-env:
- global:
- ZOPE_INTERFACE_STRICT_IRO: 1
-
-python:
- - 2.7
- - 3.5
- - 3.6
- - 3.7
- - 3.8
- - pypy
- - pypy3
-
-jobs:
- include:
- - name: "Python: 2.7, minimal set of dependencies"
- python: 2.7
- env: MINIMAL=1
-
-install:
- - pip install -U pip setuptools
- - pip install -U coveralls coverage
- - if [[ -n "$MINIMAL" ]]; then pip install -U -e ".[mintests]"; fi
- - if [[ -z "$MINIMAL" ]]; then pip install -U -e ".[test,docs]"; fi
-
-script:
-# Temporary workaround. Pending
-# https://github.com/zopefoundation/zope.security/issues/71
-# avoid zope.testrunner.
- - coverage run -m unittest discover -s src
- - if [[ -z "$MINIMAL" ]]; then sphinx-build -b html -d
docs/_build/doctrees docs docs/_build/html; fi
- - if [[ -z "$MINIMAL" ]]; then coverage run -a -m sphinx -b doctest -d
docs/_build/doctrees docs docs/_build/doctest; fi
-
-after_success:
- - coveralls
-
-notifications:
- email: false
-
-cache: pip
-before_cache:
- - rm -f $HOME/.cache/pip/log/debug.log
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/CHANGES.rst
new/zope.component-5.0.1/CHANGES.rst
--- old/zope.component-4.6.2/CHANGES.rst 2020-07-03 17:25:02.000000000
+0200
+++ new/zope.component-5.0.1/CHANGES.rst 2021-07-09 13:52:59.000000000
+0200
@@ -2,6 +2,62 @@
Changes
=========
+5.0.1 (2021-07-09)
+==================
+
+- Fix unregistering utilities on old persistent adapter registries.
+ Previously this could raise ``TypeError``. See `issue 62
+ <https://github.com/zopefoundation/zope.component/issues/62>`_.
+
+
+5.0.0 (2021-03-19)
+==================
+
+- Remove backwards compatibility imports that were emitting
+ deprecation warnings. This affects certain imports from
+ ``zope.component.interfaces`` (which should be imported from
+ ``zope.interface.interfaces``) as well as certain imports from
+ ``zope.component.registery`` (import from
+ ``zope.interface.registry``), and the entire
+ ``zope.component.hookable`` module. See `issue 59
+ <https://github.com/zopefoundation/zope.component/issues/59>`_.
+
+- Respect permission value for utility factory registrations
+ (`#54 <https://github.com/zopefoundation/zope.component/issues/54>`_)
+
+- Add support for Python 3.9
+
+- Fix the ``<subscriber>`` ZCML directive to allow a missing
+ ``provides=`` attribute when a ``factory=`` is given and the Python
+ object has been decorated with ``@implementer`` and implements a
+ single interface. This has been documented, but hasn't worked
+ before. See `issue 9
+ <https://github.com/zopefoundation/zope.component/issues/9>`_.
+
+- Make ``PersistentAdapterRegistry`` use persistent objects
+ (``PersistentMapping`` and ``PersistentList``) for its internal data
+ structures instead of plain dicts and lists. This helps make it
+ scalable to larger registry sizes.
+
+ This requires zope.interface 5.3.0a1 or later.
+
+ New registries (and their primary users, ``PersistentComponents`` and
+ zope.site's ``LocalSiteManager``) take full advantage of this
+ automatically. For existing persistent registries to take advantage
+ of this, you must call their ``rebuild()`` method and commit the
+ transaction.
+
+ See `issue 51 <https://github.com/zopefoundation/zope.component/issues/51>`_.
+
+- Fix ``zope.interface.interface.provideInterface`` and the various
+ search and query methods to use the current site manager instead of
+ always using the global site manager. (``provideInterface`` is
+ called implicitly when registering components from ZCML.) The search
+ and query methods continue to return interfaces registered in base
+ site managers.
+
+ See `issue 10 <https://github.com/zopefoundation/zope.component/issues/51>`_.
+
4.6.2 (2020-07-03)
==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/MANIFEST.in
new/zope.component-5.0.1/MANIFEST.in
--- old/zope.component-4.6.2/MANIFEST.in 2020-07-03 17:25:02.000000000
+0200
+++ new/zope.component-5.0.1/MANIFEST.in 2021-07-09 13:52:59.000000000
+0200
@@ -1,19 +1,12 @@
include *.rst
include *.txt
-
-recursive-include docs *
-recursive-include src *
-
-global-exclude *.dll
-global-exclude *.pyc
-global-exclude *.pyo
-global-exclude *.so
-global-exclude coverage.xml
-
-include *.py
-include .travis.yml
include buildout.cfg
include tox.ini
-include .coveragerc
-prune docs/_build
+recursive-include docs *.bat
+recursive-include docs *.py
+recursive-include docs *.rst
+recursive-include docs Makefile
+
+recursive-include src *.py
+recursive-include src *.zcml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/PKG-INFO
new/zope.component-5.0.1/PKG-INFO
--- old/zope.component-4.6.2/PKG-INFO 2020-07-03 17:25:03.111320700 +0200
+++ new/zope.component-5.0.1/PKG-INFO 2021-07-09 13:53:00.802832800 +0200
@@ -1,31 +1,38 @@
Metadata-Version: 2.1
Name: zope.component
-Version: 4.6.2
+Version: 5.0.1
Summary: Zope Component Architecture
Home-page: https://github.com/zopefoundation/zope.component
Author: Zope Foundation and Contributors
Author-email: [email protected]
License: ZPL 2.1
-Description: ``zope.component``
- ==================
+Project-URL: Documentation, https://zopecomponent.readthedocs.io/
+Project-URL: Issue Tracker,
https://github.com/zopefoundation/zope.component/issues
+Project-URL: Sources, https://github.com/zopefoundation/zope.component
+Description: ================
+ zope.component
+ ================
+
+ .. image::
https://github.com/zopefoundation/zope.component/actions/workflows/tests.yml/badge.svg
+ :target:
https://github.com/zopefoundation/zope.component/actions/workflows/tests.yml
+ :alt: Unit test status
+
+ .. image::
https://coveralls.io/repos/github/zopefoundation/zope.component/badge.svg?branch=master
+ :target:
https://coveralls.io/github/zopefoundation/zope.component?branch=master
+ :alt: Coverage Status
.. image:: https://img.shields.io/pypi/v/zope.component.svg
- :target: https://pypi.python.org/pypi/zope.component/
- :alt: Latest Version
+ :target: https://pypi.python.org/pypi/zope.component/
+ :alt: Current version on PyPI
- .. image::
https://travis-ci.org/zopefoundation/zope.component.svg?branch=master
- :target: https://travis-ci.org/zopefoundation/zope.component
- :alt: Build Status
+ .. image:: https://img.shields.io/pypi/pyversions/zope.component
+ :target: https://pypi.org/project/zope.component/
+ :alt: Supported Python versions
.. image::
https://readthedocs.org/projects/zopecomponent/badge/?version=latest
:target: http://zopecomponent.readthedocs.org/en/latest/
:alt: Documentation Status
- .. image::
https://coveralls.io/repos/github/zopefoundation/zope.component/badge.svg?branch=master
- :target:
https://coveralls.io/github/zopefoundation/zope.component?branch=master
- :alt: Coverage Status
-
-
.. note::
This package is intended to be independently reusable in any Python
@@ -45,6 +52,62 @@
Changes
=========
+ 5.0.1 (2021-07-09)
+ ==================
+
+ - Fix unregistering utilities on old persistent adapter registries.
+ Previously this could raise ``TypeError``. See `issue 62
+ <https://github.com/zopefoundation/zope.component/issues/62>`_.
+
+
+ 5.0.0 (2021-03-19)
+ ==================
+
+ - Remove backwards compatibility imports that were emitting
+ deprecation warnings. This affects certain imports from
+ ``zope.component.interfaces`` (which should be imported from
+ ``zope.interface.interfaces``) as well as certain imports from
+ ``zope.component.registery`` (import from
+ ``zope.interface.registry``), and the entire
+ ``zope.component.hookable`` module. See `issue 59
+ <https://github.com/zopefoundation/zope.component/issues/59>`_.
+
+ - Respect permission value for utility factory registrations
+ (`#54 <https://github.com/zopefoundation/zope.component/issues/54>`_)
+
+ - Add support for Python 3.9
+
+ - Fix the ``<subscriber>`` ZCML directive to allow a missing
+ ``provides=`` attribute when a ``factory=`` is given and the Python
+ object has been decorated with ``@implementer`` and implements a
+ single interface. This has been documented, but hasn't worked
+ before. See `issue 9
+ <https://github.com/zopefoundation/zope.component/issues/9>`_.
+
+ - Make ``PersistentAdapterRegistry`` use persistent objects
+ (``PersistentMapping`` and ``PersistentList``) for its internal data
+ structures instead of plain dicts and lists. This helps make it
+ scalable to larger registry sizes.
+
+ This requires zope.interface 5.3.0a1 or later.
+
+ New registries (and their primary users, ``PersistentComponents`` and
+ zope.site's ``LocalSiteManager``) take full advantage of this
+ automatically. For existing persistent registries to take advantage
+ of this, you must call their ``rebuild()`` method and commit the
+ transaction.
+
+ See `issue 51
<https://github.com/zopefoundation/zope.component/issues/51>`_.
+
+ - Fix ``zope.interface.interface.provideInterface`` and the various
+ search and query methods to use the current site manager instead of
+ always using the global site manager. (``provideInterface`` is
+ called implicitly when registering components from ZCML.) The search
+ and query methods continue to return interfaces registered in base
+ site managers.
+
+ See `issue 10
<https://github.com/zopefoundation/zope.component/issues/51>`_.
+
4.6.2 (2020-07-03)
==================
@@ -462,10 +525,12 @@
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Framework :: Zope :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
Provides-Extra: hook
Provides-Extra: persistentregistry
Provides-Extra: security
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/README.rst
new/zope.component-5.0.1/README.rst
--- old/zope.component-4.6.2/README.rst 2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/README.rst 2021-07-09 13:52:59.000000000 +0200
@@ -1,23 +1,27 @@
-``zope.component``
-==================
+================
+ zope.component
+================
+
+.. image::
https://github.com/zopefoundation/zope.component/actions/workflows/tests.yml/badge.svg
+ :target:
https://github.com/zopefoundation/zope.component/actions/workflows/tests.yml
+ :alt: Unit test status
+
+.. image::
https://coveralls.io/repos/github/zopefoundation/zope.component/badge.svg?branch=master
+ :target:
https://coveralls.io/github/zopefoundation/zope.component?branch=master
+ :alt: Coverage Status
.. image:: https://img.shields.io/pypi/v/zope.component.svg
- :target: https://pypi.python.org/pypi/zope.component/
- :alt: Latest Version
+ :target: https://pypi.python.org/pypi/zope.component/
+ :alt: Current version on PyPI
-.. image::
https://travis-ci.org/zopefoundation/zope.component.svg?branch=master
- :target: https://travis-ci.org/zopefoundation/zope.component
- :alt: Build Status
+.. image:: https://img.shields.io/pypi/pyversions/zope.component
+ :target: https://pypi.org/project/zope.component/
+ :alt: Supported Python versions
.. image:: https://readthedocs.org/projects/zopecomponent/badge/?version=latest
:target: http://zopecomponent.readthedocs.org/en/latest/
:alt: Documentation Status
-.. image::
https://coveralls.io/repos/github/zopefoundation/zope.component/badge.svg?branch=master
- :target:
https://coveralls.io/github/zopefoundation/zope.component?branch=master
- :alt: Coverage Status
-
-
.. note::
This package is intended to be independently reusable in any Python
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/bootstrap.py
new/zope.component-5.0.1/bootstrap.py
--- old/zope.component-4.6.2/bootstrap.py 2020-07-03 17:25:02.000000000
+0200
+++ new/zope.component-5.0.1/bootstrap.py 1970-01-01 01:00:00.000000000
+0100
@@ -1,210 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Bootstrap a buildout-based project
-
-Simply run this script in a directory containing a buildout.cfg.
-The script accepts buildout command-line options, so you can
-use the -c option to specify an alternate configuration file.
-"""
-
-import os
-import shutil
-import sys
-import tempfile
-
-from optparse import OptionParser
-
-__version__ = '2015-07-01'
-# See zc.buildout's changelog if this version is up to date.
-
-tmpeggs = tempfile.mkdtemp(prefix='bootstrap-')
-
-usage = '''\
-[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
-
-Bootstraps a buildout-based project.
-
-Simply run this script in a directory containing a buildout.cfg, using the
-Python that you want bin/buildout to use.
-
-Note that by using --find-links to point to local resources, you can keep
-this script from going over the network.
-'''
-
-parser = OptionParser(usage=usage)
-parser.add_option("--version",
- action="store_true", default=False,
- help=("Return bootstrap.py version."))
-parser.add_option("-t", "--accept-buildout-test-releases",
- dest='accept_buildout_test_releases',
- action="store_true", default=False,
- help=("Normally, if you do not specify a --version, the "
- "bootstrap script and buildout gets the newest "
- "*final* versions of zc.buildout and its recipes and "
- "extensions for you. If you use this flag, "
- "bootstrap and buildout will get the newest releases "
- "even if they are alphas or betas."))
-parser.add_option("-c", "--config-file",
- help=("Specify the path to the buildout configuration "
- "file to be used."))
-parser.add_option("-f", "--find-links",
- help=("Specify a URL to search for buildout releases"))
-parser.add_option("--allow-site-packages",
- action="store_true", default=False,
- help=("Let bootstrap.py use existing site packages"))
-parser.add_option("--buildout-version",
- help="Use a specific zc.buildout version")
-parser.add_option("--setuptools-version",
- help="Use a specific setuptools version")
-parser.add_option("--setuptools-to-dir",
- help=("Allow for re-use of existing directory of "
- "setuptools versions"))
-
-options, args = parser.parse_args()
-if options.version:
- print("bootstrap.py version %s" % __version__)
- sys.exit(0)
-
-
-######################################################################
-# load/install setuptools
-
-try:
- from urllib.request import urlopen
-except ImportError:
- from urllib2 import urlopen
-
-ez = {}
-if os.path.exists('ez_setup.py'):
- exec(open('ez_setup.py').read(), ez)
-else:
- exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)
-
-if not options.allow_site_packages:
- # ez_setup imports site, which adds site packages
- # this will remove them from the path to ensure that incompatible versions
- # of setuptools are not in the path
- import site
- # inside a virtualenv, there is no 'getsitepackages'.
- # We can't remove these reliably
- if hasattr(site, 'getsitepackages'):
- for sitepackage_path in site.getsitepackages():
- # Strip all site-packages directories from sys.path that
- # are not sys.prefix; this is because on Windows
- # sys.prefix is a site-package directory.
- if sitepackage_path != sys.prefix:
- sys.path[:] = [x for x in sys.path
- if sitepackage_path not in x]
-
-setup_args = dict(to_dir=tmpeggs, download_delay=0)
-
-if options.setuptools_version is not None:
- setup_args['version'] = options.setuptools_version
-if options.setuptools_to_dir is not None:
- setup_args['to_dir'] = options.setuptools_to_dir
-
-ez['use_setuptools'](**setup_args)
-import setuptools
-import pkg_resources
-
-# This does not (always?) update the default working set. We will
-# do it.
-for path in sys.path:
- if path not in pkg_resources.working_set.entries:
- pkg_resources.working_set.add_entry(path)
-
-######################################################################
-# Install buildout
-
-ws = pkg_resources.working_set
-
-setuptools_path = ws.find(
- pkg_resources.Requirement.parse('setuptools')).location
-
-# Fix sys.path here as easy_install.pth added before PYTHONPATH
-cmd = [sys.executable, '-c',
- 'import sys; sys.path[0:0] = [%r]; ' % setuptools_path +
- 'from setuptools.command.easy_install import main; main()',
- '-mZqNxd', tmpeggs]
-
-find_links = os.environ.get(
- 'bootstrap-testing-find-links',
- options.find_links or
- ('http://downloads.buildout.org/'
- if options.accept_buildout_test_releases else None)
- )
-if find_links:
- cmd.extend(['-f', find_links])
-
-requirement = 'zc.buildout'
-version = options.buildout_version
-if version is None and not options.accept_buildout_test_releases:
- # Figure out the most recent final version of zc.buildout.
- import setuptools.package_index
- _final_parts = '*final-', '*final'
-
- def _final_version(parsed_version):
- try:
- return not parsed_version.is_prerelease
- except AttributeError:
- # Older setuptools
- for part in parsed_version:
- if (part[:1] == '*') and (part not in _final_parts):
- return False
- return True
-
- index = setuptools.package_index.PackageIndex(
- search_path=[setuptools_path])
- if find_links:
- index.add_find_links((find_links,))
- req = pkg_resources.Requirement.parse(requirement)
- if index.obtain(req) is not None:
- best = []
- bestv = None
- for dist in index[req.project_name]:
- distv = dist.parsed_version
- if _final_version(distv):
- if bestv is None or distv > bestv:
- best = [dist]
- bestv = distv
- elif distv == bestv:
- best.append(dist)
- if best:
- best.sort()
- version = best[-1].version
-if version:
- requirement = '=='.join((requirement, version))
-cmd.append(requirement)
-
-import subprocess
-if subprocess.call(cmd) != 0:
- raise Exception(
- "Failed to execute command:\n%s" % repr(cmd)[1:-1])
-
-######################################################################
-# Import and run buildout
-
-ws.add_entry(tmpeggs)
-ws.require(requirement)
-import zc.buildout.buildout
-
-if not [a for a in args if '=' not in a]:
- args.append('bootstrap')
-
-# if -c was provided, we push it back into args for buildout' main function
-if options.config_file is not None:
- args[0:0] = ['-c', options.config_file]
-
-zc.buildout.buildout.main(args)
-shutil.rmtree(tmpeggs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/docs/zcml.rst
new/zope.component-5.0.1/docs/zcml.rst
--- old/zope.component-4.6.2/docs/zcml.rst 2020-07-03 17:25:02.000000000
+0200
+++ new/zope.component-5.0.1/docs/zcml.rst 2021-07-09 13:52:59.000000000
+0200
@@ -690,13 +690,12 @@
>>> clearZCML()
>>> runSnippet('''
... <subscriber
- ... provides="zope.component.testfiles.adapter.IS"
... factory="zope.component.testfiles.adapter.A3"
... />''')
>>> content = Content()
>>> a2 = A2()
- >>> subscribers = zope.component.subscribers((content, a1, a2), IS)
+ >>> subscribers = zope.component.subscribers((content, a1, a2), I3)
>>> a3 = subscribers[0]
>>> a3.__class__ is A3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/setup.cfg
new/zope.component-5.0.1/setup.cfg
--- old/zope.component-4.6.2/setup.cfg 2020-07-03 17:25:03.111832600 +0200
+++ new/zope.component-5.0.1/setup.cfg 2021-07-09 13:53:00.803617700 +0200
@@ -1,3 +1,11 @@
+[bdist_wheel]
+universal = 1
+
+[check-manifest]
+ignore =
+ .editorconfig
+ .meta.toml
+
[nosetests]
nocapture = 1
cover-package = zope.component
@@ -9,9 +17,6 @@
dev = develop easy_install zope.component[testing]
docs = easy_install zope.component[docs]
-[bdist_wheel]
-universal = 1
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/setup.py
new/zope.component-5.0.1/setup.py
--- old/zope.component-4.6.2/setup.py 2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/setup.py 2021-07-09 13:52:59.000000000 +0200
@@ -62,8 +62,14 @@
setup(
name='zope.component',
- version='4.6.2',
+ version='5.0.1',
url='https://github.com/zopefoundation/zope.component',
+ project_urls={
+ 'Documentation': 'https://zopecomponent.readthedocs.io/',
+ 'Issue Tracker': ('https://github.com/zopefoundation/'
+ 'zope.component/issues'),
+ 'Sources': 'https://github.com/zopefoundation/zope.component',
+ },
license='ZPL 2.1',
description='Zope Component Architecture',
author='Zope Foundation and Contributors',
@@ -90,20 +96,20 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Framework :: Zope :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
],
namespace_packages=['zope',],
+ python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
tests_require=TESTS_REQUIRE,
install_requires=[
'setuptools',
- 'zope.deferredimport >= 4.2.1',
- 'zope.deprecation >= 4.3.0',
'zope.event',
'zope.hookable >= 4.2.0',
- 'zope.interface >= 4.1.0',
+ 'zope.interface >= 5.3.0a1',
],
include_package_data=True,
zip_safe=False,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/src/zope/component/hookable.py
new/zope.component-5.0.1/src/zope/component/hookable.py
--- old/zope.component-4.6.2/src/zope/component/hookable.py 2020-07-03
17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/hookable.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,19 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2009 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-This module is deprecated. Prefer to use zope.hookable.hookable.
-"""
-# pragma: no cover
-import zope.deprecation
-zope.deprecation.moved("zope.hookable", "4.5")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/src/zope/component/interface.py
new/zope.component-5.0.1/src/zope/component/interface.py
--- old/zope.component-4.6.2/src/zope/component/interface.py 2020-07-03
17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/interface.py 2021-07-09
13:52:59.000000000 +0200
@@ -16,14 +16,19 @@
from zope.interface import alsoProvides
from zope.interface.interfaces import IInterface
-from zope.component.globalregistry import getGlobalSiteManager
from zope.interface.interfaces import ComponentLookupError
+from zope.component._api import getSiteManager
from zope.component._api import queryUtility
from zope.component._compat import CLASS_TYPES
def provideInterface(id, interface, iface_type=None, info=''):
- """ Mark 'interface' as a named utilty providing 'iface_type'.
+ """
+ Mark *interface* as a named utility providing *iface_type*'.
+
+ .. versionchanged:: 5.0.0
+ The named utility is registered in the current site manager.
+ Previously it was always registered in the global site manager.
"""
if not id:
id = "%s.%s" % (interface.__module__, interface.__name__)
@@ -40,8 +45,8 @@
else:
iface_type = IInterface
- gsm = getGlobalSiteManager()
- gsm.registerUtility(interface, iface_type, id, info)
+ site_man = getSiteManager()
+ site_man.registerUtility(interface, iface_type, id, info)
def getInterface(context, id):
@@ -74,8 +79,8 @@
def searchInterfaceUtilities(context, search_string=None, base=None):
- gsm = getGlobalSiteManager()
- iface_utilities = gsm.getUtilitiesFor(IInterface)
+ site_man = getSiteManager()
+ iface_utilities = site_man.getUtilitiesFor(IInterface)
if search_string:
search_string = search_string.lower()
@@ -86,7 +91,7 @@
res = [iface_util for iface_util in iface_utilities
if iface_util[1].isOrExtends(base)]
else:
- res = [iface_util for iface_util in iface_utilities]
+ res = list(iface_utilities)
return res
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope/component/interfaces.py
new/zope.component-5.0.1/src/zope/component/interfaces.py
--- old/zope.component-4.6.2/src/zope/component/interfaces.py 2020-07-03
17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/interfaces.py 2021-07-09
13:52:59.000000000 +0200
@@ -20,33 +20,7 @@
from zope.interface import Attribute
from zope.interface import Interface
-
-# BBB 2011-09-09, import interfaces from zope.interface
-import zope.deferredimport
-zope.deferredimport.deprecatedFrom(
- "Import from zope.interface.interfaces",
- "zope.interface.interfaces",
- 'ComponentLookupError',
- 'Invalid',
- 'IObjectEvent',
- 'ObjectEvent',
- 'IComponentLookup',
- 'IRegistration',
- 'IUtilityRegistration',
- '_IBaseAdapterRegistration',
- 'IAdapterRegistration',
- 'ISubscriptionAdapterRegistration',
- 'IHandlerRegistration',
- 'IRegistrationEvent',
- 'RegistrationEvent',
- 'IRegistered',
- 'Registered',
- 'IUnregistered',
- 'Unregistered',
- 'IComponentRegistry',
- 'IComponents',
-)
-
+# pylint:disable=inherit-non-class,no-self-argument,no-method-argument
class IComponentArchitecture(Interface):
"""The Component Architecture is defined by two key components: Adapters
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope/component/persistentregistry.py
new/zope.component-5.0.1/src/zope/component/persistentregistry.py
--- old/zope.component-4.6.2/src/zope/component/persistentregistry.py
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/persistentregistry.py
2021-07-09 13:52:59.000000000 +0200
@@ -22,9 +22,73 @@
class PersistentAdapterRegistry(VerifyingAdapterRegistry, Persistent):
"""
An adapter registry that is also a persistent object.
+
+ .. versionchanged:: 5.0.0
+ Internal data structures are now composed of
+ :class:`persistent.mapping.PersistentMapping` and
+ :class:`persistent.list.PersistentList`. This helps scale to
+ larger registries.
+
+ Previously they were :class:`dict`, :class:`list` and
+ :class:`tuple`, meaning that as soon as this object was
+ unpickled, the entire registry tree had to be unpickled, and
+ when a change was made (an object registered or unregisterd),
+ the entire registry had to be pickled. Now, only the parts
+ that are in use are loaded, and only the parts that are
+ modified are stored.
+
+ The above applies without reservation to newly created
+ instances. For existing persistent instances, however, the
+ data will continue to be in dicts and tuples, with some few
+ exceptions for newly added or changed data.
+
+ To fix this, call :meth:`rebuild` and commit the transaction.
+ This will rewrite the internal data structures to use the new
+ types.
"""
+
+ # The persistent types we use, replacing the basic types inherited
+ # from ``BaseAdapterRegistry``.
+ _sequenceType = PersistentList
+ _leafSequenceType = PersistentList
+ _mappingType = PersistentMapping
+ _providedType = PersistentMapping
+
+ # The methods needed to manipulate the leaves of the subscriber
+ # tree. When we're manipulating unmigrated data, it's safe to
+ # migrate it, but not otherwise (we don't want to write in an
+ # otherwise read-only transaction).
+ def _addValueToLeaf(self, existing_leaf_sequence, new_item):
+ if not existing_leaf_sequence:
+ existing_leaf_sequence = self._leafSequenceType()
+ elif isinstance(existing_leaf_sequence, tuple):
+ # Converting from old state.
+ existing_leaf_sequence =
self._leafSequenceType(existing_leaf_sequence)
+ existing_leaf_sequence.append(new_item)
+ return existing_leaf_sequence
+
+ def _removeValueFromLeaf(self, existing_leaf_sequence, to_remove):
+ if isinstance(existing_leaf_sequence, tuple):
+ # Converting from old state
+ existing_leaf_sequence =
self._leafSequenceType(existing_leaf_sequence)
+
+ without_removed = VerifyingAdapterRegistry._removeValueFromLeaf(
+ self,
+ existing_leaf_sequence,
+ to_remove)
+ existing_leaf_sequence[:] = without_removed
+ return existing_leaf_sequence
+
def changed(self, originally_changed):
if originally_changed is self:
+ # XXX: This is almost certainly redundant, even if we
+ # have old data consisting of plain dict/list/tuple. That's
+ # because the super class will now increment the ``_generation``
+ # attribute to keep caches in sync. For this same reason,
+ # it's not worth trying to "optimize" for the case that we're a
+ # new or rebuilt object containing only Persistent sub-objects:
+ # the changed() mechanism will still result in mutating this
+ # object via ``_generation``.
self._p_changed = True
super(PersistentAdapterRegistry, self).changed(originally_changed)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/src/zope/component/registry.py
new/zope.component-5.0.1/src/zope/component/registry.py
--- old/zope.component-4.6.2/src/zope/component/registry.py 2020-07-03
17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/registry.py 2021-07-09
13:52:59.000000000 +0200
@@ -23,22 +23,6 @@
from zope.interface.interfaces import ISubscriptionAdapterRegistration
from zope.interface.interfaces import IUtilityRegistration
-# BBB, import component-related from zope.interface
-import zope.deferredimport
-zope.deferredimport.deprecatedFrom(
- "Import from zope.interface.registry",
- "zope.interface.registry",
- 'Components',
- '_getUtilityProvided',
- '_getAdapterProvided',
- '_getAdapterRequired',
- 'UtilityRegistration',
- 'AdapterRegistration',
- 'SubscriptionRegistration',
- 'HandlerRegistration',
-)
-
-
@adapter(IUtilityRegistration, IRegistrationEvent)
def dispatchUtilityRegistrationEvent(registration, event):
handle(registration.component, event)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope/component/tests/test_interface.py
new/zope.component-5.0.1/src/zope/component/tests/test_interface.py
--- old/zope.component-4.6.2/src/zope/component/tests/test_interface.py
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/tests/test_interface.py
2021-07-09 13:52:59.000000000 +0200
@@ -15,6 +15,7 @@
"""
import unittest
+# pylint:disable=inherit-non-class,blacklisted-name
class Test_provideInterface(unittest.TestCase):
@@ -71,7 +72,32 @@
self._callFUT('foo', IFoo)
self.assertTrue(IInterface.providedBy(IFoo))
registered = gsm.getUtility(IInterface, name='foo')
- self.assertTrue(registered is IFoo)
+ self.assertIs(registered, IFoo)
+
+ def test_register_in_current_site(self):
+ from zope.component._api import getSiteManager
+ from zope.component.globalregistry import getGlobalSiteManager
+ from zope.interface.registry import Components
+ from zope.interface import Interface
+ from zope.interface.interfaces import IInterface
+
+ class IFoo(Interface):
+ pass
+
+ site_man = Components()
+ def get(_context=None):
+ return site_man
+ getSiteManager.sethook(get)
+ self.addCleanup(getSiteManager.reset)
+
+ self._callFUT('foo', IFoo)
+
+ self.assertIs(site_man.getUtility(IInterface, name='foo'),
+ IFoo)
+ self.assertIsNone(
+ getGlobalSiteManager().queryUtility(IInterface, name='foo')
+ )
+
class Test_getInterface(unittest.TestCase):
@@ -171,6 +197,41 @@
gsm.registerUtility(IBar, IInterface, 'bar')
self.assertEqual(self._callFUT(object(), base=IBase), [IFoo])
+ def test_hit_in_current_site(self):
+ from zope.component._api import getSiteManager
+ from zope.component.globalregistry import getGlobalSiteManager
+ from zope.interface.registry import Components
+ from zope.interface import Interface
+ from zope.interface.interfaces import IInterface
+
+ class ILocal(Interface):
+ pass
+
+ class IGlobal(Interface):
+ pass
+
+ gsm = getGlobalSiteManager()
+ site_man = Components(bases=(gsm,))
+ def get(_context=None):
+ return site_man
+ getSiteManager.sethook(get)
+ self.addCleanup(getSiteManager.reset)
+
+
+ gsm.registerUtility(IGlobal, IInterface, 'foo')
+ site_man.registerUtility(ILocal, IInterface, 'bar')
+
+ result = self._callFUT(None)
+ self.assertEqual(len(result), 2)
+ self.assertIn(ILocal, result)
+ self.assertIn(IGlobal, result)
+
+ getSiteManager.reset()
+
+ result = self._callFUT(None)
+ self.assertEqual(len(result), 1)
+ self.assertIn(IGlobal, result)
+
class Test_searchInterfaceIds(unittest.TestCase):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope/component/tests/test_interfaces.py
new/zope.component-5.0.1/src/zope/component/tests/test_interfaces.py
--- old/zope.component-4.6.2/src/zope/component/tests/test_interfaces.py
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/tests/test_interfaces.py
2021-07-09 13:52:59.000000000 +0200
@@ -17,37 +17,13 @@
import unittest
-class TestBackwardsCompat(unittest.TestCase):
+class TestInterfaces(unittest.TestCase):
- def test_interface_warnings(self):
- from zope.component import interfaces
- import warnings
- for name in (
- 'ComponentLookupError',
- 'Invalid',
- 'IObjectEvent',
- 'ObjectEvent',
- 'IComponentLookup',
- 'IRegistration',
- 'IUtilityRegistration',
- '_IBaseAdapterRegistration',
- 'IAdapterRegistration',
- 'ISubscriptionAdapterRegistration',
- 'IHandlerRegistration',
- 'IRegistrationEvent',
- 'RegistrationEvent',
- 'IRegistered',
- 'Registered',
- 'IUnregistered',
- 'Unregistered',
- 'IComponentRegistry',
- 'IComponents',
- ):
- with warnings.catch_warnings(record=True) as log:
- warnings.simplefilter("always")
- getattr(interfaces, name)
+ def test_nothing(self):
+ """
+ This exists only so that zope.testrunner doesn't complain this
+ module has no tests.
- self.assertEqual(1, len(log), name)
- message = str(log[0].message)
- self.assertIn(name, message)
- self.assertIn("Import from zope.interface.interfaces", message)
+ Even though this file is empty, we want to keep it around for ease
+ of browsing the history.
+ """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope/component/tests/test_persistentregistry.py
new/zope.component-5.0.1/src/zope/component/tests/test_persistentregistry.py
---
old/zope.component-4.6.2/src/zope/component/tests/test_persistentregistry.py
2020-07-03 17:25:02.000000000 +0200
+++
new/zope.component-5.0.1/src/zope/component/tests/test_persistentregistry.py
2021-07-09 13:52:59.000000000 +0200
@@ -15,6 +15,7 @@
"""
import unittest
+from zope.interface.tests.test_adapter import
CustomTypesBaseAdapterRegistryTests
def skipIfNoPersistent(testfunc):
try:
@@ -101,12 +102,13 @@
bases = (globalSiteManager.adapters, globalSiteManager.utilities)
registry, jar, OID = self._makeOneWithJar(bases=bases)
state = registry.__getstate__()
- self.assertEqual(state['__bases__'], bases)
- self.assertEqual(state['_generation'], 1)
- self.assertEqual(state['_provided'], {})
- self.assertEqual(state['_adapters'], [])
- self.assertEqual(state['_subscribers'], [])
- self.assertFalse('ro' in state)
+ self.assertEqual(state.pop('__bases__'), bases)
+ self.assertEqual(state.pop('_generation'), 1)
+ self.assertEqual(state.pop('_provided'), {})
+ self.assertEqual(state.pop('_adapters'), [])
+ self.assertEqual(state.pop('_subscribers'), [])
+ self.assertNotIn('ro', state)
+ self.assertEqual(state, {})
def test___getstate___skips_delegated_names(self):
registry, jar, OID = self._makeOneWithJar()
@@ -131,6 +133,53 @@
self.assertEqual(registry.__bases__, bases)
self.assertEqual(registry.ro, [registry] + list(bases))
+ def test__addValueToLeaf_existing_is_tuple_converts(self):
+ from persistent.list import PersistentList
+ registry = self._makeOne()
+ # It converts when the tuple is not empty...
+ result = registry._addValueToLeaf(('a',), 'b')
+ self.assertIsInstance(result, PersistentList)
+ self.assertEqual(result, ['a', 'b'])
+ # ...and when it is empty...
+ result = registry._addValueToLeaf((), 'b')
+ self.assertIsInstance(result, PersistentList)
+ self.assertEqual(result, ['b'])
+ # ...and in fact when it is even missing
+ result = registry._addValueToLeaf(None, 'b')
+ self.assertIsInstance(result, PersistentList)
+ self.assertEqual(result, ['b'])
+
+ def test__removeValueFromLeaf_existing_is_tuple_converts(self):
+ from persistent.list import PersistentList
+ registry = self._makeOne()
+ # It converts when the item is found...
+ result = registry._removeValueFromLeaf(('a', 'b'), 'b')
+ self.assertIsInstance(result, PersistentList)
+ self.assertEqual(result, ['a'])
+ # ...and when it is not found
+ result = registry._removeValueFromLeaf(('a',), 'b')
+ self.assertIsInstance(result, PersistentList)
+ self.assertEqual(result, ['a'])
+
+ def test__addValueFromLeaf_preserves_identity(self):
+ registry = self._makeOne()
+ first = registry._addValueToLeaf(None, 'a')
+ second = registry._addValueToLeaf(first, 'b')
+ self.assertIs(first, second)
+ self.assertEqual(second, ['a', 'b'])
+
+ def test__removeValueFromLeaf_preserves_identity(self):
+ registry = self._makeOne()
+ first = registry._addValueToLeaf(None, 'a')
+ second = registry._addValueToLeaf(first, 'b')
+ third = registry._addValueToLeaf(second, 'c')
+ fourth = registry._removeValueFromLeaf(third, 'c')
+ self.assertIs(first, second)
+ self.assertIs(third, fourth)
+ self.assertIs(first, fourth)
+ self.assertEqual(fourth, ['a', 'b'])
+
+
@skipIfNoPersistent
class PersistentComponentsTests(unittest.TestCase):
@@ -161,3 +210,25 @@
def _makeOctets(s):
return bytes(s) if bytes is str else bytes(s, 'ascii')
+
+
+@skipIfNoPersistent
+class
PersistentAdapterRegistryCustomTypesTest(CustomTypesBaseAdapterRegistryTests):
+
+ def _getMappingType(self):
+ from persistent.mapping import PersistentMapping
+ return PersistentMapping
+
+ def _getProvidedType(self):
+ return self._getMappingType()
+
+ def _getMutableListType(self):
+ from persistent.list import PersistentList
+ return PersistentList
+
+ def _getLeafSequenceType(self):
+ return self._getMutableListType()
+
+ def _getBaseAdapterRegistry(self):
+ from zope.component.persistentregistry import PersistentAdapterRegistry
+ return PersistentAdapterRegistry
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope/component/tests/test_registry.py
new/zope.component-5.0.1/src/zope/component/tests/test_registry.py
--- old/zope.component-4.6.2/src/zope/component/tests/test_registry.py
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/tests/test_registry.py
2021-07-09 13:52:59.000000000 +0200
@@ -105,36 +105,11 @@
self.assertEqual(_handled, [(_registration.handler, _EVENT)])
-class TestBackwardsCompat(unittest.TestCase):
-
- def test_interface_warnings(self):
- from zope.component import registry
- import warnings
- for name in (
- 'Components',
- '_getUtilityProvided',
- '_getAdapterProvided',
- '_getAdapterRequired',
- 'UtilityRegistration',
- 'AdapterRegistration',
- 'SubscriptionRegistration',
- 'HandlerRegistration',
- ):
- with warnings.catch_warnings(record=True) as log:
- warnings.simplefilter("always")
- getattr(registry, name)
-
- self.assertEqual(1, len(log), name)
- message = str(log[0].message)
- self.assertIn(name, message)
- self.assertIn("Import from zope.interface.registry", message)
-
-
class _Monkey(object):
# context-manager for replacing module names in the scope of a test.
def __init__(self, module, **kw):
self.module = module
- self.to_restore = dict([(key, getattr(module, key)) for key in kw])
+ self.to_restore = {key: getattr(module, key) for key in kw}
for key, value in kw.items():
setattr(module, key, value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope/component/tests/test_zcml.py
new/zope.component-5.0.1/src/zope/component/tests/test_zcml.py
--- old/zope.component-4.6.2/src/zope/component/tests/test_zcml.py
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/tests/test_zcml.py
2021-07-09 13:52:59.000000000 +0200
@@ -598,6 +598,29 @@
self.assertEqual(action['discriminator'], None)
self.assertEqual(action['args'], ('', Interface))
+ def test_no_for__no_provides_subscriber_adapts_subscriber_implements(self):
+ from zope.interface import Interface
+ from zope.interface import implementer
+ from zope.component._declaration import adapter
+ from zope.component.zcml import handler
+ class IFoo(Interface):
+ pass
+ @adapter(Interface)
+ @implementer(IFoo)
+ class _Factory(object):
+ def __init__(self, context):
+ self.context = context
+ _cfg_ctx = _makeConfigContext()
+ self._callFUT(_cfg_ctx, factory=_Factory)
+ self.assertEqual(len(_cfg_ctx._actions), 3)
+ self.assertEqual(_cfg_ctx._actions[0][0], ())
+ # Register the subscriber
+ action = _cfg_ctx._actions[0][1]
+ self.assertEqual(action['callable'], handler)
+ self.assertIsNone(action['discriminator'])
+ self.assertEqual(action['args'],
+ ('registerSubscriptionAdapter', _Factory,
(Interface,), IFoo,
+ '', 'TESTING'))
class Test_utility(unittest.TestCase):
@@ -801,6 +824,43 @@
self.assertEqual(action['discriminator'], None)
self.assertEqual(action['args'], ('', IFoo))
+ @skipIfNoSecurity
+ def test_w_factory_w_provides_w_permission(self):
+ from zope.interface import Interface
+ from zope.component.interface import provideInterface
+ from zope.component.zcml import handler
+ class IFoo(Interface):
+ pass
+ class Foo(object):
+ pass
+ _cfg_ctx = _makeConfigContext()
+ self._callFUT(_cfg_ctx, factory=Foo,
+ provides=IFoo, permission='testing')
+ self.assertEqual(len(_cfg_ctx._actions), 2)
+ self.assertEqual(_cfg_ctx._actions[0][0], ())
+ # Register the utility
+ action =_cfg_ctx._actions[0][1]
+ self.assertEqual(action['callable'], handler)
+ self.assertEqual(action['discriminator'], ('utility', IFoo, ''))
+ self.assertEqual(action['args'][0], 'registerUtility')
+ self.assertEqual(action['args'][1], None)
+ self.assertEqual(action['args'][2], IFoo)
+ self.assertEqual(action['args'][3], '')
+ self.assertEqual(action['args'][4], 'TESTING')
+ fctry = action['kw']['factory']
+ # Factory is wrapped
+ self.assertNotEqual(fctry, Foo)
+ self.assertEqual(fctry.factory, Foo)
+ secured = fctry()
+ self.assertIsInstance(secured, Foo)
+ # Register the provided interface
+ self.assertEqual(_cfg_ctx._actions[1][0], ())
+ action =_cfg_ctx._actions[1][1]
+ self.assertEqual(action['callable'], provideInterface)
+ self.assertEqual(action['discriminator'], None)
+ self.assertEqual(action['args'], ('', IFoo))
+
+
class Test_interface(unittest.TestCase):
def _callFUT(self, *args, **kw):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/src/zope/component/zcml.py
new/zope.component-5.0.1/src/zope/component/zcml.py
--- old/zope.component-4.6.2/src/zope/component/zcml.py 2020-07-03
17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope/component/zcml.py 2021-07-09
13:52:59.000000000 +0200
@@ -304,6 +304,10 @@
if handler is not None:
raise TypeError("Cannot use handler with factory")
if provides is None:
+ p = list(implementedBy(factory))
+ if len(p) == 1:
+ provides = p[0]
+ if provides is None:
raise TypeError(
"You must specify a provided interface when registering "
"a factory")
@@ -392,7 +396,11 @@
name = getName(component)
if permission is not None:
- component = proxify(component, provides=provides,
permission=permission)
+ if component:
+ component = proxify(component, provides=provides,
+ permission=permission)
+ if factory:
+ factory = protectedFactory(factory, provides, permission)
_context.action(
discriminator = ('utility', provides, name),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope.component.egg-info/PKG-INFO
new/zope.component-5.0.1/src/zope.component.egg-info/PKG-INFO
--- old/zope.component-4.6.2/src/zope.component.egg-info/PKG-INFO
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope.component.egg-info/PKG-INFO
2021-07-09 13:53:00.000000000 +0200
@@ -1,31 +1,38 @@
Metadata-Version: 2.1
Name: zope.component
-Version: 4.6.2
+Version: 5.0.1
Summary: Zope Component Architecture
Home-page: https://github.com/zopefoundation/zope.component
Author: Zope Foundation and Contributors
Author-email: [email protected]
License: ZPL 2.1
-Description: ``zope.component``
- ==================
+Project-URL: Documentation, https://zopecomponent.readthedocs.io/
+Project-URL: Issue Tracker,
https://github.com/zopefoundation/zope.component/issues
+Project-URL: Sources, https://github.com/zopefoundation/zope.component
+Description: ================
+ zope.component
+ ================
+
+ .. image::
https://github.com/zopefoundation/zope.component/actions/workflows/tests.yml/badge.svg
+ :target:
https://github.com/zopefoundation/zope.component/actions/workflows/tests.yml
+ :alt: Unit test status
+
+ .. image::
https://coveralls.io/repos/github/zopefoundation/zope.component/badge.svg?branch=master
+ :target:
https://coveralls.io/github/zopefoundation/zope.component?branch=master
+ :alt: Coverage Status
.. image:: https://img.shields.io/pypi/v/zope.component.svg
- :target: https://pypi.python.org/pypi/zope.component/
- :alt: Latest Version
+ :target: https://pypi.python.org/pypi/zope.component/
+ :alt: Current version on PyPI
- .. image::
https://travis-ci.org/zopefoundation/zope.component.svg?branch=master
- :target: https://travis-ci.org/zopefoundation/zope.component
- :alt: Build Status
+ .. image:: https://img.shields.io/pypi/pyversions/zope.component
+ :target: https://pypi.org/project/zope.component/
+ :alt: Supported Python versions
.. image::
https://readthedocs.org/projects/zopecomponent/badge/?version=latest
:target: http://zopecomponent.readthedocs.org/en/latest/
:alt: Documentation Status
- .. image::
https://coveralls.io/repos/github/zopefoundation/zope.component/badge.svg?branch=master
- :target:
https://coveralls.io/github/zopefoundation/zope.component?branch=master
- :alt: Coverage Status
-
-
.. note::
This package is intended to be independently reusable in any Python
@@ -45,6 +52,62 @@
Changes
=========
+ 5.0.1 (2021-07-09)
+ ==================
+
+ - Fix unregistering utilities on old persistent adapter registries.
+ Previously this could raise ``TypeError``. See `issue 62
+ <https://github.com/zopefoundation/zope.component/issues/62>`_.
+
+
+ 5.0.0 (2021-03-19)
+ ==================
+
+ - Remove backwards compatibility imports that were emitting
+ deprecation warnings. This affects certain imports from
+ ``zope.component.interfaces`` (which should be imported from
+ ``zope.interface.interfaces``) as well as certain imports from
+ ``zope.component.registery`` (import from
+ ``zope.interface.registry``), and the entire
+ ``zope.component.hookable`` module. See `issue 59
+ <https://github.com/zopefoundation/zope.component/issues/59>`_.
+
+ - Respect permission value for utility factory registrations
+ (`#54 <https://github.com/zopefoundation/zope.component/issues/54>`_)
+
+ - Add support for Python 3.9
+
+ - Fix the ``<subscriber>`` ZCML directive to allow a missing
+ ``provides=`` attribute when a ``factory=`` is given and the Python
+ object has been decorated with ``@implementer`` and implements a
+ single interface. This has been documented, but hasn't worked
+ before. See `issue 9
+ <https://github.com/zopefoundation/zope.component/issues/9>`_.
+
+ - Make ``PersistentAdapterRegistry`` use persistent objects
+ (``PersistentMapping`` and ``PersistentList``) for its internal data
+ structures instead of plain dicts and lists. This helps make it
+ scalable to larger registry sizes.
+
+ This requires zope.interface 5.3.0a1 or later.
+
+ New registries (and their primary users, ``PersistentComponents`` and
+ zope.site's ``LocalSiteManager``) take full advantage of this
+ automatically. For existing persistent registries to take advantage
+ of this, you must call their ``rebuild()`` method and commit the
+ transaction.
+
+ See `issue 51
<https://github.com/zopefoundation/zope.component/issues/51>`_.
+
+ - Fix ``zope.interface.interface.provideInterface`` and the various
+ search and query methods to use the current site manager instead of
+ always using the global site manager. (``provideInterface`` is
+ called implicitly when registering components from ZCML.) The search
+ and query methods continue to return interfaces registered in base
+ site managers.
+
+ See `issue 10
<https://github.com/zopefoundation/zope.component/issues/51>`_.
+
4.6.2 (2020-07-03)
==================
@@ -462,10 +525,12 @@
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Framework :: Zope :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
Provides-Extra: hook
Provides-Extra: persistentregistry
Provides-Extra: security
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope.component.egg-info/SOURCES.txt
new/zope.component-5.0.1/src/zope.component.egg-info/SOURCES.txt
--- old/zope.component-4.6.2/src/zope.component.egg-info/SOURCES.txt
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope.component.egg-info/SOURCES.txt
2021-07-09 13:53:00.000000000 +0200
@@ -1,11 +1,8 @@
-.coveragerc
-.travis.yml
CHANGES.rst
COPYRIGHT.txt
LICENSE.txt
MANIFEST.in
README.rst
-bootstrap.py
buildout.cfg
rtd.txt
setup.cfg
@@ -27,7 +24,6 @@
docs/socketexample.rst
docs/testlayer.rst
docs/zcml.rst
-docs/_static/.gitignore
docs/api/adapter.rst
docs/api/factory.rst
docs/api/hooks.rst
@@ -55,7 +51,6 @@
src/zope/component/eventtesting.py
src/zope/component/factory.py
src/zope/component/globalregistry.py
-src/zope/component/hookable.py
src/zope/component/hooks.py
src/zope/component/interface.py
src/zope/component/interfaces.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.2/src/zope.component.egg-info/requires.txt
new/zope.component-5.0.1/src/zope.component.egg-info/requires.txt
--- old/zope.component-4.6.2/src/zope.component.egg-info/requires.txt
2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/src/zope.component.egg-info/requires.txt
2021-07-09 13:53:00.000000000 +0200
@@ -1,9 +1,7 @@
setuptools
-zope.deferredimport>=4.2.1
-zope.deprecation>=4.3.0
zope.event
zope.hookable>=4.2.0
-zope.interface>=4.1.0
+zope.interface>=5.3.0a1
[docs]
Sphinx
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.2/tox.ini
new/zope.component-5.0.1/tox.ini
--- old/zope.component-4.6.2/tox.ini 2020-07-03 17:25:02.000000000 +0200
+++ new/zope.component-5.0.1/tox.ini 2021-07-09 13:52:59.000000000 +0200
@@ -1,8 +1,17 @@
[tox]
+minversion = 3.18
envlist =
-# Jython support pending 2.7 support, due 2012-07-15 or so. See:
-# http://fwierzbicki.blogspot.com/2012/03/adconion-to-fund-jython-27.html
- py27,py35,py36,py37,py38,py27-minimal,pypy,pypy3,docs,coverage
+ py27
+ py35
+ py36
+ py37
+ py38
+ py39
+ py27-minimal
+ pypy
+ pypy3
+ docs
+ coverage
[mindeps]
deps =
@@ -46,7 +55,27 @@
commands =
coverage run -m unittest discover -s src
coverage run -a -m sphinx -b doctest -d {envdir}/.cache/doctrees docs
{envdir}/.cache/doctest
- coverage report --fail-under=100
+ coverage report --fail-under=99
deps =
{[testenv]deps}
coverage
+ coverage-python-version
+
+[coverage:run]
+branch = True
+plugins = coverage_python_version
+source = zope.component
+omit =
+ # Runs in a subprocess
+ src/zope/component/standalonetests.py
+ # Not used
+ src/zope/component/hookable.py
+ src/zope/component/eventtesting.py
+
+[coverage:report]
+exclude_lines =
+ pragma: no cover
+ pragma NO COVER
+ if __name__ == '__main__':
+ raise NotImplementedError
+ self.fail