Hello community,
here is the log from the commit of package python-daiquiri for openSUSE:Factory
checked in at 2019-03-10 09:35:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-daiquiri (Old)
and /work/SRC/openSUSE:Factory/.python-daiquiri.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-daiquiri"
Sun Mar 10 09:35:44 2019 rev:4 rq:682477 version:1.5.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-daiquiri/python-daiquiri.changes
2018-12-13 19:42:36.909155915 +0100
+++
/work/SRC/openSUSE:Factory/.python-daiquiri.new.28833/python-daiquiri.changes
2019-03-10 09:35:51.180169378 +0100
@@ -1,0 +2,15 @@
+Thu Mar 7 14:01:01 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.5.0:
+ * Support for python 3.7
+ * Many Mergify fixes
+ * Use pytests for testing
+ * formatter: enable extra keywords by default
+ * Fix JSON encoding with extra keys
+ * Add tests for color and extras formatters
+ * Add formatter.ExtrasFormatter and formatter.ColorExtrasFormatter
+ * Add KeywordArgumentAdapter.setLevel method for Python 2
+ * Many flake8 fixes
+- Make sure tests are executed
+
+-------------------------------------------------------------------
Old:
----
daiquiri-1.2.1.tar.gz
New:
----
daiquiri-1.5.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-daiquiri.spec ++++++
--- /var/tmp/diff_new_pack.BZyjpN/_old 2019-03-10 09:35:52.928168960 +0100
+++ /var/tmp/diff_new_pack.BZyjpN/_new 2019-03-10 09:35:52.932168959 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-daiquiri
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-daiquiri
-Version: 1.2.1
+Version: 1.5.0
Release: 0
Summary: Library to configure Python logging
License: Apache-2.0
@@ -26,6 +26,11 @@
URL: https://github.com/jd/daiquiri
Source:
https://files.pythonhosted.org/packages/source/d/daiquiri/daiquiri-%{version}.tar.gz
BuildRequires: %{python_module pbr}
+BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module python-json-logger}
+BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module six}
+BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-python-json-logger
BuildArch: noarch
@@ -43,6 +48,10 @@
%install
%python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
+
+%check
+%pytest daiquiri/tests
%files %{python_files}
%license LICENSE
++++++ daiquiri-1.2.1.tar.gz -> daiquiri-1.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/.mergify.yml
new/daiquiri-1.5.0/.mergify.yml
--- old/daiquiri-1.2.1/.mergify.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/daiquiri-1.5.0/.mergify.yml 2018-07-18 17:35:55.000000000 +0200
@@ -0,0 +1,9 @@
+rules:
+ default:
+ protection:
+ required_status_checks:
+ strict: True
+ contexts:
+ - continuous-integration/travis-ci
+ required_pull_request_reviews:
+ required_approving_review_count: 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/.travis.yml
new/daiquiri-1.5.0/.travis.yml
--- old/daiquiri-1.2.1/.travis.yml 2017-07-05 10:02:15.000000000 +0200
+++ new/daiquiri-1.5.0/.travis.yml 2018-07-18 17:35:55.000000000 +0200
@@ -1,10 +1,20 @@
language: python
+dist: xenial
+sudo: required
python:
- 2.7
- - 3.5
- 3.6
+ - 3.7
before_install:
- pip install -U pip
install:
- pip install tox-travis .[test]
script: tox
+deploy:
+ provider: pypi
+ user: jd
+ password:
+ secure:
kyeXaQ+0Yv1GC2vWC8zghXDLtYEtZ8SbTuw90hA4VQm2HlPUyVDKL8zi4YyEuziRd7mG/7XrgpZG6fNh02wEblFngrmWAJ9dze/9JRLjyCFCNn6oM9xRqNOC19ZWiV5/ifgLp7Ije3lfrsRI5OsDaXy9Dd2cNO/1O/MOMwpqpzs5fUZYcY4HQj0tJmSmM72RaR2C9hn/BGJEZWPyx6XMboQLnkLvlCT6hZHpk+y3Ofg+5wUd4IaZe8ZH/rkPQu5nBclGpUkQ99jb5YhwwQno52TgVeh3xf8Vzy5riYQD6No5JvYHs9MGkBfctdTcOwMRwH8XDxhIDDj1o3MeCgKCsfmskRxvBmk5nJzv3Lk8pdlEt/TUiuorU6+Zo2UMeGhSFPY6JBrK1ELs/XiZHbB63vJ+VLSoEluXzBTFyw7wAg7MRsNOneHvXCpjSVS4SxqmzrIRZBNvNpkkE/ZainlGG3KII9JM4tG6oJ2XvELMtG9A+2z450HnFJFV06F+qnztl31+VagMOW0BMnyVtR+dayAHAZ1qHaTrPf0mRJIKKp8QpF37//wWkrSaAyZAf5CeTtVYM2saxEcQzJX9wtp0KKfxnlg0xSBc7BRDJBSFexUeWMX1o1q1qU8c26sZU29XBjuxKRzC/jnZWAhWdL9YEGyISUrbsHHdwRGDKOzyBjc=
+ on:
+ tags: true
+ distributions: "sdist bdist_wheel"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/AUTHORS new/daiquiri-1.5.0/AUTHORS
--- old/daiquiri-1.2.1/AUTHORS 2017-07-19 13:18:58.000000000 +0200
+++ new/daiquiri-1.5.0/AUTHORS 2018-07-18 17:36:19.000000000 +0200
@@ -4,6 +4,7 @@
Fridolin Pokorny <[email protected]>
John Still <[email protected]>
Julien Danjou <[email protected]>
+Kurt Wheeler <[email protected]>
Martín Gaitán <[email protected]>
Tristan Cacqueray <[email protected]>
davebrochu <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/ChangeLog new/daiquiri-1.5.0/ChangeLog
--- old/daiquiri-1.2.1/ChangeLog 2017-07-19 13:18:58.000000000 +0200
+++ new/daiquiri-1.5.0/ChangeLog 2018-07-18 17:36:19.000000000 +0200
@@ -1,6 +1,44 @@
CHANGES
=======
+1.5.0
+-----
+
+* formatter: enable extra keywords by default
+
+1.4.0
+-----
+
+* Fix JSON encoding with extra keys
+* Support Python 3.7
+* Add build to .gitignore
+* Fix Mergify conf
+* Enable Mergify
+* Switch to pytest
+
+1.3.0
+-----
+
+* Add tests for color and extras formatters
+* Add formatter.ExtrasFormatter and formatter.ColorExtrasFormatter
+* Add KeywordArgumentAdapter.setLevel method for Python 2
+* Fix example flake8
+* Remove useless ignore in flake8
+* Use flake8-import-order
+* Ignore eggs directory
+* Remove hacking as a pep8 dependency
+
+1.2.2
+-----
+
+* Use Travis to push source and wheel on tag on PyPI
+* Remove doc path hack
+* doc: add missing import
+* doc: add rootdir to sys.path
+* Document JournalHandler
+* Document outputs
+* Use autodoc do publish documentation
+
1.2.1
-----
@@ -72,11 +110,3 @@
* Add utility function to set default log levels
* Rework output so color hints are not logged
* Change program name handling
-* Improve README
-* Make JSON optional
-* Fix Python 2.7 test with StringIO
-* Rename target to output
-* Add a test for JSON formatter
-* Add daiquiri target to manage log target+formatter+level
-* Allow to log to any stream
-* Import
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/PKG-INFO new/daiquiri-1.5.0/PKG-INFO
--- old/daiquiri-1.2.1/PKG-INFO 2017-07-19 13:18:59.000000000 +0200
+++ new/daiquiri-1.5.0/PKG-INFO 2018-07-18 17:36:19.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: daiquiri
-Version: 1.2.1
+Version: 1.5.0
Summary: Library to configure Python logging easily
Home-page: https://github.com/jd/daiquiri
Author: Julien Danjou
@@ -36,5 +36,8 @@
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Provides-Extra: test
+Provides-Extra: json
+Provides-Extra: systemd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri/__init__.py
new/daiquiri-1.5.0/daiquiri/__init__.py
--- old/daiquiri-1.2.1/daiquiri/__init__.py 2017-07-18 12:02:43.000000000
+0200
+++ new/daiquiri-1.5.0/daiquiri/__init__.py 2018-07-18 17:35:55.000000000
+0200
@@ -46,10 +46,17 @@
if name == 'exc_info':
continue
extra[name] = kwargs.pop(name)
- extra['_daiquiri_extra'] = extra
+ extra['_daiquiri_extra_keys'] = set(extra.keys())
kwargs['extra'] = extra
return msg, kwargs
+ if sys.version_info.major == 2:
+ def setLevel(self, level):
+ """
+ Set the specified level on the underlying logger.
+ """
+ self.logger.setLevel(level)
+
_LOGGERS = weakref.WeakValueDictionary()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri/formatter.py
new/daiquiri-1.5.0/daiquiri/formatter.py
--- old/daiquiri-1.2.1/daiquiri/formatter.py 2017-07-05 10:03:55.000000000
+0200
+++ new/daiquiri-1.5.0/daiquiri/formatter.py 2018-07-18 17:35:55.000000000
+0200
@@ -22,8 +22,15 @@
"%(name)s: %(message)s%(color_stop)s"
)
+DEFAULT_EXTRAS_FORMAT = (
+ "%(asctime)s [%(process)d] %(color)s%(levelname)-8.8s "
+ "%(name)s%(extras)s: %(message)s%(color_stop)s"
+)
+
class ColorFormatter(logging.Formatter):
+ """Colorizes log output"""
+
# TODO(jd) Allow configuration
LEVEL_COLORS = {
logging.DEBUG: '\033[00;32m', # GREEN
@@ -35,19 +42,107 @@
COLOR_STOP = '\033[0m'
- def format(self, record):
+ def add_color(self, record):
if getattr(record, "_stream_is_a_tty", False):
record.color = self.LEVEL_COLORS[record.levelno]
record.color_stop = self.COLOR_STOP
else:
record.color = ""
record.color_stop = ""
- s = super(ColorFormatter, self).format(record)
+
+ def remove_color(self, record):
del record.color
del record.color_stop
+
+ def format(self, record):
+ self.add_color(record)
+ s = super(ColorFormatter, self).format(record)
+ self.remove_color(record)
+ return s
+
+
+class ExtrasFormatter(logging.Formatter):
+ """Formats extra keywords into %(extras)s placeholder.
+
+ Any keywords passed to a logging call will be formatted into a
+ "extras" string and included in a logging message.
+ Example:
+ logger.info('my message', extra='keyword')
+ will cause an "extras" string of:
+ [extra: keyword]
+ to be inserted into the format in place of %(extras)s.
+
+ The optional `keywords` argument must be passed into the init
+ function to enable this functionality. Without it normal daiquiri
+ formatting will be applied. Any keywords included in the
+ `keywords` parameter will not be included in the "extras" string.
+
+ Special keywords:
+
+ keywords
+ A set of strings containing keywords to filter out of the
+ "extras" string.
+
+ extras_template
+ A format string to use instead of '[{0}: {1}]'
+
+ extras_separator
+ What string to "join" multiple "extras" with.
+
+ extras_prefix and extras_suffix
+ Strings which will be prepended and appended to the "extras"
+ string respectively. These will only be prepended if the
+ "extras" string is not empty.
+ """
+
+ def __init__(self,
+ keywords=None,
+ extras_template='[{0}: {1}]',
+ extras_separator=' ',
+ extras_prefix=' ',
+ extras_suffix='',
+ *args, **kwargs):
+ self.keywords = set() if keywords is None else keywords
+ self.extras_template = extras_template
+ self.extras_separator = extras_separator
+ self.extras_prefix = extras_prefix
+ self.extras_suffix = extras_suffix
+ super(ExtrasFormatter, self).__init__(*args, **kwargs)
+
+ def add_extras(self, record):
+ if not hasattr(record, '_daiquiri_extra_keys'):
+ record.extras = ''
+ return
+
+ extras = self.extras_separator.join(
+ self.extras_template.format(k, getattr(record, k))
+ for k in record._daiquiri_extra_keys
+ if k != '_daiquiri_extra_keys' and k not in self.keywords
+ )
+ if extras != '':
+ extras = self.extras_prefix + extras + self.extras_suffix
+ record.extras = extras
+
+ def remove_extras(self, record):
+ del record.extras
+
+ def format(self, record):
+ self.add_extras(record)
+ s = super(ExtrasFormatter, self).format(record)
+ self.remove_extras(record)
+ return s
+
+
+class ColorExtrasFormatter(ColorFormatter, ExtrasFormatter):
+ """Combines functionality of ColorFormatter and ExtrasFormatter."""
+
+ def format(self, record):
+ self.add_color(record)
+ s = ExtrasFormatter.format(self, record)
+ self.remove_color(record)
return s
-TEXT_FORMATTER = ColorFormatter(fmt=DEFAULT_FORMAT)
+TEXT_FORMATTER = ColorExtrasFormatter(fmt=DEFAULT_EXTRAS_FORMAT)
if jsonlogger:
JSON_FORMATTER = jsonlogger.JsonFormatter()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri/handlers.py
new/daiquiri-1.5.0/daiquiri/handlers.py
--- old/daiquiri-1.2.1/daiquiri/handlers.py 2017-07-19 13:18:46.000000000
+0200
+++ new/daiquiri-1.5.0/daiquiri/handlers.py 2018-07-18 17:35:55.000000000
+0200
@@ -58,6 +58,7 @@
class JournalHandler(logging.Handler):
+ """Journald based handler. Only available on platforms using systemd."""
def __init__(self, program_name):
if not journal:
@@ -87,10 +88,10 @@
if record.exc_info:
extras['EXCEPTION_INFO'] = record.exc_info
- if hasattr(record, "_daiquiri_extra"):
- for k, v in record._daiquiri_extra.items():
- if k != "_daiquiri_extra":
- extras[k.upper()] = v
+ if hasattr(record, "_daiquiri_extra_keys"):
+ for k, v in record._daiquiri_extra_keys:
+ if k != "_daiquiri_extra_keys":
+ extras[k.upper()] = getattr(record, k)
journal.send(message, **extras)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri/output.py
new/daiquiri-1.5.0/daiquiri/output.py
--- old/daiquiri-1.2.1/daiquiri/output.py 2017-07-18 12:02:43.000000000
+0200
+++ new/daiquiri-1.5.0/daiquiri/output.py 2018-07-18 17:35:55.000000000
+0200
@@ -65,6 +65,8 @@
class File(Output):
+ """Ouput to a file."""
+
def __init__(self, filename=None, directory=None, suffix=".log",
program_name=None, formatter=formatter.TEXT_FORMATTER,
level=None):
@@ -86,6 +88,8 @@
class RotatingFile(Output):
+ """Output to a file, rotating after a certain size."""
+
def __init__(self, filename=None, directory=None, suffix='.log',
program_name=None, formatter=formatter.TEXT_FORMATTER,
level=None, max_size_bytes=0, backup_count=0):
@@ -116,6 +120,8 @@
class TimedRotatingFile(Output):
+ """Rotating log file output, triggered by a fixed interval."""
+
def __init__(self, filename=None, directory=None, suffix='.log',
program_name=None, formatter=formatter.TEXT_FORMATTER,
level=None, interval=datetime.timedelta(hours=24),
@@ -163,6 +169,8 @@
class Stream(Output):
+ """Generic stream output."""
+
def __init__(self, stream=sys.stderr, formatter=formatter.TEXT_FORMATTER,
level=None):
super(Stream, self).__init__(handlers.TTYDetectorStreamHandler(stream),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri/tests/test_daiquiri.py
new/daiquiri-1.5.0/daiquiri/tests/test_daiquiri.py
--- old/daiquiri-1.2.1/daiquiri/tests/test_daiquiri.py 2017-07-18
12:02:43.000000000 +0200
+++ new/daiquiri-1.5.0/daiquiri/tests/test_daiquiri.py 2018-07-18
17:35:55.000000000 +0200
@@ -11,15 +11,15 @@
# under the License.
import json
import logging
+import unittest
import warnings
import six.moves
-import testtools
import daiquiri
-class TestDaiquiri(testtools.TestCase):
+class TestDaiquiri(unittest.TestCase):
def tearDown(self):
# Be sure to reset the warning capture
logging.captureWarnings(False)
@@ -40,6 +40,20 @@
self.assertEqual({"message": "foobar"},
json.loads(stream.getvalue()))
+ def test_setup_json_formatter_with_extras(self):
+ stream = six.moves.StringIO()
+ daiquiri.setup(outputs=(
+ daiquiri.output.Stream(
+ stream, formatter=daiquiri.formatter.JSON_FORMATTER),
+ ))
+ daiquiri.getLogger(__name__).warning("foobar", foo="bar")
+ self.assertEqual({"message": "foobar", "foo": "bar"},
+ json.loads(stream.getvalue()))
+
+ def test_get_logger_set_level(self):
+ logger = daiquiri.getLogger(__name__)
+ logger.setLevel(logging.DEBUG)
+
def test_capture_warnings(self):
stream = six.moves.StringIO()
daiquiri.setup(outputs=(
@@ -48,7 +62,7 @@
warnings.warn("omg!")
line = stream.getvalue()
self.assertIn("WARNING py.warnings: ", line)
- self.assertIn("daiquiri/tests/test_daiquiri.py:48: "
+ self.assertIn("daiquiri/tests/test_daiquiri.py:62: "
"UserWarning: omg!\n warnings.warn(\"omg!\")\n",
line)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri/tests/test_formatter.py
new/daiquiri-1.5.0/daiquiri/tests/test_formatter.py
--- old/daiquiri-1.2.1/daiquiri/tests/test_formatter.py 1970-01-01
01:00:00.000000000 +0100
+++ new/daiquiri-1.5.0/daiquiri/tests/test_formatter.py 2018-07-18
17:35:55.000000000 +0200
@@ -0,0 +1,87 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+import logging
+import unittest
+
+import six
+
+import daiquiri
+
+
+class TestColorExtrasFormatter(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls.logger = daiquiri.getLogger('my_module')
+ cls.logger.setLevel(logging.INFO)
+ cls.stream = six.moves.StringIO()
+ cls.handler = daiquiri.handlers.TTYDetectorStreamHandler(cls.stream)
+ cls.logger.logger.addHandler(cls.handler)
+ super(TestColorExtrasFormatter, cls).setUpClass()
+
+ def setUp(self):
+ # Couldn't get readline() to return anything no matter what I tried, so
+ # getvalue() is the only way to see what's in the stream. However this
+ # requires the stream to be reset every time.
+ self.stream.close()
+ self.stream = six.moves.StringIO()
+ self.handler.stream = self.stream
+ super(TestColorExtrasFormatter, self).setUp()
+
+ def test_no_keywords(self):
+ format_string = '%(levelname)s %(name)s%(extras)s: %(message)s'
+ formatter = daiquiri.formatter.ColorExtrasFormatter(fmt=format_string)
+ self.handler.setFormatter(formatter)
+
+ self.logger.info('test message')
+ self.assertEqual(self.stream.getvalue(),
+ 'INFO my_module: test message\n')
+
+ def test_no_keywords_with_extras(self):
+ format_string = '%(levelname)s %(name)s%(extras)s: %(message)s'
+ formatter = daiquiri.formatter.ColorExtrasFormatter(fmt=format_string)
+ self.handler.setFormatter(formatter)
+
+ self.logger.info('test message', test="a")
+ self.assertEqual(self.stream.getvalue(),
+ 'INFO my_module [test: a]: test message\n')
+
+ def test_empty_keywords(self):
+ format_string = '%(levelname)s %(name)s%(extras)s: %(message)s'
+ formatter = daiquiri.formatter.ColorExtrasFormatter(fmt=format_string,
+ keywords=[])
+ self.handler.setFormatter(formatter)
+
+ self.logger.info('test message', test="a")
+ self.assertEqual(self.stream.getvalue(),
+ 'INFO my_module [test: a]: test message\n')
+
+ def test_keywords_no_extras(self):
+ format_string = ('%(levelname)s %(name)s'
+ ' %(test)s%(extras)s: %(message)s')
+ formatter = daiquiri.formatter.ColorExtrasFormatter(fmt=format_string,
+ keywords=["test"])
+ self.handler.setFormatter(formatter)
+
+ self.logger.info('test message', test="a")
+ self.assertEqual(self.stream.getvalue(),
+ 'INFO my_module a: test message\n')
+
+ def test_keywords_with_extras(self):
+ format_string = ('%(levelname)s %(name)s'
+ ' %(test)s%(extras)s: %(message)s')
+ formatter = daiquiri.formatter.ColorExtrasFormatter(fmt=format_string,
+ keywords=["test"])
+ self.handler.setFormatter(formatter)
+
+ self.logger.info('test message', test="a", test2="b")
+ self.assertEqual(self.stream.getvalue(),
+ 'INFO my_module a [test2: b]: test message\n')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri/tests/test_output.py
new/daiquiri-1.5.0/daiquiri/tests/test_output.py
--- old/daiquiri-1.2.1/daiquiri/tests/test_output.py 2017-07-10
15:30:22.000000000 +0200
+++ new/daiquiri-1.5.0/daiquiri/tests/test_output.py 2018-07-18
17:35:55.000000000 +0200
@@ -9,15 +9,14 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-from datetime import timedelta
import syslog
-
-import testtools
+import unittest
+from datetime import timedelta
from daiquiri import output
-class TestOutput(testtools.TestCase):
+class TestOutput(unittest.TestCase):
def test_find_facility(self):
self.assertEqual(syslog.LOG_USER,
output.Syslog._find_facility("user"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri.egg-info/PKG-INFO
new/daiquiri-1.5.0/daiquiri.egg-info/PKG-INFO
--- old/daiquiri-1.2.1/daiquiri.egg-info/PKG-INFO 2017-07-19
13:18:58.000000000 +0200
+++ new/daiquiri-1.5.0/daiquiri.egg-info/PKG-INFO 2018-07-18
17:36:19.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: daiquiri
-Version: 1.2.1
+Version: 1.5.0
Summary: Library to configure Python logging easily
Home-page: https://github.com/jd/daiquiri
Author: Julien Danjou
@@ -36,5 +36,8 @@
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Provides-Extra: test
+Provides-Extra: json
+Provides-Extra: systemd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri.egg-info/SOURCES.txt
new/daiquiri-1.5.0/daiquiri.egg-info/SOURCES.txt
--- old/daiquiri-1.2.1/daiquiri.egg-info/SOURCES.txt 2017-07-19
13:18:59.000000000 +0200
+++ new/daiquiri-1.5.0/daiquiri.egg-info/SOURCES.txt 2018-07-18
17:36:19.000000000 +0200
@@ -1,3 +1,4 @@
+.mergify.yml
.testr.conf
.travis.yml
AUTHORS
@@ -20,6 +21,7 @@
daiquiri.egg-info/top_level.txt
daiquiri/tests/__init__.py
daiquiri/tests/test_daiquiri.py
+daiquiri/tests/test_formatter.py
daiquiri/tests/test_output.py
doc/source/conf.py
doc/source/index.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri.egg-info/pbr.json
new/daiquiri-1.5.0/daiquiri.egg-info/pbr.json
--- old/daiquiri-1.2.1/daiquiri.egg-info/pbr.json 2017-07-19
13:18:58.000000000 +0200
+++ new/daiquiri-1.5.0/daiquiri.egg-info/pbr.json 2018-07-18
17:36:19.000000000 +0200
@@ -1 +1 @@
-{"git_version": "c1f2dc8", "is_release": true}
\ No newline at end of file
+{"git_version": "e197e62", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/daiquiri.egg-info/requires.txt
new/daiquiri-1.5.0/daiquiri.egg-info/requires.txt
--- old/daiquiri-1.2.1/daiquiri.egg-info/requires.txt 2017-07-19
13:18:58.000000000 +0200
+++ new/daiquiri-1.5.0/daiquiri.egg-info/requires.txt 2018-07-18
17:36:19.000000000 +0200
@@ -6,6 +6,5 @@
systemd-python>=234
[test]
-testrepository
-testtools
+pytest
six
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/doc/source/conf.py
new/daiquiri-1.5.0/doc/source/conf.py
--- old/daiquiri-1.2.1/doc/source/conf.py 2017-05-22 09:00:50.000000000
+0200
+++ new/daiquiri-1.5.0/doc/source/conf.py 2018-07-18 17:35:55.000000000
+0200
@@ -1,2 +1,3 @@
master_doc = 'index'
project = "Daiquiri"
+extensions = ['sphinx.ext.autodoc']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/doc/source/index.rst
new/daiquiri-1.5.0/doc/source/index.rst
--- old/daiquiri-1.2.1/doc/source/index.rst 2017-07-18 12:02:43.000000000
+0200
+++ new/daiquiri-1.5.0/doc/source/index.rst 2018-07-18 17:35:55.000000000
+0200
@@ -117,3 +117,23 @@
interval.
.. literalinclude:: ../../examples/files.py
+
+API
+===
+.. automodule:: daiquiri
+ :members:
+
+Output
+------
+.. automodule:: daiquiri.output
+ :members:
+
+Handlers
+--------
+.. automodule:: daiquiri.handlers
+ :members:
+
+Formatter
+---------
+.. automodule:: daiquiri.formatter
+ :members:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/examples/basic.py
new/daiquiri-1.5.0/examples/basic.py
--- old/daiquiri-1.2.1/examples/basic.py 2017-07-10 13:46:43.000000000
+0200
+++ new/daiquiri-1.5.0/examples/basic.py 2018-07-18 17:35:55.000000000
+0200
@@ -1,6 +1,7 @@
-import daiquiri
import logging
+import daiquiri
+
daiquiri.setup(level=logging.INFO)
logger = daiquiri.getLogger(__name__)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/examples/extra.py
new/daiquiri-1.5.0/examples/extra.py
--- old/daiquiri-1.2.1/examples/extra.py 2017-07-10 13:46:43.000000000
+0200
+++ new/daiquiri-1.5.0/examples/extra.py 2018-07-18 17:35:55.000000000
+0200
@@ -1,6 +1,7 @@
+import logging
+
import daiquiri
import daiquiri.formatter
-import logging
daiquiri.setup(level=logging.INFO, outputs=(
daiquiri.output.Stream(formatter=daiquiri.formatter.ColorFormatter(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/examples/files.py
new/daiquiri-1.5.0/examples/files.py
--- old/daiquiri-1.2.1/examples/files.py 2017-07-10 15:30:22.000000000
+0200
+++ new/daiquiri-1.5.0/examples/files.py 2018-07-18 17:35:55.000000000
+0200
@@ -1,7 +1,8 @@
-import daiquiri
import datetime
import logging
+import daiquiri
+
daiquiri.setup(
level=logging.DEBUG,
outputs=(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/examples/formatter.py
new/daiquiri-1.5.0/examples/formatter.py
--- old/daiquiri-1.2.1/examples/formatter.py 2017-07-10 13:46:43.000000000
+0200
+++ new/daiquiri-1.5.0/examples/formatter.py 2018-07-18 17:35:55.000000000
+0200
@@ -1,6 +1,7 @@
+import logging
+
import daiquiri
import daiquiri.formatter
-import logging
daiquiri.setup(level=logging.INFO, outputs=(
daiquiri.output.Stream(formatter=daiquiri.formatter.ColorFormatter(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/examples/output.py
new/daiquiri-1.5.0/examples/output.py
--- old/daiquiri-1.2.1/examples/output.py 2017-07-10 13:46:43.000000000
+0200
+++ new/daiquiri-1.5.0/examples/output.py 2018-07-18 17:35:55.000000000
+0200
@@ -1,7 +1,8 @@
-import daiquiri
import logging
import sys
+import daiquiri
+
# Log both to stdout and as JSON in a file called /dev/null. (Requires
# `python-json-logger`)
daiquiri.setup(level=logging.INFO, outputs=(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/examples/stringnames.py
new/daiquiri-1.5.0/examples/stringnames.py
--- old/daiquiri-1.2.1/examples/stringnames.py 2017-07-18 12:02:43.000000000
+0200
+++ new/daiquiri-1.5.0/examples/stringnames.py 2018-07-18 17:35:55.000000000
+0200
@@ -1,6 +1,7 @@
-import daiquiri
import logging
+import daiquiri
+
daiquiri.setup(level=logging.INFO, outputs=('stdout', 'stderr'))
logger = daiquiri.getLogger(__name__)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/setup.cfg new/daiquiri-1.5.0/setup.cfg
--- old/daiquiri-1.2.1/setup.cfg 2017-07-19 13:18:59.000000000 +0200
+++ new/daiquiri-1.5.0/setup.cfg 2018-07-18 17:36:19.000000000 +0200
@@ -15,8 +15,8 @@
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
- Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
+ Programming Language :: Python :: 3.7
[files]
packages =
@@ -24,8 +24,7 @@
[extras]
test =
- testrepository
- testtools
+ pytest
six
json =
python-json-logger
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/daiquiri-1.2.1/tox.ini new/daiquiri-1.5.0/tox.ini
--- old/daiquiri-1.2.1/tox.ini 2017-07-10 15:30:22.000000000 +0200
+++ new/daiquiri-1.5.0/tox.ini 2018-07-18 17:35:55.000000000 +0200
@@ -5,22 +5,20 @@
whitelist_externals = sh
deps = -e.[test,json]
commands =
- python setup.py test --slowest --testr-args='{posargs}'
+ pytest daiquiri
sh -c "for example in examples/*.py; do python $example; done"
sh -c "rm errors.log everything.log"
[testenv:pep8]
deps =
- pep8
- hacking>=0.13,<0.14
-commands =
- flake8
+ flake8
+ flake8-import-order
+commands = flake8
[flake8]
-# E123, E125 skipped as they are invalid PEP-8.
show-source = True
-ignore = E123,E125,H405,H102
-exclude=.git,.tox,dist,build
+exclude=.git,.tox,dist,build,.eggs
+application-import-names=daiquiri
[testenv:docs]
deps = sphinx