diff -Nru logging-tree-1.8.1/debian/changelog logging-tree-1.9/debian/changelog --- logging-tree-1.8.1/debian/changelog 2021-04-10 22:51:23.000000000 +0000 +++ logging-tree-1.9/debian/changelog 2022-01-11 18:53:34.000000000 +0000 @@ -1,17 +1,8 @@ -logging-tree (1.8.1-0.1ubuntu1) hirsute; urgency=medium +logging-tree (1.9-1) unstable; urgency=medium - * d/p/python-3.9.patch: Cherrypick upstream commit to fix FTBFS/test failure - with Python 3.9. + * New upstream release - -- Logan Rosen Sat, 10 Apr 2021 18:51:23 -0400 - -logging-tree (1.8.1-0.1) unstable; urgency=low - - * Non-maintainer upload. - * New upstream release. - - Fixes tests with Python 3.8. (Closes: #948974) - - -- Adrian Bunk Thu, 12 Mar 2020 11:47:32 +0200 + -- Federico Ceratto Tue, 11 Jan 2022 18:53:34 +0000 logging-tree (1.8-1) unstable; urgency=medium diff -Nru logging-tree-1.8.1/debian/control logging-tree-1.9/debian/control --- logging-tree-1.8.1/debian/control 2021-04-10 22:51:23.000000000 +0000 +++ logging-tree-1.9/debian/control 2022-01-11 18:53:34.000000000 +0000 @@ -1,16 +1,16 @@ Source: logging-tree Section: python Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Federico Ceratto -Build-Depends: debhelper-compat (= 12) +Maintainer: Federico Ceratto +Build-Depends: debhelper-compat (= 13) Build-Depends-Indep: dh-python, python3-all -Standards-Version: 4.3.1 +Standards-Version: 4.6.0 Homepage: https://github.com/brandon-rhodes/logging_tree Vcs-Browser: https://salsa.debian.org/debian/python-logging-tree Vcs-Git: https://salsa.debian.org/debian/python-logging-tree.git +Rules-Requires-Root: no Package: python3-logging-tree Architecture: all @@ -22,4 +22,3 @@ It is useful for troubleshooting applications where the logging levels seem inconsistent across modules and libraries. The loggers and their configuration is printed in a ascii tree. - diff -Nru logging-tree-1.8.1/debian/copyright logging-tree-1.9/debian/copyright --- logging-tree-1.8.1/debian/copyright 2019-10-05 17:02:03.000000000 +0000 +++ logging-tree-1.9/debian/copyright 2022-01-11 18:53:34.000000000 +0000 @@ -3,34 +3,33 @@ Source: https://github.com/brandon-rhodes/logging_tree Files: * -Copyright: © 2012-2014 Brandon Rhodes +Copyright: © 2012-2021 Brandon Rhodes License: BSD-3-Clause Files: debian/* -Copyright: © 2012-2019 Federico Ceratto +Copyright: © 2012-2022 Federico Ceratto License: BSD-3-Clause License: BSD-3-Clause Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + modification, are permitted provided that the following conditions are + met: . - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS 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 REGENTS OR CONTRIBUTORS 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. + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + . + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS 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 + HOLDER OR CONTRIBUTORS 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. diff -Nru logging-tree-1.8.1/debian/gitlab-ci.yml logging-tree-1.9/debian/gitlab-ci.yml --- logging-tree-1.8.1/debian/gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ logging-tree-1.9/debian/gitlab-ci.yml 2022-01-11 18:53:34.000000000 +0000 @@ -0,0 +1,4 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff -Nru logging-tree-1.8.1/debian/patches/python-3.9.patch logging-tree-1.9/debian/patches/python-3.9.patch --- logging-tree-1.8.1/debian/patches/python-3.9.patch 2021-04-10 22:51:22.000000000 +0000 +++ logging-tree-1.9/debian/patches/python-3.9.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -From dfde23eca7288c1878d3b63a26f98e9764f5ba6c Mon Sep 17 00:00:00 2001 -From: Logan Rosen -Date: Sat, 10 Apr 2021 04:26:32 -0400 -Subject: [PATCH] Fix compatibility with Python 3.9 (#27) - ---- - .travis.yml | 1 + - logging_tree/tests/test_format.py | 4 ++-- - setup.py | 1 + - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/.travis.yml b/.travis.yml -index 1bc5bf5..bcff67e 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -11,6 +11,7 @@ python: - - "3.6" - - "3.7" - - "3.8" -+ - "3.9" - - script: - - "python -m unittest logging_tree.tests.test_format logging_tree.tests.test_node" -diff --git a/logging_tree/tests/test_format.py b/logging_tree/tests/test_format.py -index c777747..fec6c2d 100644 ---- a/logging_tree/tests/test_format.py -+++ b/logging_tree/tests/test_format.py -@@ -13,7 +13,7 @@ - - - class FakeFile(StringIO): -- def __init__(self, filename, mode, encoding=None): -+ def __init__(self, filename, *args, **kwargs): - self.filename = filename - StringIO.__init__(self) - -@@ -154,7 +154,7 @@ def test_2_dot_5_handlers(self): - Level WARNING - Handler TimedRotatingFile '/bar/two.txt' when='H' interval=3600 backupCount=0 - ''' -- if sys.version_info >= (3, 8): -+ if sys.version_info == (3, 8): - # Apparently the design of the TimedRotatingFileHandler has - # become a bit more ambitious as of Python 3.8. - expected += '''\ -diff --git a/setup.py b/setup.py -index 65da834..15cb6b1 100644 ---- a/setup.py -+++ b/setup.py -@@ -24,6 +24,7 @@ - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', -+ 'Programming Language :: Python :: 3.9', - 'Topic :: System :: Logging', - ], - packages=['logging_tree', 'logging_tree.tests'], diff -Nru logging-tree-1.8.1/debian/patches/series logging-tree-1.9/debian/patches/series --- logging-tree-1.8.1/debian/patches/series 2021-04-10 22:51:22.000000000 +0000 +++ logging-tree-1.9/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -python-3.9.patch diff -Nru logging-tree-1.8.1/debian/upstream/metadata logging-tree-1.9/debian/upstream/metadata --- logging-tree-1.8.1/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ logging-tree-1.9/debian/upstream/metadata 2022-01-11 18:53:34.000000000 +0000 @@ -0,0 +1,5 @@ +--- +Bug-Database: https://github.com/brandon-rhodes/logging_tree/issues +Bug-Submit: https://github.com/brandon-rhodes/logging_tree/issues/new +Repository: https://github.com/brandon-rhodes/logging_tree.git +Repository-Browse: https://github.com/brandon-rhodes/logging_tree diff -Nru logging-tree-1.8.1/debian/watch logging-tree-1.9/debian/watch --- logging-tree-1.8.1/debian/watch 2019-10-05 17:02:03.000000000 +0000 +++ logging-tree-1.9/debian/watch 2022-01-11 18:53:34.000000000 +0000 @@ -1,4 +1,2 @@ -version=3 - -opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/logging_tree-$1\.tar\.gz/ \ - https://github.com/brandon-rhodes/logging_tree/tags .*/v?(\d\S*)\.tar\.gz +version=4 +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/logging_tree-$1\.tar\.gz/ https://github.com/brandon-rhodes/logging_tree/tags .*/v?(\d\S*)\.tar\.gz diff -Nru logging-tree-1.8.1/FUNDING.yml logging-tree-1.9/FUNDING.yml --- logging-tree-1.8.1/FUNDING.yml 1970-01-01 00:00:00.000000000 +0000 +++ logging-tree-1.9/FUNDING.yml 2022-01-11 13:50:52.000000000 +0000 @@ -0,0 +1 @@ +github: brandon-rhodes diff -Nru logging-tree-1.8.1/.github/workflows/logging-tree-tests.yml logging-tree-1.9/.github/workflows/logging-tree-tests.yml --- logging-tree-1.8.1/.github/workflows/logging-tree-tests.yml 1970-01-01 00:00:00.000000000 +0000 +++ logging-tree-1.9/.github/workflows/logging-tree-tests.yml 2022-01-11 13:50:52.000000000 +0000 @@ -0,0 +1,24 @@ +name: logging_tree tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-18.04 + strategy: + matrix: + python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Test with unittest + run: | + python -m unittest logging_tree.tests.test_format logging_tree.tests.test_node diff -Nru logging-tree-1.8.1/.gitignore logging-tree-1.9/.gitignore --- logging-tree-1.8.1/.gitignore 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -/MANIFEST -/dist/ -/.tox/ -*.pyc diff -Nru logging-tree-1.8.1/logging_tree/format.py logging-tree-1.9/logging_tree/format.py --- logging-tree-1.8.1/logging_tree/format.py 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/logging_tree/format.py 2022-01-11 13:50:52.000000000 +0000 @@ -156,7 +156,7 @@ yield ' Filter %s' % describe_filter(f) formatter = getattr(h, 'formatter', None) if formatter is not None: - if type(formatter) is logging.Formatter: + if class_of(formatter) is logging.Formatter: yield ' Formatter fmt=%r datefmt=%r' % ( getattr(formatter, '_fmt', None), getattr(formatter, 'datefmt', None)) @@ -168,3 +168,17 @@ yield ' Handler ' + next(g) for line in g: yield ' ' + line + + +def class_of(obj): + """Try to learn the class of `obj`. + + We perform the operation gingerly, as `obj` could be any kind of + user-supplied object: an old-style class, a new-style class, or a + built-in type that doesn't follow normal rules. + + """ + cls = getattr(obj, '__class__', None) + if cls is None: + cls = type(obj) + return cls diff -Nru logging-tree-1.8.1/logging_tree/__init__.py logging-tree-1.9/logging_tree/__init__.py --- logging-tree-1.8.1/logging_tree/__init__.py 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/logging_tree/__init__.py 2022-01-11 13:50:52.000000000 +0000 @@ -29,6 +29,11 @@ o<--"x.c" Level NOTSET so inherits level WARNING +If you instead want to write the tree diagram to a file, stream, or +other file-like object, use:: + + file_object.write(logging_tree.format.build_description()) + The logger tree should always print successfully, no matter how complicated. A node whose ``[name]`` is in square brackets is a "place holder" that has never actually been named in a ``getLogger()`` call, @@ -77,6 +82,11 @@ Changelog --------- +**Version 1.9** - 2021 April 10 + Declare compatibility with Python 3.9. Improve how the logging + module's built-in ``Formatter`` class is displayed under old Python + versions where the ``logging`` module uses old-style classes. + **Version 1.8.1** - 2020 January 26 Adjust one test to make it pass under Python 3.8, and update the distribution classifiers to declare compatibility with Python @@ -126,7 +136,7 @@ Initial release. """ -__version__ = '1.8.1' +__version__ = '1.9' __all__ = ('tree', 'printout') from logging_tree.nodes import tree diff -Nru logging-tree-1.8.1/logging_tree/tests/case.py logging-tree-1.9/logging_tree/tests/case.py --- logging-tree-1.8.1/logging_tree/tests/case.py 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/logging_tree/tests/case.py 2022-01-11 13:50:52.000000000 +0000 @@ -6,8 +6,15 @@ class LoggingTestCase(unittest.TestCase): """Test case that knows the secret: how to reset the logging module.""" + def setUp(self): + reset_logging() + super(LoggingTestCase, self).setUp() + def tearDown(self): + reset_logging() super(LoggingTestCase, self).tearDown() - logging.root = logging.RootLogger(logging.WARNING) - logging.Logger.root = logging.root - logging.Logger.manager = logging.Manager(logging.Logger.root) + +def reset_logging(): + logging.root = logging.RootLogger(logging.WARNING) + logging.Logger.root = logging.root + logging.Logger.manager = logging.Manager(logging.Logger.root) diff -Nru logging-tree-1.8.1/logging_tree/tests/test_format.py logging-tree-1.9/logging_tree/tests/test_format.py --- logging-tree-1.8.1/logging_tree/tests/test_format.py 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/logging_tree/tests/test_format.py 2022-01-11 13:50:52.000000000 +0000 @@ -13,7 +13,7 @@ class FakeFile(StringIO): - def __init__(self, filename, mode, encoding=None): + def __init__(self, filename, *args, **kwargs): self.filename = filename StringIO.__init__(self) @@ -154,19 +154,6 @@ Level WARNING Handler TimedRotatingFile '/bar/two.txt' when='H' interval=3600 backupCount=0 ''' - if sys.version_info >= (3, 8): - # Apparently the design of the TimedRotatingFileHandler has - # become a bit more ambitious as of Python 3.8. - expected += '''\ - | - o<--"asyncio" - | Level NOTSET so inherits level WARNING - | - o<--[concurrent] - | - o<--"concurrent.futures" - Level NOTSET so inherits level WARNING -''' self.assertEqual(build_description(), expected) def test_2_dot_6_handlers(self): diff -Nru logging-tree-1.8.1/setup.py logging-tree-1.9/setup.py --- logging-tree-1.8.1/setup.py 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/setup.py 2022-01-11 13:50:52.000000000 +0000 @@ -24,6 +24,7 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Topic :: System :: Logging', ], packages=['logging_tree', 'logging_tree.tests'], diff -Nru logging-tree-1.8.1/test.sh logging-tree-1.9/test.sh --- logging-tree-1.8.1/test.sh 1970-01-01 00:00:00.000000000 +0000 +++ logging-tree-1.9/test.sh 2022-01-11 13:50:52.000000000 +0000 @@ -0,0 +1,18 @@ +#!/bin/bash +# +# This merely tests that `logging_tree` works when run directly from +# source (and, of course, only tests the versions of Python you happen +# to have installed with pyenv). For a comprehensive test of whether it +# will actually work if installed from its distribution, see `tox.ini`. + +for python in ~/.pyenv/versions/*/bin/python +do + echo + echo ====================================================================== + echo $python + echo ====================================================================== + for test in logging_tree/tests/test_*.py + do + PYTHONPATH=. $python $test + done +done diff -Nru logging-tree-1.8.1/tox.ini logging-tree-1.9/tox.ini --- logging-tree-1.8.1/tox.ini 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/tox.ini 2022-01-11 13:50:52.000000000 +0000 @@ -1,8 +1,13 @@ +# To test against as many versions of Python as feasible, I run: +# +# tox --discover ~/.pyenv/versions/*/bin/python +# +# Unfortunately tox has lost its ability to detect older versions of +# Python like 2.6 (much less 2.3 or 2.4); see the accompanying `test.sh` +# script for an alternative. + [tox] -envlist = py24, py25, py26, py27, py32, py33, py34, py35 +envlist = py27,py36,py37,py38,py39 [testenv] -deps = - py2{4,5,6}: unittest2 commands = - py{27,32,33,34}: python -m unittest discover logging_tree - py2{4,5,6}: unit2 discover logging_tree + python -m unittest discover logging_tree diff -Nru logging-tree-1.8.1/.travis.yml logging-tree-1.9/.travis.yml --- logging-tree-1.8.1/.travis.yml 2020-01-27 01:19:14.000000000 +0000 +++ logging-tree-1.9/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Config file for automatic testing at travis-ci.org - -language: python - -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - -script: - - "python -m unittest logging_tree.tests.test_format logging_tree.tests.test_node"