Hello community, here is the log from the commit of package python-deprecation for openSUSE:Factory checked in at 2019-09-13 15:03:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-deprecation (Old) and /work/SRC/openSUSE:Factory/.python-deprecation.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-deprecation" Fri Sep 13 15:03:34 2019 rev:4 rq:730639 version:2.0.7 Changes: -------- --- /work/SRC/openSUSE:Factory/python-deprecation/python-deprecation.changes 2019-03-10 09:35:53.836168742 +0100 +++ /work/SRC/openSUSE:Factory/.python-deprecation.new.7948/python-deprecation.changes 2019-09-13 15:05:05.617259603 +0200 @@ -1,0 +2,6 @@ +Fri Sep 13 08:56:51 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 2.0.7: + * no upstream changelog + +------------------------------------------------------------------- Old: ---- deprecation-2.0.6.tar.gz New: ---- deprecation-2.0.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-deprecation.spec ++++++ --- /var/tmp/diff_new_pack.WbZlqc/_old 2019-09-13 15:05:06.421259432 +0200 +++ /var/tmp/diff_new_pack.WbZlqc/_new 2019-09-13 15:05:06.421259432 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-deprecation -Version: 2.0.6 +Version: 2.0.7 Release: 0 Summary: A library to handle automated deprecations License: Apache-2.0 ++++++ deprecation-2.0.6.tar.gz -> deprecation-2.0.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/MANIFEST.in new/deprecation-2.0.7/MANIFEST.in --- old/deprecation-2.0.6/MANIFEST.in 2018-05-06 17:32:55.000000000 +0200 +++ new/deprecation-2.0.7/MANIFEST.in 2019-08-13 00:03:16.000000000 +0200 @@ -1,2 +1,3 @@ include LICENSE include tests/*.py +graft docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/PKG-INFO new/deprecation-2.0.7/PKG-INFO --- old/deprecation-2.0.6/PKG-INFO 2018-09-26 23:43:06.000000000 +0200 +++ new/deprecation-2.0.7/PKG-INFO 2019-08-13 00:08:50.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: deprecation -Version: 2.0.6 +Version: 2.0.7 Summary: A library to handle automated deprecations Home-page: http://deprecation.readthedocs.io/ Author: Brian Curtin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/deprecation.egg-info/PKG-INFO new/deprecation-2.0.7/deprecation.egg-info/PKG-INFO --- old/deprecation-2.0.6/deprecation.egg-info/PKG-INFO 2018-09-26 23:43:06.000000000 +0200 +++ new/deprecation-2.0.7/deprecation.egg-info/PKG-INFO 2019-08-13 00:08:50.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: deprecation -Version: 2.0.6 +Version: 2.0.7 Summary: A library to handle automated deprecations Home-page: http://deprecation.readthedocs.io/ Author: Brian Curtin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/deprecation.egg-info/SOURCES.txt new/deprecation-2.0.7/deprecation.egg-info/SOURCES.txt --- old/deprecation-2.0.6/deprecation.egg-info/SOURCES.txt 2018-09-26 23:43:06.000000000 +0200 +++ new/deprecation-2.0.7/deprecation.egg-info/SOURCES.txt 2019-08-13 00:08:50.000000000 +0200 @@ -9,5 +9,10 @@ deprecation.egg-info/dependency_links.txt deprecation.egg-info/requires.txt deprecation.egg-info/top_level.txt +docs/Makefile +docs/conf.py +docs/index.rst +docs/sample.py +docs/sample.rst tests/__init__.py tests/test_deprecation.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/deprecation.py new/deprecation-2.0.7/deprecation.py --- old/deprecation-2.0.6/deprecation.py 2018-09-26 23:42:03.000000000 +0200 +++ new/deprecation-2.0.7/deprecation.py 2019-08-13 00:03:16.000000000 +0200 @@ -16,7 +16,7 @@ from packaging import version -__version__ = "2.0.6" +__version__ = "2.0.7" # This is mostly here so automodule docs are ordered more ideally. __all__ = ["deprecated", "message_location", "fail_if_not_removed", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/docs/Makefile new/deprecation-2.0.7/docs/Makefile --- old/deprecation-2.0.6/docs/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ new/deprecation-2.0.7/docs/Makefile 2019-03-27 16:31:24.000000000 +0100 @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = deprecation +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/docs/conf.py new/deprecation-2.0.7/docs/conf.py --- old/deprecation-2.0.6/docs/conf.py 1970-01-01 01:00:00.000000000 +0100 +++ new/deprecation-2.0.7/docs/conf.py 2019-03-27 16:31:24.000000000 +0100 @@ -0,0 +1,156 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# deprecation documentation build configuration file, created by +# sphinx-quickstart on Fri Jan 13 16:03:40 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +sys.path.insert(0, os.path.dirname(__file__)) + +import deprecation # NOQA + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] +intersphinx_mapping = {'python': ('https://docs.python.org/dev', None)} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'deprecation' +copyright = '2017, Brian Curtin' +author = 'Brian Curtin' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = deprecation.__version__ +# The full version, including alpha/beta/rc tags. +release = deprecation.__version__ + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'nature' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'deprecationdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'deprecation.tex', 'deprecation Documentation', + 'Brian Curtin', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'deprecation', 'deprecation Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'deprecation', 'deprecation Documentation', + author, 'deprecation', 'A library to handle automated deprecations.', + 'Miscellaneous'), +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/docs/index.rst new/deprecation-2.0.7/docs/index.rst --- old/deprecation-2.0.6/docs/index.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/deprecation-2.0.7/docs/index.rst 2019-03-27 16:31:24.000000000 +0100 @@ -0,0 +1,107 @@ +.. deprecation documentation master file, created by + sphinx-quickstart on Fri Jan 13 16:03:40 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +``deprecation`` +=============== + +``deprecation`` is a library that enables automated deprecations. It offers +the :func:`~deprecation.deprecated` decorator to wrap functions, providing +proper warnings both in documentation and via Python's :mod:`warnings` system, +as well as the :func:`deprecation.fail_if_not_removed` decorator for test +methods to ensure that deprecated code is eventually removed. + +See `API Documentation`_ to jump straight into the options. See the +:doc:`sample` page for an example of ``deprecation``'s effect on a module's +Sphinx `autodoc <http://www.sphinx-doc.org/en/master/ext/autodoc.html>`_ +generated documentation. + +Installation +============ + + :: + + pip install deprecation + +Using ``@deprecated`` +===================== + +To mark a function or method as deprecated, wrap it in the +:func:`~deprecation.deprecated` decorator. This does several things for you: + +1. The docstring of the wrapped function will have details appended + to it from the arguments you set on :func:`~deprecation.deprecated`. + This takes care of telling your users not only that the function + is deprecated, but can also tell them when it's going away and + what they can do in the meantime. +2. In conjunction with the :func:`~deprecation.fail_if_not_removed` + decorator it removes the need for any sort of manual tracking of + when a sufficiently deprecated piece of code should be removed + from the codebase. It causes tests to fail when they contain + code which should be removed. + + :: + + import deprecation + + @deprecation.deprecated(deprecated_in="1.0", removed_in="2.0", + current_version=__version__, + details="Use the bar function instead") + def foo(): + """Do some stuff""" + return 1 + +Now look at the docs. If you you generate API documentation from your source +like the :doc:`sample` does, you'll see that the a sentence has been +appended to a deprecated function's docstring to include information about +when the function is deprecated, when it'll be removed, and what you can do +instead. For example, run ``help(foo)`` and this is what you'll get: + + :: + + Help on function foo in module example: + + foo() + Do some stuff + + *Deprecated in 1.0, to be removed in 2.0. Use the bar function instead* + +You can pass varying amounts of detail to this decorator, but note that +in most cases it removes the ability to use +:func:`~deprecation.fail_if_not_removed`. See the `API Documentation`_ +for full details. + +Using ``@fail_if_not_removed`` +============================== + +Once you've marked code for deprecation via :func:`~deprecation.deprecated`, +you can sit back and relax as most of the work has been done for you. +Assuming you've provided sufficient detail to the decorator, you now just +wait for your tests to tell you it's time to delete the code in question. + +If you wrap test methods which use your now deprecated code in +:func:`~deprecation.fail_if_not_removed`, the test will fail with a message +notifying you that you should remove this code. + + :: + + @deprecation.fail_if_not_removed + def test_won(self): + self.assertEqual(1, won()) + +Looking at the :doc:`sample` docs, we can see that this function would +fail the tests at version 2.0, when it should be removed. The following +shows what test output will look like for a failure. + + :: + + AssertionError: <function Tests.test_won at 0x10af33268> uses a function + that should be removed: who is unsupported as of 2.0. Use the ``one`` + function instead + +API Documentation +================= + +.. automodule:: deprecation + :members: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/docs/sample.py new/deprecation-2.0.7/docs/sample.py --- old/deprecation-2.0.6/docs/sample.py 1970-01-01 01:00:00.000000000 +0100 +++ new/deprecation-2.0.7/docs/sample.py 2019-03-27 16:31:24.000000000 +0100 @@ -0,0 +1,84 @@ +import unittest2 + +import deprecation + +__version__ = "1.5" + + [email protected](deprecated_in="1.0", removed_in="2.0", + current_version=__version__, + details="Use the ``one`` function instead") +def won(): + """This function returns 1""" + # Oops, it's one, not won. Let's deprecate this and get it right. + return 1 + + [email protected](deprecated_in="1.0", removed_in="2.0", + current_version=__version__, + details="Use the ``multiline_one`` function instead.") +def multiline_bottom(): + """This function returns 1. + + Multiline Bottom. Deprecation Note is inserted at the bottom. + + This is also here to show that multiline docstrings work + """ + return 1 + + [email protected](deprecated_in="1.0", removed_in="2.0", + current_version=__version__, + details="Use the ``one`` function instead") +def uno(): + """Esta función regresa 1 + + This is Spanish for 'This function returns 1' + + This is also here to show that multiline docstrings work + """ + return 1 + + +def one(): + """This function returns 1""" + return 1 + + [email protected](deprecated_in="1.0", removed_in="1.5", + current_version=__version__, + details="Why would you ever do this anyway?") +def why(): + """This isn't necessary""" + return None + + +deprecation.message_location = 'top' + + [email protected](deprecated_in="1.0", removed_in="2.0", + current_version=__version__, + details="Use the ``multiline_one`` function instead.") +def multiline_top(): + """This function returns 1. + + Multiline Top. Deprecation Note is inserted above this line. This is done + via setting ``deprecation.message_location`` to 'top'. + + This is also here to show that multiline docstrings work + """ + return 1 + + +class Tests(unittest2.TestCase): + + @deprecation.fail_if_not_removed + def test_won(self): + self.assertEqual(1, won()) + + @deprecation.fail_if_not_removed + def test_why(self): + self.assertIsNone(why()) + + def test_one(self): + self.assertEqual(1, one()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/deprecation-2.0.6/docs/sample.rst new/deprecation-2.0.7/docs/sample.rst --- old/deprecation-2.0.6/docs/sample.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/deprecation-2.0.7/docs/sample.rst 2019-03-27 16:31:24.000000000 +0100 @@ -0,0 +1,10 @@ +:orphan: + +``sample`` module +================= + +The following documents the ``sample`` module to show what documentation +looks like when :func:`~deprecation.deprecated` has modified it. + +.. automodule:: sample + :members:
