././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7646604 zope_hookable-7.0/0000755000076500000240000000000014672221543013071 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/.manylinux-install.sh0000755000076500000240000000372314672220027017177 0ustar00jensstaff#!/usr/bin/env bash # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code set -e -x # Running inside docker # Set a cache directory for pip. This was # mounted to be the same as it is outside docker so it # can be persisted. export XDG_CACHE_HOME="/cache" # XXX: This works for macOS, where everything bind-mounted # is seen as owned by root in the container. But when the host is Linux # the actual UIDs come through to the container, triggering # pip to disable the cache when it detects that the owner doesn't match. # The below is an attempt to fix that, taken from bcrypt. It seems to work on # Github Actions. if [ -n "$GITHUB_ACTIONS" ]; then echo Adjusting pip cache permissions mkdir -p $XDG_CACHE_HOME/pip chown -R $(whoami) $XDG_CACHE_HOME fi ls -ld /cache ls -ld /cache/pip # We need some libraries because we build wheels from scratch: yum -y install libffi-devel tox_env_map() { case $1 in *"cp38"*) echo 'py38';; *"cp39"*) echo 'py39';; *"cp310"*) echo 'py310';; *"cp311"*) echo 'py311';; *"cp312"*) echo 'py312';; *"cp313"*) echo 'py313';; *) echo 'py';; esac } # Compile wheels for PYBIN in /opt/python/*/bin; do if \ [[ "${PYBIN}" == *"cp38/"* ]] || \ [[ "${PYBIN}" == *"cp39/"* ]] || \ [[ "${PYBIN}" == *"cp310/"* ]] || \ [[ "${PYBIN}" == *"cp311/"* ]] || \ [[ "${PYBIN}" == *"cp312/"* ]] || \ [[ "${PYBIN}" == *"cp313/"* ]] ; then "${PYBIN}/pip" install -e /io/ "${PYBIN}/pip" wheel /io/ -w wheelhouse/ if [ `uname -m` == 'aarch64' ]; then cd /io/ ${PYBIN}/pip install tox TOXENV=$(tox_env_map "${PYBIN}") ${PYBIN}/tox -e ${TOXENV} cd .. fi rm -rf /io/build /io/*.egg-info fi done # Bundle external shared libraries into the wheels for whl in wheelhouse/zope.hookable*.whl; do auditwheel repair "$whl" -w /io/wheelhouse/ done ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/.manylinux.sh0000755000076500000240000000077514672220027015537 0ustar00jensstaff#!/usr/bin/env bash # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code set -e -x # Mount the current directory as /io # Mount the pip cache directory as /cache # `pip cache` requires pip 20.1 echo Setting up caching python --version python -mpip --version LCACHE="$(dirname `python -mpip cache dir`)" echo Sharing pip cache at $LCACHE $(ls -ld $LCACHE) docker run --rm -e GITHUB_ACTIONS -v "$(pwd)":/io -v "$LCACHE:/cache" $DOCKER_IMAGE $PRE_CMD /io/.manylinux-install.sh ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/.pre-commit-config.yaml0000644000076500000240000000132214672220027017344 0ustar00jensstaff# Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code minimum_pre_commit_version: '3.6' repos: - repo: https://github.com/pycqa/isort rev: "5.13.2" hooks: - id: isort - repo: https://github.com/hhatto/autopep8 rev: "v2.3.1" hooks: - id: autopep8 args: [--in-place, --aggressive, --aggressive] - repo: https://github.com/asottile/pyupgrade rev: v3.17.0 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/isidentical/teyit rev: 0.4.3 hooks: - id: teyit - repo: https://github.com/PyCQA/flake8 rev: "7.1.1" hooks: - id: flake8 additional_dependencies: - flake8-debugger == 4.1.2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/.readthedocs.yaml0000644000076500000240000000123014672220027016310 0ustar00jensstaff# Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 # Set the version of Python and other tools you might need build: os: ubuntu-22.04 tools: python: "3.11" # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/conf.py # We recommend specifying your dependencies to enable reproducible builds: # https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html python: install: - requirements: docs/requirements.txt - method: pip path: . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554209.0 zope_hookable-7.0/CHANGES.rst0000644000076500000240000000614714672220141014674 0ustar00jensstaff========= Changes ========= 7.0 (2024-09-17) ================ - C extension now enables multi-phase module initialization (PEP 489). For CPython >= 3.11, the ``hookable`` type is now a heap-allocated type. See: https://docs.python.org/3.13/howto/isolating-extensions.html - Drop support for Python 3.7. - Add support for Python 3.13. - Build windows wheels on GHA. 6.0 (2023-10-05) ================ - Drop support for Python 2.7, 3.5, 3.6. - Add support for Python 3.12. 5.4 (2022-11-17) ================ - Add support for building arm64 wheels on macOS. 5.3 (2022-11-03) ================ - Add support for the final release of Python 3.11. 5.2 (2022-09-13) ================ - Add support for Python 3.10 and 3.11 (as of 3.11.0rc1). - Disable unsafe math optimizations in C code. See `pull request 25 `_. 5.1.0 (2021-07-20) ================== - Add support for Python 3.9. - Create Linux aarch64 wheels. 5.0.1 (2020-03-10) ================== - Stop using the setuptools ``Feature`` class, allowing this project to be built from source with newer versions of setuptools that remove that functionality. 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/CONTRIBUTING.md0000644000076500000240000000143714672220027015323 0ustar00jensstaff # Contributing to zopefoundation projects The projects under the zopefoundation GitHub organization are open source and welcome contributions in different forms: * bug reports * code improvements and bug fixes * documentation improvements * pull request reviews For any changes in the repository besides trivial typo fixes you are required to sign the contributor agreement. See https://www.zope.dev/developer/becoming-a-committer.html for details. Please visit our [Developer Guidelines](https://www.zope.dev/developer/guidelines.html) if you'd like to contribute code changes and our [guidelines for reporting bugs](https://www.zope.dev/developer/reporting-bugs.html) if you want to file a bug report. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/COPYRIGHT.txt0000644000076500000240000000004014330750131015163 0ustar00jensstaffZope Foundation and Contributors././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/LICENSE.txt0000644000076500000240000000402614330750131014705 0ustar00jensstaffZope 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/MANIFEST.in0000644000076500000240000000061714672220027014627 0ustar00jensstaff# Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code include *.md include *.rst include *.txt include buildout.cfg include tox.ini include .pre-commit-config.yaml recursive-include docs *.py recursive-include docs *.rst recursive-include docs *.txt recursive-include docs Makefile recursive-include src *.py include *.yaml include *.sh recursive-include docs *.bat ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7645938 zope_hookable-7.0/PKG-INFO0000644000076500000240000001403014672221543014164 0ustar00jensstaffMetadata-Version: 2.1 Name: zope.hookable Version: 7.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 Keywords: function hook replacement loose coupled 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 :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 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: >=3.8 License-File: LICENSE.txt Requires-Dist: setuptools Provides-Extra: docs Requires-Dist: Sphinx; extra == "docs" Requires-Dist: sphinx_rtd_theme; extra == "docs" Provides-Extra: testing Requires-Dist: zope.testing; extra == "testing" Requires-Dist: zope.testrunner; extra == "testing" Requires-Dist: coverage; extra == "testing" Provides-Extra: test Requires-Dist: zope.testing; extra == "test" Requires-Dist: zope.testrunner; extra == "test" =============== 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://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml/badge.svg :target: https://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml .. 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 ========= 7.0 (2024-09-17) ================ - C extension now enables multi-phase module initialization (PEP 489). For CPython >= 3.11, the ``hookable`` type is now a heap-allocated type. See: https://docs.python.org/3.13/howto/isolating-extensions.html - Drop support for Python 3.7. - Add support for Python 3.13. - Build windows wheels on GHA. 6.0 (2023-10-05) ================ - Drop support for Python 2.7, 3.5, 3.6. - Add support for Python 3.12. 5.4 (2022-11-17) ================ - Add support for building arm64 wheels on macOS. 5.3 (2022-11-03) ================ - Add support for the final release of Python 3.11. 5.2 (2022-09-13) ================ - Add support for Python 3.10 and 3.11 (as of 3.11.0rc1). - Disable unsafe math optimizations in C code. See `pull request 25 `_. 5.1.0 (2021-07-20) ================== - Add support for Python 3.9. - Create Linux aarch64 wheels. 5.0.1 (2020-03-10) ================== - Stop using the setuptools ``Feature`` class, allowing this project to be built from source with newer versions of setuptools that remove that functionality. 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/README.rst0000644000076500000240000000256714330750131014561 0ustar00jensstaff=============== 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://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml/badge.svg :target: https://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml .. 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/buildout.cfg0000644000076500000240000000013714330750131015371 0ustar00jensstaff[buildout] develop = . parts = test [test] recipe = zc.recipe.testrunner eggs = zope.hookable ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7618623 zope_hookable-7.0/docs/0000755000076500000240000000000014672221543014021 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/Makefile0000644000076500000240000001272414330750131015456 0ustar00jensstaff# 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." ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7584016 zope_hookable-7.0/docs/_build/0000755000076500000240000000000014672221543015257 5ustar00jensstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7619817 zope_hookable-7.0/docs/_build/doctest/0000755000076500000240000000000014672221543016724 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554176.0 zope_hookable-7.0/docs/_build/doctest/output.txt0000644000076500000240000000056614672220100021020 0ustar00jensstaffResults of doctest builder run on 2024-09-17 08:22:56 ===================================================== Document: narr -------------- 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 0 failures in cleanup code ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7584584 zope_hookable-7.0/docs/_build/html/0000755000076500000240000000000014672221543016223 5ustar00jensstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7624657 zope_hookable-7.0/docs/_build/html/_sources/0000755000076500000240000000000014672221543020045 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/_build/html/_sources/api.rst.txt0000644000076500000240000000013614330750131022155 0ustar00jensstaff:mod:`zope.hookable` API ======================== .. automodule:: zope.hookable :members: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1696497133.0 zope_hookable-7.0/docs/_build/html/_sources/hacking.rst.txt0000644000076500000240000000561514507476755023046 0ustar00jensstaffHacking 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 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 defined Python environments build a ``virtualenv/venv``, install :mod:`zope.hookable` and dependencies, and run the tests via ``zope.testrunner`` There are environments both for with and without using the C code extension. - The ``coverage`` environment builds a ``virtualenv``, installs :mod:`zope.hookable` and dependencies, installs :mod:`coverage`, and runs the tests with coverage. - The ``docs`` environment builds a virtualenv 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 ``python3.11`` on your path, as well as an installed ``tox``: .. code-block:: sh $ tox -e py311 Running ``tox`` with no arguments runs all the configured environments, including building the docs and testing their snippets: .. code-block:: sh $ tox To run the tests in parallel use: .. code-block:: sh $ tox -p auto To see the coverage output: .. code-block:: sh $ tox -e coverage Building the documentation -------------------------- :mod:`zope.hookable` uses the nifty :mod:`Sphinx` documentation system for building its docs. .. code-block:: sh $ tox -e docs It also tests the code snippets in the documentation. 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 -------------------- If have made a change you would like to share, the best route is to fork the GitHub 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/_build/html/_sources/index.rst.txt0000644000076500000240000000031414330750131022511 0ustar00jensstaff:mod:`zope.hookable` ==================== Contents: .. toctree:: :maxdepth: 2 narr api hacking Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/_build/html/_sources/narr.rst.txt0000644000076500000240000000213314330750131022345 0ustar00jensstaffHookable 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/api.rst0000644000076500000240000000013614330750131015313 0ustar00jensstaff:mod:`zope.hookable` API ======================== .. automodule:: zope.hookable :members: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726467015.0 zope_hookable-7.0/docs/conf.py0000644000076500000240000000235114671745707015335 0ustar00jensstaff# Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import datetime # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information year = datetime.datetime.now().year project = 'zope.hookable' copyright = f'2012-{year}, Zope Foundation and contributors' author = 'Zope Foundation and contributors' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', ] templates_path = ['_templates'] exclude_patterns = [] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'python': ('https://docs.python.org/3/', None)} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1696497133.0 zope_hookable-7.0/docs/hacking.rst0000644000076500000240000000561514507476755016204 0ustar00jensstaffHacking 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 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 defined Python environments build a ``virtualenv/venv``, install :mod:`zope.hookable` and dependencies, and run the tests via ``zope.testrunner`` There are environments both for with and without using the C code extension. - The ``coverage`` environment builds a ``virtualenv``, installs :mod:`zope.hookable` and dependencies, installs :mod:`coverage`, and runs the tests with coverage. - The ``docs`` environment builds a virtualenv 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 ``python3.11`` on your path, as well as an installed ``tox``: .. code-block:: sh $ tox -e py311 Running ``tox`` with no arguments runs all the configured environments, including building the docs and testing their snippets: .. code-block:: sh $ tox To run the tests in parallel use: .. code-block:: sh $ tox -p auto To see the coverage output: .. code-block:: sh $ tox -e coverage Building the documentation -------------------------- :mod:`zope.hookable` uses the nifty :mod:`Sphinx` documentation system for building its docs. .. code-block:: sh $ tox -e docs It also tests the code snippets in the documentation. 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 -------------------- If have made a change you would like to share, the best route is to fork the GitHub 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/index.rst0000644000076500000240000000031414330750131015647 0ustar00jensstaff:mod:`zope.hookable` ==================== Contents: .. toctree:: :maxdepth: 2 narr api hacking Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/make.bat0000644000076500000240000001176414330750131015426 0ustar00jensstaff@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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/docs/narr.rst0000644000076500000240000000213314330750131015503 0ustar00jensstaffHookable 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1696507548.0 zope_hookable-7.0/docs/requirements.txt0000644000076500000240000000005014507523234017277 0ustar00jensstaffSphinx sphinx_rtd_theme>1 docutils<0.19 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/pyproject.toml0000644000076500000240000000130314672220027015776 0ustar00jensstaff# # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code [build-system] requires = ["setuptools<74"] build-backend = "setuptools.build_meta" [tool.coverage.run] branch = true source = ["zope.hookable"] relative_files = true [tool.coverage.report] fail_under = 98 precision = 2 ignore_errors = true show_missing = true exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"] [tool.coverage.html] directory = "parts/htmlcov" [tool.coverage.paths] source = ["src/", ".tox/*/lib/python*/site-packages/", ".tox/pypy*/site-packages/"] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7648804 zope_hookable-7.0/setup.cfg0000644000076500000240000000073414672221543014716 0ustar00jensstaff[zest.releaser] create-wheel = no [flake8] doctests = 1 [check-manifest] ignore = .editorconfig .meta.toml docs/_build/html/_sources/* docs/_build/doctest/* [isort] force_single_line = True combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER known_third_party = docutils, pkg_resources, pytz known_zope = known_first_party = default_section = ZOPE line_length = 79 lines_after_imports = 2 [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554222.0 zope_hookable-7.0/setup.py0000644000076500000240000001075214672220156014607 0ustar00jensstaff############################################################################## # # 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 Extension from setuptools import find_packages from setuptools import setup 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 = [ 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: ext_modules = {} else: ext_modules = codeoptimization TESTS_REQUIRE = [ 'zope.testing', 'zope.testrunner', ] setup(name='zope.hookable', version='7.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 :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Zope :: 3", "Topic :: Software Development :: Libraries :: Python Modules", ], ext_modules=ext_modules, 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, extras_require={ 'docs': ['Sphinx', 'sphinx_rtd_theme'], 'testing': TESTS_REQUIRE + ['coverage'], 'test': TESTS_REQUIRE, }, python_requires='>=3.8', ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7586656 zope_hookable-7.0/src/0000755000076500000240000000000014672221543013660 5ustar00jensstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7625885 zope_hookable-7.0/src/zope/0000755000076500000240000000000014672221543014635 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/src/zope/__init__.py0000644000076500000240000000011414330750131016731 0ustar00jensstaff__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7636578 zope_hookable-7.0/src/zope/hookable/0000755000076500000240000000000014672221543016421 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1718203015.0 zope_hookable-7.0/src/zope/hookable/__init__.py0000644000076500000240000000462414632331207020533 0ustar00jensstaff############################################################################## # # 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 # Keep these two flags separate: we want the `_PURE_PYTHON` one # to represent that the flag is explicitly set to '1' in the environment, # since our 'tox.ini' sets it to '0' for its environments which expect # to test the C extension. _PYPY_OR_JAVA = platform.python_implementation() in ('PyPy', 'Jython') _PURE_PYTHON = os.environ.get('PURE_PYTHON') == '1' class _py_hookable: __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 _PYPY_OR_JAVA or _PURE_PYTHON or _c_hookable is None: hookable = _py_hookable else: # pragma: no cover hookable = _c_hookable ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1718203015.0 zope_hookable-7.0/src/zope/hookable/_zope_hookable.c0000644000076500000240000001643414632331207021550 0ustar00jensstaff/*############################################################################ # # 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. # ############################################################################*/ static char module__doc__[] = ( "Provide an efficient implementation for hookable objects" ); #include "Python.h" #include "structmember.h" typedef struct { PyObject_HEAD PyObject* original; 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; /* Both 'self->original' and 'self->implementation' are originally * set to the passed-in 'implementation', hence the need for * two increfs. */ Py_INCREF(implementation); Py_XDECREF(self->original); self->original = implementation; Py_INCREF(implementation); Py_XDECREF(self->implementation); self->implementation = implementation; return 0; } static int hookable_traverse(hookable* self, visitproc visit, void* arg) { #if PY_VERSION_HEX >= 0x03090000 Py_VISIT(Py_TYPE(self)); #endif Py_VISIT(self->implementation); Py_VISIT(self->original); return 0; } static int hookable_clear(hookable* self) { Py_XDECREF(self->original); self->original = NULL; Py_XDECREF(self->implementation); self->implementation = NULL; return 0; } static void hookable_dealloc(hookable* self) { PyObject_GC_UnTrack((PyObject*)self); PyTypeObject* tp = Py_TYPE(self); Py_XDECREF(self->original); Py_XDECREF(self->implementation); tp->tp_free((PyObject*)self); /* heap types must decref their type when dealloc'ed */ Py_DECREF(tp); } 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; name_as_string = PyUnicode_AsUTF8(name); 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->original, name); } /* synthesize __bases__ and __dict__ if the original fails */ if (strcmp("__bases__", name_as_string) == 0) { result = PyObject_GetAttr(self->original, name); if (result == NULL) { PyErr_Clear(); result = PyTuple_New(0); } return result; } if (strcmp("__dict__", name_as_string) == 0) { result = PyObject_GetAttr(self->original, name); if (result == NULL) { PyErr_Clear(); result = PyDict_New(); } return result; } } return PyObject_GenericGetAttr((PyObject*)self, name); } static char hookable_sethook__doc__[] = ( "Set the hook implementation for the hookable object\n\n" "Return the previous hook implementation, or None." ); static PyObject* hookable_sethook(hookable* self, PyObject* implementation) { PyObject* current; current = self->implementation; Py_INCREF(implementation); self->implementation = implementation; if (current == NULL) { Py_INCREF(Py_None); return Py_None; } return current; } static char hookable_reset__doc__[] = ( "Reset the hook to the original value" ); static PyObject* hookable_reset(hookable* self) { Py_XINCREF(self->original); Py_XDECREF(self->implementation); self->implementation = self->original; Py_INCREF(Py_None); return Py_None; } static struct PyMethodDef hookable_methods[] = { { "sethook", (PyCFunction)hookable_sethook, METH_O, hookable_sethook__doc__ }, { "reset", (PyCFunction)hookable_reset, METH_NOARGS, hookable_reset__doc__}, { NULL, NULL } /* sentinel */ }; static PyMemberDef hookable_members[] = { { "original", T_OBJECT_EX, offsetof(hookable, original), READONLY }, { "implementation", T_OBJECT_EX, offsetof(hookable, implementation), READONLY }, { NULL } /* Sentinel */ }; static char hookable__name__[] = "zope.hookable.hookable"; static char hookable__doc__[] = "Callable objects that support being overridden"; /* * Heap type: hookable */ static PyType_Slot hookable_type_slots[] = { {Py_tp_doc, hookable__doc__}, {Py_tp_init, hookable_init}, {Py_tp_call, hookable_call}, {Py_tp_getattro, hookable_getattro}, {Py_tp_traverse, hookable_traverse}, {Py_tp_clear, hookable_clear}, {Py_tp_dealloc, hookable_dealloc}, {Py_tp_members, hookable_members}, {Py_tp_methods, hookable_methods}, {0, NULL} }; static PyType_Spec hookable_type_spec = { .name = hookable__name__, .basicsize = sizeof(hookable), .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | #if PY_VERSION_HEX >= 0x030c0000 Py_TPFLAGS_MANAGED_WEAKREF | #endif Py_TPFLAGS_HAVE_GC, .slots = hookable_type_slots }; /* * Module initialization */ static struct PyMethodDef hookable_module_methods[] = { { NULL, NULL } /* sentinel */ }; /* Handler for the 'execute' phase of multi-phase initialization * * See: https://docs.python.org/3/c-api/module.html#multi-phase-initialization * and: https://peps.python.org/pep-0489/#module-execution-phase */ static int hookable_module_exec(PyObject* module) { PyObject* hookable_type; hookable_type = PyType_FromSpec(&hookable_type_spec); if (hookable_type == NULL) { return -1; } if (PyModule_AddObject(module, "hookable", hookable_type) < 0) return -1; return 0; } /* Slot definitions for multi-phase initialization * * See: https://docs.python.org/3/c-api/module.html#multi-phase-initialization * and: https://peps.python.org/pep-0489 */ static PyModuleDef_Slot hookable_module_slots[] = { {Py_mod_exec, hookable_module_exec}, {0, NULL} }; static struct PyModuleDef hookable_module_def = { PyModuleDef_HEAD_INIT, .m_name = "_zope_hookable", .m_doc = module__doc__, .m_methods = hookable_module_methods, .m_slots = hookable_module_slots }; static PyObject* init(void) { return PyModuleDef_Init(&hookable_module_def); } PyMODINIT_FUNC PyInit__zope_hookable(void) { return init(); } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1726554978.764019 zope_hookable-7.0/src/zope/hookable/tests/0000755000076500000240000000000014672221543017563 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/src/zope/hookable/tests/__init__.py0000644000076500000240000000005714330750131021665 0ustar00jensstaff# This line required to prevent an empty file. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485785.0 zope_hookable-7.0/src/zope/hookable/tests/test_compile_flags.py0000644000076500000240000000241114330750131023765 0ustar00jensstaff############################################################################## # # Copyright (c) 2022 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 # ############################################################################## import struct import unittest import zope.hookable # noqa: try to load a C module for side effects class TestFloatingPoint(unittest.TestCase): def test_no_fast_math_optimization(self): # Building with -Ofast enables -ffast-math, which sets certain FPU # flags that can cause breakage elsewhere. A library such as BTrees # has no business changing global FPU flags for the entire process. zero_bits = struct.unpack("!Q", struct.pack("!d", 0.0))[0] next_up = zero_bits + 1 smallest_subnormal = struct.unpack("!d", struct.pack("!Q", next_up))[0] self.assertNotEqual(smallest_subnormal, 0.0) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1718203015.0 zope_hookable-7.0/src/zope/hookable/tests/test_hookable.py0000644000076500000240000001427214632331207022761 0ustar00jensstaff############################################################################## # # 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: def _callFUT(self, *args, **kw): from zope.hookable import _py_hookable return _py_hookable(*args, **kw) class HookableMixin: def _callFUT(self, *args, **kw): from zope.hookable import _py_hookable from zope.hookable import hookable if hookable is _py_hookable: raise unittest.SkipTest("Hookable and PyHookable are the same") return hookable(*args, **kw) # pragma: no cover class PyHookableTests(PyHookableMixin, unittest.TestCase): def test_pure_python(self): from zope.hookable import _PURE_PYTHON from zope.hookable import _PYPY_OR_JAVA from zope.hookable import _c_hookable from zope.hookable import _py_hookable from zope.hookable import hookable if _PYPY_OR_JAVA or _PURE_PYTHON: self.assertIs(hookable, _py_hookable) else: self.assertIs(hookable, _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: 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: """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: pass self.assertEqual(C.__bases__, (object,)) hooked = self._callFUT(C) self.assertEqual(hooked.__bases__, (object,)) def test_dict_class(self): class C: 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__('__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__) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1726554978.7641697 zope_hookable-7.0/src/zope.hookable.egg-info/0000755000076500000240000000000014672221543020112 5ustar00jensstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554978.0 zope_hookable-7.0/src/zope.hookable.egg-info/PKG-INFO0000644000076500000240000001403014672221542021204 0ustar00jensstaffMetadata-Version: 2.1 Name: zope.hookable Version: 7.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 Keywords: function hook replacement loose coupled 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 :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 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: >=3.8 License-File: LICENSE.txt Requires-Dist: setuptools Provides-Extra: docs Requires-Dist: Sphinx; extra == "docs" Requires-Dist: sphinx_rtd_theme; extra == "docs" Provides-Extra: testing Requires-Dist: zope.testing; extra == "testing" Requires-Dist: zope.testrunner; extra == "testing" Requires-Dist: coverage; extra == "testing" Provides-Extra: test Requires-Dist: zope.testing; extra == "test" Requires-Dist: zope.testrunner; extra == "test" =============== 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://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml/badge.svg :target: https://github.com/zopefoundation/zope.hookable/actions/workflows/tests.yml .. 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 ========= 7.0 (2024-09-17) ================ - C extension now enables multi-phase module initialization (PEP 489). For CPython >= 3.11, the ``hookable`` type is now a heap-allocated type. See: https://docs.python.org/3.13/howto/isolating-extensions.html - Drop support for Python 3.7. - Add support for Python 3.13. - Build windows wheels on GHA. 6.0 (2023-10-05) ================ - Drop support for Python 2.7, 3.5, 3.6. - Add support for Python 3.12. 5.4 (2022-11-17) ================ - Add support for building arm64 wheels on macOS. 5.3 (2022-11-03) ================ - Add support for the final release of Python 3.11. 5.2 (2022-09-13) ================ - Add support for Python 3.10 and 3.11 (as of 3.11.0rc1). - Disable unsafe math optimizations in C code. See `pull request 25 `_. 5.1.0 (2021-07-20) ================== - Add support for Python 3.9. - Create Linux aarch64 wheels. 5.0.1 (2020-03-10) ================== - Stop using the setuptools ``Feature`` class, allowing this project to be built from source with newer versions of setuptools that remove that functionality. 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554978.0 zope_hookable-7.0/src/zope.hookable.egg-info/SOURCES.txt0000644000076500000240000000200014672221542021765 0ustar00jensstaff.manylinux-install.sh .manylinux.sh .pre-commit-config.yaml .readthedocs.yaml CHANGES.rst CONTRIBUTING.md COPYRIGHT.txt LICENSE.txt MANIFEST.in README.rst buildout.cfg pyproject.toml 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 docs/requirements.txt docs/_build/doctest/output.txt docs/_build/html/_sources/api.rst.txt docs/_build/html/_sources/hacking.rst.txt docs/_build/html/_sources/index.rst.txt docs/_build/html/_sources/narr.rst.txt 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_compile_flags.py src/zope/hookable/tests/test_hookable.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554978.0 zope_hookable-7.0/src/zope.hookable.egg-info/dependency_links.txt0000644000076500000240000000000114672221542024157 0ustar00jensstaff ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554978.0 zope_hookable-7.0/src/zope.hookable.egg-info/namespace_packages.txt0000644000076500000240000000000514672221542024437 0ustar00jensstaffzope ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1667485917.0 zope_hookable-7.0/src/zope.hookable.egg-info/not-zip-safe0000644000076500000240000000000114330750335022335 0ustar00jensstaff ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554978.0 zope_hookable-7.0/src/zope.hookable.egg-info/requires.txt0000644000076500000240000000020114672221542022502 0ustar00jensstaffsetuptools [docs] Sphinx sphinx_rtd_theme [test] zope.testing zope.testrunner [testing] zope.testing zope.testrunner coverage ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554978.0 zope_hookable-7.0/src/zope.hookable.egg-info/top_level.txt0000644000076500000240000000000514672221542022636 0ustar00jensstaffzope ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726554135.0 zope_hookable-7.0/tox.ini0000644000076500000240000000374514672220027014411 0ustar00jensstaff# Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code [tox] minversion = 4.0 envlist = lint py38,py38-pure py39,py39-pure py310,py310-pure py311,py311-pure py312,py312-pure py313,py313-pure pypy3 docs coverage [testenv] deps = setuptools <74 setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 commands = zope-testrunner --test-path=src {posargs:-vc} sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest extras = test docs [testenv:setuptools-latest] basepython = python3 deps = git+https://github.com/pypa/setuptools.git\#egg=setuptools [testenv:coverage] basepython = python3 allowlist_externals = mkdir deps = coverage[toml] setenv = PURE_PYTHON=1 commands = mkdir -p {toxinidir}/parts/htmlcov coverage run -m zope.testrunner --test-path=src {posargs:-vc} python -c 'import os, subprocess; subprocess.check_call("coverage run -a -m zope.testrunner --test-path=src", env=dict(os.environ, PURE_PYTHON="0"), shell=True)' coverage html coverage report [testenv:release-check] description = ensure that the distribution is ready to release basepython = python3 skip_install = true deps = setuptools <74 twine build check-manifest check-python-versions >= 0.20.0 wheel commands_pre = commands = check-manifest check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml python -m build --sdist --no-isolation twine check dist/* [testenv:lint] description = This env runs all linters configured in .pre-commit-config.yaml basepython = python3 skip_install = true deps = pre-commit commands_pre = commands = pre-commit run --all-files --show-diff-on-failure [testenv:docs] basepython = python3 skip_install = false commands_pre = 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