zope.hookable-5.0.0/0000755000175000017500000000000013562520570013311 5ustar mgmg00000000000000zope.hookable-5.0.0/.coveragerc0000644000175000017500000000026013562520570015430 0ustar mgmg00000000000000[run] source = zope.hookable [report] exclude_lines = pragma: no cover if __name__ == '__main__': raise NotImplementedError raise AssertionError self.fail zope.hookable-5.0.0/.travis.yml0000644000175000017500000000551213562520570015425 0ustar mgmg00000000000000language: python env: global: TWINE_USERNAME: zope.wheelbuilder TWINE_PASSWORD: secure: "iHOASkMh4JGxVom8gVdIDmmj7VRa5j8vvdABphmyuO6ZH6Qyvu/dIJwzp5S5GKEn+SmwoB+MdKHdxtvVTmmryA5TqimYVd0zti+DeCdSU2N87W/dCpuvNUIL0dz+QeCzuQluipl0qjhkPPhR4GzwxLwxFZW1vJyQ7puGlbhjlkY=" python: - 2.7 - 3.5 - 3.6 - 3.7 - 3.8 - pypy - pypy3 jobs: include: - name: "Python: 2.7, pure (no C extensions)" python: 2.7 env: PURE_PYTHON=1 # manylinux wheel builds - name: 64-bit manylinux wheels (all Pythons) services: docker env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 install: docker pull $DOCKER_IMAGE script: bash .manylinux.sh - name: 32-bit manylinux wheels (all Pythons) services: docker env: DOCKER_IMAGE=quay.io/pypa/manylinux2010_i686 PRE_CMD=linux32 install: docker pull $DOCKER_IMAGE script: bash .manylinux.sh # It's important to use 'macpython' builds to get the least # restrictive wheel tag. It's also important to avoid # 'homebrew 3' because it floats instead of being a specific version. - name: Python 2.7 wheels for MacOS os: osx language: generic env: TERRYFY_PYTHON='macpython 2.7.17' - name: Python 3.5 wheels for MacOS os: osx language: generic env: TERRYFY_PYTHON='macpython 3.5' - name: Python 3.6 wheels for MacOS os: osx language: generic env: TERRYFY_PYTHON='macpython 3.6.0' - name: Python 3.7 wheels for MacOS os: osx language: generic env: TERRYFY_PYTHON='macpython 3.7.0' before_install: - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git clone https://github.com/MacPython/terryfy source terryfy/travis_tools.sh get_python_environment $TERRYFY_PYTHON venv fi install: - pip install -U pip setuptools - pip install -U coveralls coverage - pip install -U -e .[test,docs] script: - python --version - coverage run setup.py -q test - coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest - python setup.py -q bdist_wheel after_success: - coveralls - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then # macpython 3.5 doesn't support recent TLS protocols which causes twine # upload to fail, so we use the system Python to run twine /usr/bin/python -m ensurepip --user /usr/bin/python -m pip install --user -U pip /usr/bin/python -m pip install --user -U -I twine /usr/bin/python -m twine check dist/* if [[ $TRAVIS_TAG ]]; then /usr/bin/python -m twine upload --skip-existing dist/* fi fi - | if [[ -n "$DOCKER_IMAGE" ]]; then pip install twine twine check wheelhouse/* if [[ $TRAVIS_TAG ]]; then twine upload --skip-existing wheelhouse/* fi fi notifications: email: false cache: pip zope.hookable-5.0.0/CHANGES.rst0000644000175000017500000000372513562520570015122 0ustar mgmg00000000000000========= Changes ========= 5.0.0 (2019-11-12) ================== - Add support for Python 3.7 and 3.8. - Drop support for Python 3.4. 4.2.0 (2017-11-07) ================== - Expose the ``__doc__`` (and, where applicable, ``__bases__`` and ``__dict__``) of the hooked object. This lets Sphinx document them. See `issue 6 `_. - Respect ``PURE_PYTHON`` at runtime. At build time, always try to build the C extensions on supported platforms, but allow it to fail. See `issue 7 `_. 4.1.0 (2017-07-26) ================== - Drop support for Python 2.6, 3.2 and 3.3. - Add support for Python 3.5 and 3.6. 4.0.4 (2014-03-19) ================== - Add support for Python 3.4. 4.0.3 (2014-03-17) ================== - Update ``boostrap.py`` to version 2.2. - Fix extension compilation on Py3k. 4.0.2 (2012-12-31) ================== - Flesh out PyPI Trove classifiers. 4.0.1 (2012-11-21) ================== - Add support for Python 3.3. - Avoid building the C extension explicitly (use the "feature" indirection instead). https://bugs.launchpad.net/zope.hookable/+bug/1025470 4.0.0 (2012-06-04) ================== - Add support for PyPy. - Add support for continuous integration using ``tox`` and ``jenkins``. - Add a pure-Python reference implementation. - Move doctests to Sphinx documentation. - Bring unit test coverage to 100%. - Add 'setup.py docs' alias (installs ``Sphinx`` and dependencies). - Add 'setup.py dev' alias (runs ``setup.py develop`` plus installs ``nose`` and ``coverage``). - Drop support for Python 2.4 / 2.5. - Remove of 'zope.testing.doctestunit' in favor of stdlib's 'doctest. - Add Python 3 support. 3.4.1 (2009-04-05) ================== - Update for compatibility with Python 2.6 traceback formats. - Use Jython-compatible ``bootstrap.py``. 3.4.0 (2007-07-20) ================== - Initial release as a separate project. zope.hookable-5.0.0/COPYRIGHT.txt0000644000175000017500000000004013562520570015414 0ustar mgmg00000000000000Zope Foundation and Contributorszope.hookable-5.0.0/LICENSE.txt0000644000175000017500000000402613562520570015136 0ustar mgmg00000000000000Zope Public License (ZPL) Version 2.1 A copyright notice accompanies this license document that identifies the copyright holders. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders. 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. zope.hookable-5.0.0/MANIFEST.in0000644000175000017500000000043013562520570015044 0ustar mgmg00000000000000include *.rst include *.txt include *.py include buildout.cfg include tox.ini include .travis.yml include appveyor.yml include .coveragerc recursive-include docs *.bat recursive-include docs *.py recursive-include docs *.rst recursive-include docs Makefile global-exclude *.pyc zope.hookable-5.0.0/PKG-INFO0000644000175000017500000001302713562520570014411 0ustar mgmg00000000000000Metadata-Version: 2.1 Name: zope.hookable Version: 5.0.0 Summary: Zope hookable Home-page: http://github.com/zopefoundation/zope.hookable Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: =============== zope.hookable =============== .. image:: https://img.shields.io/pypi/v/zope.hookable.svg :target: https://pypi.python.org/pypi/zope.hookable/ :alt: Latest release .. image:: https://img.shields.io/pypi/pyversions/zope.hookable.svg :target: https://pypi.org/project/zope.hookable/ :alt: Supported Python versions .. image:: https://travis-ci.org/zopefoundation/zope.hookable.svg?branch=master :target: https://travis-ci.org/zopefoundation/zope.hookable .. image:: https://readthedocs.org/projects/zopehookable/badge/?version=latest :target: https://zopehookable.readthedocs.io/en/latest/ :alt: Documentation Status .. image:: https://coveralls.io/repos/github/zopefoundation/zope.hookable/badge.svg?branch=master :target: https://coveralls.io/github/zopefoundation/zope.hookable?branch=master This package supports the efficient creation of "hookable" objects, which are callable objects that are meant to be optionally replaced. The idea is that you create a function that does some default thing and make it hookable. Later, someone can modify what it does by calling its sethook method and changing its implementation. All users of the function, including those that imported it, will see the change. Documentation is hosted at https://zopehookable.readthedocs.io ========= Changes ========= 5.0.0 (2019-11-12) ================== - Add support for Python 3.7 and 3.8. - Drop support for Python 3.4. 4.2.0 (2017-11-07) ================== - Expose the ``__doc__`` (and, where applicable, ``__bases__`` and ``__dict__``) of the hooked object. This lets Sphinx document them. See `issue 6 `_. - Respect ``PURE_PYTHON`` at runtime. At build time, always try to build the C extensions on supported platforms, but allow it to fail. See `issue 7 `_. 4.1.0 (2017-07-26) ================== - Drop support for Python 2.6, 3.2 and 3.3. - Add support for Python 3.5 and 3.6. 4.0.4 (2014-03-19) ================== - Add support for Python 3.4. 4.0.3 (2014-03-17) ================== - Update ``boostrap.py`` to version 2.2. - Fix extension compilation on Py3k. 4.0.2 (2012-12-31) ================== - Flesh out PyPI Trove classifiers. 4.0.1 (2012-11-21) ================== - Add support for Python 3.3. - Avoid building the C extension explicitly (use the "feature" indirection instead). https://bugs.launchpad.net/zope.hookable/+bug/1025470 4.0.0 (2012-06-04) ================== - Add support for PyPy. - Add support for continuous integration using ``tox`` and ``jenkins``. - Add a pure-Python reference implementation. - Move doctests to Sphinx documentation. - Bring unit test coverage to 100%. - Add 'setup.py docs' alias (installs ``Sphinx`` and dependencies). - Add 'setup.py dev' alias (runs ``setup.py develop`` plus installs ``nose`` and ``coverage``). - Drop support for Python 2.4 / 2.5. - Remove of 'zope.testing.doctestunit' in favor of stdlib's 'doctest. - Add Python 3 support. 3.4.1 (2009-04-05) ================== - Update for compatibility with Python 2.6 traceback formats. - Use Jython-compatible ``bootstrap.py``. 3.4.0 (2007-07-20) ================== - Initial release as a separate project. Keywords: function hook replacement loose coupled Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 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: docs Provides-Extra: test Provides-Extra: testing zope.hookable-5.0.0/README.rst0000644000175000017500000000251513562520570015003 0ustar mgmg00000000000000=============== zope.hookable =============== .. image:: https://img.shields.io/pypi/v/zope.hookable.svg :target: https://pypi.python.org/pypi/zope.hookable/ :alt: Latest release .. image:: https://img.shields.io/pypi/pyversions/zope.hookable.svg :target: https://pypi.org/project/zope.hookable/ :alt: Supported Python versions .. image:: https://travis-ci.org/zopefoundation/zope.hookable.svg?branch=master :target: https://travis-ci.org/zopefoundation/zope.hookable .. image:: https://readthedocs.org/projects/zopehookable/badge/?version=latest :target: https://zopehookable.readthedocs.io/en/latest/ :alt: Documentation Status .. image:: https://coveralls.io/repos/github/zopefoundation/zope.hookable/badge.svg?branch=master :target: https://coveralls.io/github/zopefoundation/zope.hookable?branch=master This package supports the efficient creation of "hookable" objects, which are callable objects that are meant to be optionally replaced. The idea is that you create a function that does some default thing and make it hookable. Later, someone can modify what it does by calling its sethook method and changing its implementation. All users of the function, including those that imported it, will see the change. Documentation is hosted at https://zopehookable.readthedocs.io zope.hookable-5.0.0/appveyor.yml0000644000175000017500000000233513562520570015704 0ustar mgmg00000000000000environment: global: TWINE_USERNAME: zope.wheelbuilder TWINE_PASSWORD: secure: UcdTh6W78cRLVGfKRFoa5A== matrix: - python: 27 - python: 27-x64 - python: 35 - python: 35-x64 - python: 36 - python: 36-x64 - python: 37 - python: 37-x64 - python: 38 - python: 38-x64 install: - "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%" - ps: | $env:PYTHON = "C:\\Python${env:PYTHON}" if (-not (Test-Path $env:PYTHON)) { curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/11a389d78892cf90addac8f69433d5e22bfa422a/install_python.ps1 .\install_python.ps1 } - ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" } - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat" - pip install -e . build_script: - pip install wheel - python -W ignore setup.py -q bdist_wheel test_script: - python setup.py -q test artifacts: - path: 'dist\*.whl' name: wheel deploy_script: - ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { pip install twine; twine upload --skip-existing dist/* } deploy: on zope.hookable-5.0.0/bootstrap.py0000644000175000017500000001644213562520570015707 0ustar mgmg00000000000000############################################################################## # # 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) zope.hookable-5.0.0/buildout.cfg0000644000175000017500000000013713562520570015622 0ustar mgmg00000000000000[buildout] develop = . parts = test [test] recipe = zc.recipe.testrunner eggs = zope.hookable zope.hookable-5.0.0/docs/0000755000175000017500000000000013562520570014241 5ustar mgmg00000000000000zope.hookable-5.0.0/docs/Makefile0000644000175000017500000001272413562520570015707 0ustar mgmg00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/zopehookable.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/zopehookable.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/zopehookable" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/zopehookable" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." zope.hookable-5.0.0/docs/api.rst0000644000175000017500000000013613562520570015544 0ustar mgmg00000000000000:mod:`zope.hookable` API ======================== .. automodule:: zope.hookable :members: zope.hookable-5.0.0/docs/conf.py0000644000175000017500000001744613562520570015554 0ustar mgmg00000000000000# -*- coding: utf-8 -*- # # zope.hookable documentation build configuration file, created by # sphinx-quickstart on Mon Jun 4 11:49:33 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.viewcode', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'zope.hookable' copyright = u'2012, Zope Foundation Contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '4.1' # The full version, including alpha/beta/rc tags. release = '4.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'zopehookabledoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'zopehookable.tex', u'zope.hookable Documentation', u'Zope Foundation Contributors', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'zopehookable', u'zope.hookable Documentation', [u'Zope Foundation Contributors'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'zopehookable', u'zope.hookable Documentation', u'Zope Foundation Contributors', 'zopehookable', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' zope.hookable-5.0.0/docs/hacking.rst0000644000175000017500000002056313562520570016405 0ustar mgmg00000000000000Hacking on :mod:`zope.hookable` ================================ Getting the Code ################ The main repository for :mod:`zope.hookable` is in the Zope Foundation Github repository: https://github.com/zopefoundation/zope.hookable You can get a read-only checkout from there: .. code-block:: sh $ git clone https://github.com/zopefoundation/zope.hookable.git or fork it and get a writeable checkout of your fork: .. code-block:: sh $ git clone git@github.com/jrandom/zope.hookable.git The project also mirrors the trunk from the Github repository as a Bazaar branch on Launchpad: https://code.launchpad.net/zope.hookable You can branch the trunk from there using Bazaar: .. code-block:: sh $ bzr branch lp:zope.hookable Working in a ``virtualenv`` ########################### Installing ---------- If you use the ``virtualenv`` package to create lightweight Python development environments, you can run the tests using nothing more than the ``python`` binary in a virtualenv. First, create a scratch environment: .. code-block:: sh $ /path/to/virtualenv --no-site-packages /tmp/hack-zope.hookable Next, get this package registered as a "development egg" in the environment: .. code-block:: sh $ /tmp/hack-zope.hookable/bin/python setup.py develop Running the tests ----------------- Run the tests using the build-in ``setuptools`` testrunner: .. code-block:: sh $ /tmp/hack-zope.hookable/bin/python setup.py test -q running test ... ---------------------------------------------------------------------- Ran 18 tests in 0.000s OK The ``dev`` command alias downloads and installs extra tools, like the :mod:`nose` testrunner and the :mod:`coverage` coverage analyzer: .. code-block:: sh $ /tmp/hack-zope.hookable/bin/python setup.py dev $ /tmp/hack-zope.hookable/bin/nosetests running nosetests .................................... (lots more dots) ---------------------------------------------------------------------- Ran 18 tests in 0.001s OK If you have the :mod:`coverage` pacakge installed in the virtualenv, you can see how well the tests cover the code: .. code-block:: sh $ /tmp/hack-zope.hookable/bin/nosetests --with coverage running nosetests .................................... (lots more dots) Name Stmts Miss Cover Missing ---------------------------------------------------------------- zope.hookable 23 0 100% ---------------------------------------------------------------- TOTAL 23 0 100% ---------------------------------------------------------------------- Ran 18 tests in 0.001s OK Building the documentation -------------------------- :mod:`zope.hookable` uses the nifty :mod:`Sphinx` documentation system for building its docs. Using the same virtualenv you set up to run the tests, you can build the docs: The ``docs`` command alias downloads and installs Sphinx and its dependencies: .. code-block:: sh $ /tmp/hack-zope.hookable/bin/python setup.py docs ... $ bin/sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html ... build succeeded. Build finished. The HTML pages are in docs/_build/html. You can also test the code snippets in the documentation: .. code-block:: sh $ bin/sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest ... running tests... Document: index --------------- 1 items passed all tests: 13 tests in default 13 tests in 1 items. 13 passed and 0 failed. Test passed. Doctest summary =============== 13 tests 0 failures in tests 0 failures in setup code build succeeded. Testing of doctests in the sources finished, look at the \ results in docs/_build/doctest/output.txt. Using :mod:`zc.buildout` ######################## Setting up the buildout ----------------------- :mod:`zope.hookable` ships with its own :file:`buildout.cfg` file and :file:`bootstrap.py` for setting up a development buildout: .. code-block:: sh $ /path/to/python2.6 bootstrap.py ... Generated script '.../bin/buildout' $ bin/buildout Develop: '/home/jrandom/projects/Zope/BTK/hookable/.' ... Generated script '.../bin/sphinx-quickstart'. Generated script '.../bin/sphinx-build'. Running the tests ----------------- You can now run the tests: .. code-block:: sh $ bin/test --all Running zope.testing.testrunner.layer.UnitTests tests: Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds. Ran 702 tests with 0 failures and 0 errors in 0.000 seconds. Tearing down left over layers: Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds. Using :mod:`tox` ################ Running Tests on Multiple Python Versions ----------------------------------------- `tox `_ is a Python-based test automation tool designed to run tests against multiple Python versions. It creates a ``virtualenv`` for each configured version, installs the current package and configured dependencies into each ``virtualenv``, and then runs the configured commands. :mod:`zope.hookable` configures the following :mod:`tox` environments via its ``tox.ini`` file: - The ``py26``, ``py27``, ``py33``, ``py34``, and ``pypy`` environments builds a ``virtualenv`` with ``pypy``, installs :mod:`zope.hookable` and dependencies, and runs the tests via ``python setup.py test -q``. - The ``coverage`` environment builds a ``virtualenv`` with ``python2.6``, installs :mod:`zope.hookable` and dependencies, installs :mod:`nose` and :mod:`coverage`, and runs ``nosetests`` with statement coverage. - The ``docs`` environment builds a virtualenv with ``python2.6``, installs :mod:`zope.hookable` and dependencies, installs ``Sphinx`` and dependencies, and then builds the docs and exercises the doctest snippets. This example requires that you have a working ``python2.6`` on your path, as well as installing ``tox``: .. code-block:: sh $ tox -e py26 GLOB sdist-make: .../zope.hookable/setup.py py26 sdist-reinst: .../zope.hookable/.tox/dist/zope.hookable-4.0.2dev.zip py26 runtests: commands[0] ... ---------------------------------------------------------------------- Ran 18 tests in 0.001s OK ___________________________________ summary ____________________________________ py26: commands succeeded congratulations :) Running ``tox`` with no arguments runs all the configured environments, including building the docs and testing their snippets: .. code-block:: sh $ tox GLOB sdist-make: .../zope.hookable/setup.py py26 sdist-reinst: .../zope.hookable/.tox/dist/zope.hookable-4.0.2dev.zip py26 runtests: commands[0] ... Doctest summary =============== 13 tests 0 failures in tests 0 failures in setup code 0 failures in cleanup code build succeeded. ___________________________________ summary ____________________________________ py26: commands succeeded py27: commands succeeded py32: commands succeeded pypy: commands succeeded coverage: commands succeeded docs: commands succeeded congratulations :) Contributing to :mod:`zope.hookable` #################################### Submitting a Bug Report ----------------------- :mod:`zope.hookable` tracks its bugs on Github: https://github.com/zopefoundation/zope.hookable/issues Please submit bug reports and feature requests there. Sharing Your Changes -------------------- .. note:: Please ensure that all tests are passing before you submit your code. If possible, your submission should include new tests for new features or bug fixes, although it is possible that you may have tested your new code by updating existing tests. If have made a change you would like to share, the best route is to fork the Githb repository, check out your fork, make your changes on a branch in your fork, and push it. You can then submit a pull request from your branch: https://github.com/zopefoundation/zope.hookable/pulls If you branched the code from Launchpad using Bazaar, you have another option: you can "push" your branch to Launchpad: .. code-block:: sh $ bzr push lp:~jrandom/zope.hookable/cool_feature After pushing your branch, you can link it to a bug report on Launchpad, or request that the maintainers merge your branch using the Launchpad "merge request" feature. zope.hookable-5.0.0/docs/index.rst0000644000175000017500000000031413562520570016100 0ustar mgmg00000000000000:mod:`zope.hookable` ==================== Contents: .. toctree:: :maxdepth: 2 narr api hacking Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` zope.hookable-5.0.0/docs/make.bat0000644000175000017500000001176413562520570015657 0ustar mgmg00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\zopehookable.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\zopehookable.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end zope.hookable-5.0.0/docs/narr.rst0000644000175000017500000000213313562520570015734 0ustar mgmg00000000000000Hookable Object Support ======================= :mod:`zope.hookable` supports the efficient creation of hookable objects, which are callable objects that are meant to be replaced by other callables, at least optionally. The idea is to create a function that does some default thing and make it hookable. Later, someone can modify what it does by calling its sethook method and changing its implementation. All users of the function, including those that imported it, will see the change. .. doctest:: >>> from zope.hookable import hookable >>> def f41(): ... return 41 >>> f = hookable(f41) >>> f.implementation is f.original True >>> f() 41 We can replace the implementation, without replacing ``f``: this means that modules which have already imported ``f`` will see the hooked version. .. doctest:: >>> old = f.sethook(lambda: 42) >>> f.implementation is f.original False >>> old is f41 True >>> f() 42 >>> f.original() 41 >>> f.implementation() 42 We can undo the hook by calling ``reset``. .. doctest:: >>> f.reset() >>> f() 41 zope.hookable-5.0.0/setup.cfg0000644000175000017500000000046113562520570015133 0ustar mgmg00000000000000[nosetests] nocapture = 1 cover-package = zope.hookable cover-erase = 1 with-doctest = 0 where = src [aliases] dev = develop easy_install zope.hookable[testing] docs = easy_install zope.hookable[docs] [bdist_wheel] universal = 0 [zest-releaser] create-wheel = no [egg_info] tag_build = tag_date = 0 zope.hookable-5.0.0/setup.py0000644000175000017500000001125613562520570015030 0ustar mgmg00000000000000############################################################################## # # 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. # ############################################################################## # This package is developed by the Zope Toolkit project, documented here: # http://docs.zope.org/zopetoolkit # When developing and releasing this package, please follow the documented # Zope Toolkit policies as described by this documentation. ############################################################################## """Setup for zope.hookable package """ import os import platform from distutils.errors import CCompilerError from distutils.errors import DistutilsExecError from distutils.errors import DistutilsPlatformError from setuptools import setup from setuptools import find_packages from setuptools import Extension from setuptools import Feature from setuptools.command.build_ext import build_ext class optional_build_ext(build_ext): """This class subclasses build_ext and allows the building of C extensions to fail. """ def run(self): try: build_ext.run(self) except DistutilsPlatformError as e: self._unavailable(e) def build_extension(self, ext): try: build_ext.build_extension(self, ext) except (CCompilerError, DistutilsExecError, OSError) as e: self._unavailable(e) def _unavailable(self, e): print('*' * 80) print("""WARNING: An optional code optimization (C extension) could not be compiled. Optimizations for this package will not be available!""") print() print(e) print('*' * 80) def read(*rnames): with open(os.path.join(os.path.dirname(__file__), *rnames)) as f: return f.read() codeoptimization = Feature( "Optional code optimizations", standard=True, ext_modules=[ Extension( "zope.hookable._zope_hookable", [os.path.join('src', 'zope', 'hookable', "_zope_hookable.c")], ), ], ) is_pypy_or_jython = platform.python_implementation() in ('PyPy', 'Jython') # Jython cannot build the C optimizations, while on PyPy they are # anti-optimizations (the C extension compatibility layer is known-slow, # and defeats JIT opportunities). if is_pypy_or_jython: features = {} else: features = {'codeoptimization': codeoptimization} TESTS_REQUIRE = [ 'zope.testing', ] setup(name='zope.hookable', version='5.0.0', url='http://github.com/zopefoundation/zope.hookable', license='ZPL 2.1', description='Zope hookable', keywords='function hook replacement loose coupled', author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', long_description=(read('README.rst') + '\n\n' + read('CHANGES.rst')), classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Zope :: 3", "Topic :: Software Development :: Libraries :: Python Modules", ], features=features, cmdclass={ 'build_ext': optional_build_ext, }, packages=find_packages('src'), package_dir={'': 'src'}, namespace_packages=['zope'], install_requires=[ 'setuptools', ], include_package_data=True, zip_safe=False, test_suite='zope.hookable.tests.test_hookable.test_suite', extras_require={ 'docs': ['Sphinx'], 'testing': TESTS_REQUIRE + ['coverage'], 'test': TESTS_REQUIRE, }, python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*', ) zope.hookable-5.0.0/src/0000755000175000017500000000000013562520570014100 5ustar mgmg00000000000000zope.hookable-5.0.0/src/zope/0000755000175000017500000000000013562520570015055 5ustar mgmg00000000000000zope.hookable-5.0.0/src/zope/__init__.py0000644000175000017500000000011313562520570017161 0ustar mgmg00000000000000__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover zope.hookable-5.0.0/src/zope/hookable/0000755000175000017500000000000013562520570016641 5ustar mgmg00000000000000zope.hookable-5.0.0/src/zope/hookable/__init__.py0000644000175000017500000000422213562520570020752 0ustar mgmg00000000000000############################################################################## # # Copyright (c) 2003 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. # ############################################################################## """Hookable object support """ import os import platform _PYPY = platform.python_implementation() in ('PyPy', 'Jython') _PURE_PYTHON = os.environ.get('PURE_PYTHON', _PYPY) class _py_hookable(object): __slots__ = ('_original', '_implementation') def __init__(self, *args, **kw): if not args and 'implementation' in kw: args = (kw.pop('implementation'),) if kw: raise TypeError('Unknown keyword arguments') if len(args) != 1: raise TypeError('Exactly one argument required') self._original = self._implementation = args[0] @property def original(self): return self._original @property def implementation(self): return self._implementation @property def __doc__(self): return self._original.__doc__ @property def __dict__(self): return getattr(self._original, '__dict__', {}) @property def __bases__(self): return getattr(self._original, '__bases__', ()) def sethook(self, new_callable): old, self._implementation = self._implementation, new_callable return old def reset(self): self._implementation = self._original def __call__(self, *args, **kw): return self._implementation(*args, **kw) try: from zope.hookable._zope_hookable import hookable as _c_hookable except ImportError: # pragma: no cover _c_hookable = None if _PURE_PYTHON or _c_hookable is None: # pragma: no cover hookable = _py_hookable else: hookable = _c_hookable zope.hookable-5.0.0/src/zope/hookable/_zope_hookable.c0000644000175000017500000001710713562520570021773 0ustar mgmg00000000000000/*############################################################################ # # Copyright (c) 2003 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. # ############################################################################*/ /* _zope_hookable.c Provide an efficient implementation for hookable objects */ #include "Python.h" #include "structmember.h" typedef struct { PyObject_HEAD PyObject *old; PyObject *implementation; } hookable; static int hookable_init(hookable *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = {"implementation", NULL}; PyObject *implementation; if (! PyArg_ParseTupleAndKeywords(args, kwds, "O:hookable", kwlist, &implementation)) return -1; Py_INCREF(implementation); Py_INCREF(implementation); Py_XDECREF(self->old); self->old = implementation; Py_XDECREF(self->implementation); self->implementation = implementation; return 0; } static int hookable_traverse(hookable *self, visitproc visit, void *arg) { if (self->implementation != NULL && visit(self->implementation, arg) < 0) return -1; if (self->old != NULL && self->old != self->implementation && visit(self->old, arg) < 0 ) return -1; return 0; } static int hookable_clear(hookable *self) { Py_XDECREF(self->old); self->old = NULL; Py_XDECREF(self->implementation); self->implementation = NULL; return 0; } static void hookable_dealloc(hookable *self) { PyObject_GC_UnTrack((PyObject *)self); Py_XDECREF(self->old); Py_XDECREF(self->implementation); Py_TYPE(self)->tp_free((PyObject*)self); } static PyObject * hookable_sethook(hookable *self, PyObject *implementation) { PyObject *old; old = self->implementation; Py_INCREF(implementation); self->implementation = implementation; if (old == NULL) { Py_INCREF(Py_None); return Py_None; } return old; } static PyObject * hookable_reset(hookable *self) { Py_XINCREF(self->old); Py_XDECREF(self->implementation); self->implementation = self->old; Py_INCREF(Py_None); return Py_None; } static struct PyMethodDef hookable_methods[] = { {"sethook", (PyCFunction)hookable_sethook, METH_O, "Set the hook implementation for the hookable object"}, {"reset", (PyCFunction)hookable_reset, METH_NOARGS, "Reset the hook to the original value"}, {NULL, NULL} /* sentinel */ }; static PyObject * hookable_call(hookable *self, PyObject *args, PyObject *kw) { if (self->implementation != NULL) return PyObject_Call(self->implementation, args, kw); PyErr_SetString(PyExc_TypeError, "Hookable has no implementation"); return NULL; } static PyObject * hookable_getattro(hookable *self, PyObject *name) { PyObject *result = NULL; const char *name_as_string; int maybe_special_name; #if PY_MAJOR_VERSION < 3 name_as_string = PyString_AsString(name); #else name_as_string = PyUnicode_AsUTF8(name); #endif if (name_as_string == NULL) { return NULL; } maybe_special_name = name_as_string[0] == '_' && name_as_string[1] == '_'; if (maybe_special_name) { /* pass through __doc__ to the original implementation */ if (strcmp("__doc__", name_as_string) == 0) { return PyObject_GetAttr(self->old, name); } /* synthesize __base__ and __dict__ if the original fails */ if (strcmp("__bases__", name_as_string) == 0) { result = PyObject_GetAttr(self->old, name); if (result == NULL) { PyErr_Clear(); result = PyTuple_New(0); } return result; } if (strcmp("__dict__", name_as_string) == 0) { result = PyObject_GetAttr(self->old, name); if (result == NULL) { PyErr_Clear(); result = PyDict_New(); } return result; } } return PyObject_GenericGetAttr((PyObject*)self, name); } static PyMemberDef hookable_members[] = { { "original", T_OBJECT_EX, offsetof(hookable, old), READONLY }, { "implementation", T_OBJECT_EX, offsetof(hookable, implementation), READONLY }, {NULL} /* Sentinel */ }; static char Hookabletype__doc__[] = "Callable objects that support being overridden" ; static PyTypeObject hookabletype = { PyVarObject_HEAD_INIT(NULL, 0) /* tp_name */ "zope.hookable." "hookable", /* tp_basicsize */ sizeof(hookable), /* tp_itemsize */ 0, /* tp_dealloc */ (destructor)&hookable_dealloc, /* tp_print */ (printfunc)0, /* tp_getattr */ (getattrfunc)0, /* tp_setattr */ (setattrfunc)0, /* tp_compare */ 0, /* tp_repr */ (reprfunc)0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ (hashfunc)0, /* tp_call */ (ternaryfunc)hookable_call, /* tp_str */ (reprfunc)0, /* tp_getattro */ (getattrofunc)hookable_getattro, /* tp_setattro */ (setattrofunc)0, /* tp_as_buffer */ 0, /* tp_flags */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_doc */ Hookabletype__doc__, /* tp_traverse */ (traverseproc)hookable_traverse, /* tp_clear */ (inquiry)hookable_clear, /* tp_richcompare */ (richcmpfunc)0, /* tp_weaklistoffset */ (long)0, /* tp_iter */ (getiterfunc)0, /* tp_iternext */ (iternextfunc)0, /* tp_methods */ hookable_methods, /* tp_members */ hookable_members, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* internal use */ /* tp_descr_get */ (descrgetfunc)0, /* tp_descr_set */ (descrsetfunc)0, /* tp_dictoffset */ 0, /* tp_init */ (initproc)hookable_init, /* tp_alloc */ (allocfunc)0, /* tp_new */ (newfunc)0 /*PyType_GenericNew*/, /* tp_free */ 0/*PyObject_GC_Del*/, }; #if PY_MAJOR_VERSION >= 3 #define MOD_ERROR_VAL NULL #define MOD_SUCCESS_VAL(val) val #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) #define MOD_DEF(ob, name, doc, methods) \ static struct PyModuleDef moduledef = { \ PyModuleDef_HEAD_INIT, name, doc, -1, methods, }; \ ob = PyModule_Create(&moduledef); #else #define MOD_ERROR_VAL #define MOD_SUCCESS_VAL(val) #define MOD_INIT(name) void init##name(void) #define MOD_DEF(ob, name, doc, methods) \ ob = Py_InitModule3(name, methods, doc); #endif static struct PyMethodDef module_methods[] = { {NULL, NULL} }; MOD_INIT(_zope_hookable) { PyObject *m; MOD_DEF(m, "_zope_hookable", "Provide an efficient implementation for hookable objects", module_methods) if (m == NULL) return MOD_ERROR_VAL; hookabletype.tp_new = PyType_GenericNew; hookabletype.tp_free = PyObject_GC_Del; if (PyType_Ready(&hookabletype) < 0) return MOD_ERROR_VAL; if (PyModule_AddObject(m, "hookable", (PyObject *)&hookabletype) < 0) return MOD_ERROR_VAL; return MOD_SUCCESS_VAL(m); } zope.hookable-5.0.0/src/zope/hookable/tests/0000755000175000017500000000000013562520570020003 5ustar mgmg00000000000000zope.hookable-5.0.0/src/zope/hookable/tests/__init__.py0000644000175000017500000000005713562520570022116 0ustar mgmg00000000000000# This line required to prevent an empty file. zope.hookable-5.0.0/src/zope/hookable/tests/test_hookable.py0000644000175000017500000001374013562520570023205 0ustar mgmg00000000000000############################################################################## # # Copyright (c) 2003 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. # ############################################################################## """Test the hookable support Extension """ import unittest def return_foo(): return 'FOO' def return_bar(): return 'BAR' def not_called(): raise AssertionError("This should not be called") class PyHookableMixin(object): def _callFUT(self, *args, **kw): from zope.hookable import _py_hookable return _py_hookable(*args, **kw) class HookableMixin(object): def _callFUT(self, *args, **kw): from zope.hookable import hookable, _py_hookable if hookable is _py_hookable: # pragma: no cover raise unittest.SkipTest("Hookable and PyHookable are the same") return hookable(*args, **kw) class PyHookableTests(PyHookableMixin, unittest.TestCase): def test_pure_python(self): from zope.hookable import _PURE_PYTHON, hookable, _py_hookable, _c_hookable self.assertIs(hookable, _py_hookable if _PURE_PYTHON else _c_hookable) def test_before_hook(self): hooked = self._callFUT(return_foo) self.assertIs(hooked.original, return_foo) self.assertIs(hooked.implementation, return_foo) self.assertEqual(hooked(), 'FOO') def test_after_hook(self): hooked = self._callFUT(not_called) old = hooked.sethook(return_bar) self.assertIs(old, not_called) self.assertIs(hooked.original, not_called) self.assertIs(hooked.implementation, return_bar) self.assertEqual(hooked(), 'BAR') def test_after_hook_and_reset(self): hooked = self._callFUT(return_foo) old = hooked.sethook(not_called) hooked.reset() self.assertIs(old, return_foo) self.assertIs(hooked.original, return_foo) self.assertIs(hooked.implementation, return_foo) self.assertEqual(hooked(), 'FOO') def test_original_cannot_be_deleted(self): hooked = self._callFUT(not_called) with self.assertRaises((TypeError, AttributeError)): del hooked.original def test_implementation_cannot_be_deleted(self): hooked = self._callFUT(not_called) with self.assertRaises((TypeError, AttributeError)): del hooked.implementation def test_no_args(self): with self.assertRaises(TypeError): self._callFUT() def test_too_many_args(self): with self.assertRaises(TypeError): self._callFUT(not_called, not_called) def test_w_implementation_kwarg(self): hooked = self._callFUT(implementation=return_foo) self.assertIs(hooked.original, return_foo) self.assertIs(hooked.implementation, return_foo) self.assertEqual(hooked(), 'FOO') def test_w_unknown_kwarg(self): with self.assertRaises(TypeError): self._callFUT(nonesuch=42) def test_class(self): class C(object): pass hooked = self._callFUT(C) self.assertIsInstance(hooked(), C) hooked.sethook(return_bar) self.assertEqual(hooked(), 'BAR') class TestIssue6Py(PyHookableMixin, unittest.TestCase): # Make sphinx docs for hooked objects work. # https://github.com/zopefoundation/zope.hookable/issues/6 # We need to proxy __doc__ to the original, # and synthesize an empty __bases__ and a __dict__ attribute # if they're not present. def _check_preserves_doc(self, docs): self.assertEqual("I have some docs", docs.__doc__) hooked = self._callFUT(docs) self.assertEqual(hooked.__doc__, docs.__doc__) def test_preserves_doc_function(self): def docs(): """I have some docs""" self._check_preserves_doc(docs) def test_preserves_doc_class(self): class Docs(object): """I have some docs""" self._check_preserves_doc(Docs) def test_empty_bases_function(self): hooked = self._callFUT(return_foo) self.assertEqual((), hooked.__bases__) def test_empty_dict_function(self): hooked = self._callFUT(return_foo) self.assertEqual({}, hooked.__dict__) def test_bases_class(self): class C(object): pass self.assertEqual(C.__bases__, (object,)) hooked = self._callFUT(C) self.assertEqual(hooked.__bases__, (object,)) def test_dict_class(self): class C(object): pass hooked = self._callFUT(C) self.assertEqual(hooked.__dict__, C.__dict__) def test_non_string_attr_name(self): # Specifically for the C implementation, which has to deal with this hooked = self._callFUT(return_foo) with self.assertRaises(TypeError): getattr(hooked, 42) with self.assertRaises(TypeError): hooked.__getattribute__(42) def test_unicode_attribute_name(self): # Specifically for the C implementation, which has to deal with this hooked = self._callFUT(return_foo) result = hooked.__getattribute__(u'__bases__') self.assertEqual(result, ()) def test_short_name(self): # Specifically for the C implementation, which has to deal with this hooked = self._callFUT(return_foo) with self.assertRaises(AttributeError): hooked.__getattribute__('') class HookableTests(HookableMixin, PyHookableTests): pass class TestIssue6(HookableMixin, TestIssue6Py): pass def test_suite(): return unittest.defaultTestLoader.loadTestsFromName(__name__) zope.hookable-5.0.0/src/zope.hookable.egg-info/0000755000175000017500000000000013562520570020332 5ustar mgmg00000000000000zope.hookable-5.0.0/src/zope.hookable.egg-info/PKG-INFO0000644000175000017500000001302713562520570021432 0ustar mgmg00000000000000Metadata-Version: 2.1 Name: zope.hookable Version: 5.0.0 Summary: Zope hookable Home-page: http://github.com/zopefoundation/zope.hookable Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: =============== zope.hookable =============== .. image:: https://img.shields.io/pypi/v/zope.hookable.svg :target: https://pypi.python.org/pypi/zope.hookable/ :alt: Latest release .. image:: https://img.shields.io/pypi/pyversions/zope.hookable.svg :target: https://pypi.org/project/zope.hookable/ :alt: Supported Python versions .. image:: https://travis-ci.org/zopefoundation/zope.hookable.svg?branch=master :target: https://travis-ci.org/zopefoundation/zope.hookable .. image:: https://readthedocs.org/projects/zopehookable/badge/?version=latest :target: https://zopehookable.readthedocs.io/en/latest/ :alt: Documentation Status .. image:: https://coveralls.io/repos/github/zopefoundation/zope.hookable/badge.svg?branch=master :target: https://coveralls.io/github/zopefoundation/zope.hookable?branch=master This package supports the efficient creation of "hookable" objects, which are callable objects that are meant to be optionally replaced. The idea is that you create a function that does some default thing and make it hookable. Later, someone can modify what it does by calling its sethook method and changing its implementation. All users of the function, including those that imported it, will see the change. Documentation is hosted at https://zopehookable.readthedocs.io ========= Changes ========= 5.0.0 (2019-11-12) ================== - Add support for Python 3.7 and 3.8. - Drop support for Python 3.4. 4.2.0 (2017-11-07) ================== - Expose the ``__doc__`` (and, where applicable, ``__bases__`` and ``__dict__``) of the hooked object. This lets Sphinx document them. See `issue 6 `_. - Respect ``PURE_PYTHON`` at runtime. At build time, always try to build the C extensions on supported platforms, but allow it to fail. See `issue 7 `_. 4.1.0 (2017-07-26) ================== - Drop support for Python 2.6, 3.2 and 3.3. - Add support for Python 3.5 and 3.6. 4.0.4 (2014-03-19) ================== - Add support for Python 3.4. 4.0.3 (2014-03-17) ================== - Update ``boostrap.py`` to version 2.2. - Fix extension compilation on Py3k. 4.0.2 (2012-12-31) ================== - Flesh out PyPI Trove classifiers. 4.0.1 (2012-11-21) ================== - Add support for Python 3.3. - Avoid building the C extension explicitly (use the "feature" indirection instead). https://bugs.launchpad.net/zope.hookable/+bug/1025470 4.0.0 (2012-06-04) ================== - Add support for PyPy. - Add support for continuous integration using ``tox`` and ``jenkins``. - Add a pure-Python reference implementation. - Move doctests to Sphinx documentation. - Bring unit test coverage to 100%. - Add 'setup.py docs' alias (installs ``Sphinx`` and dependencies). - Add 'setup.py dev' alias (runs ``setup.py develop`` plus installs ``nose`` and ``coverage``). - Drop support for Python 2.4 / 2.5. - Remove of 'zope.testing.doctestunit' in favor of stdlib's 'doctest. - Add Python 3 support. 3.4.1 (2009-04-05) ================== - Update for compatibility with Python 2.6 traceback formats. - Use Jython-compatible ``bootstrap.py``. 3.4.0 (2007-07-20) ================== - Initial release as a separate project. Keywords: function hook replacement loose coupled Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 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: docs Provides-Extra: test Provides-Extra: testing zope.hookable-5.0.0/src/zope.hookable.egg-info/SOURCES.txt0000644000175000017500000000130313562520570022213 0ustar mgmg00000000000000.coveragerc .travis.yml CHANGES.rst COPYRIGHT.txt LICENSE.txt MANIFEST.in README.rst appveyor.yml bootstrap.py buildout.cfg setup.cfg setup.py tox.ini docs/Makefile docs/api.rst docs/conf.py docs/hacking.rst docs/index.rst docs/make.bat docs/narr.rst src/zope/__init__.py src/zope.hookable.egg-info/PKG-INFO src/zope.hookable.egg-info/SOURCES.txt src/zope.hookable.egg-info/dependency_links.txt src/zope.hookable.egg-info/namespace_packages.txt src/zope.hookable.egg-info/not-zip-safe src/zope.hookable.egg-info/requires.txt src/zope.hookable.egg-info/top_level.txt src/zope/hookable/__init__.py src/zope/hookable/_zope_hookable.c src/zope/hookable/tests/__init__.py src/zope/hookable/tests/test_hookable.pyzope.hookable-5.0.0/src/zope.hookable.egg-info/dependency_links.txt0000644000175000017500000000000113562520570024400 0ustar mgmg00000000000000 zope.hookable-5.0.0/src/zope.hookable.egg-info/namespace_packages.txt0000644000175000017500000000000513562520570024660 0ustar mgmg00000000000000zope zope.hookable-5.0.0/src/zope.hookable.egg-info/not-zip-safe0000644000175000017500000000000113562520570022560 0ustar mgmg00000000000000 zope.hookable-5.0.0/src/zope.hookable.egg-info/requires.txt0000644000175000017500000000012013562520570022723 0ustar mgmg00000000000000setuptools [docs] Sphinx [test] zope.testing [testing] coverage zope.testing zope.hookable-5.0.0/src/zope.hookable.egg-info/top_level.txt0000644000175000017500000000000513562520570023057 0ustar mgmg00000000000000zope zope.hookable-5.0.0/tox.ini0000644000175000017500000000145113562520570014625 0ustar mgmg00000000000000[tox] envlist = py27,py35,py36,py37,py38,py27-pure,pypy,pypy3,coverage,docs [testenv] commands = python setup.py -q test -q sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest deps = .[test,docs] [testenv:coverage] usedevelop = true basepython = python2.7 commands = coverage run setup.py -q test -q coverage run -a -m sphinx -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest coverage report --fail-under=100 deps = {[testenv]deps} coverage [testenv:py27-pure] basepython = python2.7 setenv = PURE_PYTHON = 1 [testenv:docs] basepython = python2.7 commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest