Commit d910bf43 authored by TANIGUCHI Takaki's avatar TANIGUCHI Takaki

New upstream version 4.3.0

parent 616cdf15
.coverage
*.egg-info
__pycache__
.tox
nosetests.xml
coverage.xml
_build
[run]
source = zope.deprecation
omit =
*old_location.py
*/new_package/*
*/old_package/*
[report]
exclude_lines =
pragma: no cover
if __name__ == '__main__':
raise NotImplementedError
*.pyc
*.egg-info
__pycache__
_build
docs/_build
.tox
.coverage
nosetests.xml
coverage.xml
.installed.cfg
bin
develop-eggs
eggs
language: python
sudo: false
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- pypy
- pypy3
install:
- pip install .
- 2.7
- 3.4
- 3.5
- 3.6
- pypy-5.6.0
- pypy3.5-5.8.0
script:
- python setup.py test -q
- coverage run -m zope.testrunner --test-path=src
- coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest
after_success:
- coveralls
notifications:
email: false
email: false
install:
- pip install -U pip setuptools
- pip install -U coveralls coverage
- pip install -U -e ".[test,docs]"
cache: pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
``zope.deprecation`` Changelog
==============================
================================
``zope.deprecation`` Changelog
================================
4.3.0 (2017-08-07)
==================
- Allow custom warning classes to be specified to override the default
``DeprecationWarning``.
See https://github.com/zopefoundation/zope.deprecation/pull/7
- Add support for Python 3.6.
- Drop support for Python 3.3.
4.2.0 (2016-11-07)
==================
- Drop support for Python 2.6 and 3.2.
- Add support for Python 3.5.
4.1.2 (2015-01-13)
------------------
==================
- Do not require a ``self`` parameter for deprecated functions. See:
https://github.com/zopefoundation/zope.deprecation/pull/1
4.1.1 (2014-03-19)
------------------
==================
- Added explicit support for Python 3.4.
4.1.0 (2013-12-20)
------------------
==================
- Added a ``Suppressor`` context manager, allowing scoped suppression of
deprecation warnings.
......@@ -21,17 +40,17 @@
- Updated ``boostrap.py`` to version 2.2.
4.0.2 (2012-12-31)
------------------
==================
- Fleshed out PyPI Trove classifiers.
4.0.1 (2012-11-21)
------------------
==================
- Added support for Python 3.3.
4.0.0 (2012-05-16)
------------------
==================
- Automated build of Sphinx HTML docs and running doctest snippets via tox.
......@@ -56,13 +75,13 @@
3.5.1 (2012-03-15)
------------------
==================
- Revert a move of `README.txt` to unbreak ``zope.app.apidoc``.
3.5.0 (2011-09-05)
------------------
==================
- Replaced doctesting with unit testing.
......@@ -70,7 +89,7 @@
3.4.1 (2011-06-07)
------------------
==================
- Removed import cycle for ``__show__`` by defining it in the
``zope.deprecation.deprecation`` module.
......@@ -82,13 +101,13 @@
3.4.0 (2007-07-19)
------------------
==================
- Release 3.4 final, corresponding to Zope 3.4.
3.3.0 (2007-02-18)
------------------
==================
- Corresponds to the version of the ``zope.deprecation`` package shipped as
part of the Zope 3.3.0 release.
include *.rst
include *.txt
include .coveragerc
include tox.ini
include .travis.yml
include bootstrap.py
include buildout.cfg
recursive-include docs *
recursive-include src *
global-exclude *.dll
global-exclude *.pyc
global-exclude *.pyo
global-exclude *.so
Metadata-Version: 1.1
Name: zope.deprecation
Version: 4.1.2
Version: 4.3.0
Summary: Zope Deprecation Infrastructure
Home-page: http://pypi.python.org/pypi/zope.deprecation
Home-page: http://github.com/zopefoundation/zope.deprecation
Author: Zope Corporation and Contributors
Author-email: zope-dev@zope.org
License: ZPL 2.1
Description: ``zope.deprecation``
====================
Description: ======================
``zope.deprecation``
======================
.. image:: https://img.shields.io/pypi/v/zope.deprecation.svg
:target: https://pypi.python.org/pypi/zope.deprecation/
:alt: Latest release
.. image:: https://img.shields.io/pypi/pyversions/zope.deprecation.svg
:target: https://pypi.org/project/zope.deprecation/
:alt: Supported Python versions
.. image:: https://travis-ci.org/zopefoundation/zope.deprecation.png?branch=master
:target: https://travis-ci.org/zopefoundation/zope.deprecation
.. image:: https://coveralls.io/repos/github/zopefoundation/zope.deprecation/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/zope.deprecation?branch=master
.. image:: https://readthedocs.org/projects/zopedeprecation/badge/?version=latest
:target: httpl://zopedeprecation.readthedocs.io/en/latest/
:alt: Documentation Status
This package provides a simple function called ``deprecated(names, reason)``
to mark deprecated modules, classes, functions, methods and properties.
Please see http://docs.zope.org/zope.deprecation/ for the documentation.
Please see https://zopedeprecation.readthedocs.io for the documentation.
================================
``zope.deprecation`` Changelog
================================
4.3.0 (2017-08-07)
==================
- Allow custom warning classes to be specified to override the default
``DeprecationWarning``.
See https://github.com/zopefoundation/zope.deprecation/pull/7
- Add support for Python 3.6.
- Drop support for Python 3.3.
4.2.0 (2016-11-07)
==================
- Drop support for Python 2.6 and 3.2.
``zope.deprecation`` Changelog
==============================
- Add support for Python 3.5.
4.1.2 (2015-01-13)
------------------
==================
- Do not require a ``self`` parameter for deprecated functions. See:
https://github.com/zopefoundation/zope.deprecation/pull/1
4.1.1 (2014-03-19)
------------------
==================
- Added explicit support for Python 3.4.
4.1.0 (2013-12-20)
------------------
==================
- Added a ``Suppressor`` context manager, allowing scoped suppression of
deprecation warnings.
......@@ -42,17 +77,17 @@ Description: ``zope.deprecation``
- Updated ``boostrap.py`` to version 2.2.
4.0.2 (2012-12-31)
------------------
==================
- Fleshed out PyPI Trove classifiers.
4.0.1 (2012-11-21)
------------------
==================
- Added support for Python 3.3.
4.0.0 (2012-05-16)
------------------
==================
- Automated build of Sphinx HTML docs and running doctest snippets via tox.
......@@ -77,13 +112,13 @@ Description: ``zope.deprecation``
3.5.1 (2012-03-15)
------------------
==================
- Revert a move of `README.txt` to unbreak ``zope.app.apidoc``.
3.5.0 (2011-09-05)
------------------
==================
- Replaced doctesting with unit testing.
......@@ -91,7 +126,7 @@ Description: ``zope.deprecation``
3.4.1 (2011-06-07)
------------------
==================
- Removed import cycle for ``__show__`` by defining it in the
``zope.deprecation.deprecation`` module.
......@@ -103,27 +138,27 @@ Description: ``zope.deprecation``
3.4.0 (2007-07-19)
------------------
==================
- Release 3.4 final, corresponding to Zope 3.4.
3.3.0 (2007-02-18)
------------------
==================
- Corresponds to the version of the ``zope.deprecation`` package shipped as
part of the Zope 3.3.0 release.
Keywords: deprecation,deprecated,warning
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Framework :: Zope3
``zope.deprecation``
====================
======================
``zope.deprecation``
======================
.. image:: https://img.shields.io/pypi/v/zope.deprecation.svg
:target: https://pypi.python.org/pypi/zope.deprecation/
:alt: Latest release
.. image:: https://img.shields.io/pypi/pyversions/zope.deprecation.svg
:target: https://pypi.org/project/zope.deprecation/
:alt: Supported Python versions
.. image:: https://travis-ci.org/zopefoundation/zope.deprecation.png?branch=master
:target: https://travis-ci.org/zopefoundation/zope.deprecation
.. image:: https://coveralls.io/repos/github/zopefoundation/zope.deprecation/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/zope.deprecation?branch=master
.. image:: https://readthedocs.org/projects/zopedeprecation/badge/?version=latest
:target: httpl://zopedeprecation.readthedocs.io/en/latest/
:alt: Documentation Status
This package provides a simple function called ``deprecated(names, reason)``
to mark deprecated modules, classes, functions, methods and properties.
Please see http://docs.zope.org/zope.deprecation/ for the documentation.
Please see https://zopedeprecation.readthedocs.io for the documentation.
......@@ -25,7 +25,10 @@ import tempfile
from optparse import OptionParser
tmpeggs = tempfile.mkdtemp()
__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]
......@@ -40,8 +43,9 @@ this script from going over the network.
'''
parser = OptionParser(usage=usage)
parser.add_option("-v", "--version", help="use a specific zc.buildout version")
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,
......@@ -59,25 +63,33 @@ parser.add_option("-f", "--find-links",
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")
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:
if options.allow_site_packages:
import setuptools
import pkg_resources
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
ez = {}
exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), 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
......@@ -88,12 +100,19 @@ if not options.allow_site_packages:
# We can't remove these reliably
if hasattr(site, 'getsitepackages'):
for sitepackage_path in site.getsitepackages():
sys.path[:] = [x for x in sys.path if sitepackage_path not in x]
# 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
......@@ -110,7 +129,12 @@ for path in sys.path:
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]
......@@ -123,11 +147,8 @@ find_links = os.environ.get(
if find_links:
cmd.extend(['-f', find_links])
setuptools_path = ws.find(
pkg_resources.Requirement.parse('setuptools')).location
requirement = 'zc.buildout'
version = options.version
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
......@@ -167,7 +188,7 @@ if version:
cmd.append(requirement)
import subprocess
if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0:
if subprocess.call(cmd) != 0:
raise Exception(
"Failed to execute command:\n%s" % repr(cmd)[1:-1])
......
Results of doctest builder run on 2013-12-20 14:29:22
=====================================================
Document: api
-------------
1 items passed all tests:
92 tests in default
92 tests in 1 items.
92 passed and 0 failed.
Test passed.
Doctest summary
===============
92 tests
0 failures in tests
0 failures in setup code
0 failures in cleanup code
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 52d702e043adc533a8e135368302be7d
tags: 645f666f9bcd5a90fca523b33c5a78b7
This diff is collapsed.
Hacking on :mod:`zope.deprecation`
==================================
Getting the Code
-----------------
The main repository for :mod:`zope.deprecation` is in the Zope Subversion
repository:
http://svn.zope.org/zope.deprecation
You can get a read-only Subversion checkout from there:
.. code-block:: sh
$ svn checkout svn://svn.zope.org/repos/main/zope.deprecation/trunk zope.deprecation
The project also mirrors the trunk from the Subversion repository as a
Bazaar branch on Launchpad:
https://code.launchpad.net/zope.deprecation
You can branch the trunk from there using Bazaar:
.. code-block:: sh
$ bzr branch lp:zope.deprecation
Running the tests in a ``virtualenv``
-------------------------------------
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.deprecation
Next, get this package registered as a "development egg" in the
environment:
.. code-block:: sh
$ /tmp/hack-zope.deprecation/bin/python setup.py develop
Finally, run the tests using the build-in ``setuptools`` testrunner:
.. code-block:: sh
$ /tmp/hack-zope.deprecation/bin/python setup.py test
running test
....................................................
----------------------------------------------------------------------
Ran 52 tests in 0.155s
OK
If you have the :mod:`nose` package installed in the virtualenv, you can
use its testrunner too:
.. code-block:: sh
$ /tmp/hack-zope.deprecation/bin/easy_install nose
...
$ /tmp/hack-zope.deprecation/bin/python setup.py nosetests
running nosetests
....................................................
----------------------------------------------------------------------
Ran 52 tests in 0.155s
OK
or:
.. code-block:: sh
$ /tmp/hack-zope.deprecation/bin/nosetests
....................................................
----------------------------------------------------------------------
Ran 52 tests in 0.155s
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.deprecation/bin/easy_install nose coverage
...
$ /tmp/hack-zope.deprecation/bin/python setup.py nosetests \
--with coverage --cover-package=zope.deprecation
running nosetests
....................................................
Name Stmts Miss Cover Missing
------------------------------------------------------------
zope.deprecation 7 0 100%
zope.deprecation.deprecation 127 0 100%
zope.deprecation.fixture 1 0 100%
------------------------------------------------------------
TOTAL 135 0 100%
----------------------------------------------------------------------
Ran 52 tests in 0.155s
OK
Building the documentation in a ``virtualenv``
----------------------------------------------
:mod:`zope.deprecation` 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:
.. code-block:: sh
$ /tmp/hack-zope.deprecation/bin/easy_install Sphinx
...
$ bin/sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
...
build succeeded.
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
...
Doctest summary
===============
89 tests
0 failures in tests
0 failures in setup code
build succeeded.
Testing of doctests in the sources finished, look at the \
results in _build/doctest/output.txt.
Running the tests using :mod:`zc.buildout`
-------------------------------------------
:mod:`zope.deprecation` 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/tseaver/projects/Zope/BTK/deprecation/.'
...
Generated script '.../bin/sphinx-quickstart'.
Generated script '.../bin/sphinx-build'.
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 52 tests with 0 failures and 0 errors in 0.366 seconds.
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
Building the documentation using :mod:`zc.buildout`
---------------------------------------------------
The :mod:`zope.deprecation` buildout installs the Sphinx scripts required to build
the documentation, including testing its code snippets:
.. code-block:: sh
$ cd docs
$ bin/sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
...
Doctest summary
===============
140 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.
.../bin/sphinx-build -b html -d .../docs/_build/doctrees .../docs .../docs/_build/html
...
build succeeded.
Running Tests on Multiple Python Versions via :mod:`tox`
--------------------------------------------------------
`tox <http://tox.testrun.org/latest/>`_ 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.deprecation` configures the following :mod:`tox` environments via
its ``tox.ini`` file:
- The ``py26`` environment builds a ``virtualenv`` with ``python2.6``,
installs :mod:`zope.deprecation`, and runs the tests
via ``python setup.py test -q``.
- The ``py27`` environment builds a ``virtualenv`` with ``python2.7``,
installs :mod:`zope.deprecation`, and runs the tests
via ``python setup.py test -q``.
- The ``py32`` environment builds a ``virtualenv`` with ``python3.2``,
installs :mod:`zope.deprecation` and dependencies, and runs the tests
via ``python setup.py test -q``.
- The ``pypy`` environment builds a ``virtualenv`` with ``pypy``,
installs :mod:`zope.deprecation`, and runs the tests
via ``python setup.py test -q``.
- The ``coverage`` environment builds a ``virtualenv`` with ``python2.6``,
installs :mod:`zope.deprecation`, installs
:mod:`nose` and :mod:`coverage`, and runs ``nosetests`` with statement
coverage.
- The ``docs`` environment builds a virtualenv with ``python2.6``, installs
:mod:`zope.deprecation`, 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