Hello community,
here is the log from the commit of package python-jaraco.logging for
openSUSE:Leap:15.2 checked in at 2020-04-22 14:14:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-jaraco.logging (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-jaraco.logging.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jaraco.logging"
Wed Apr 22 14:14:12 2020 rev:2 rq:796237 version:3.0.0
Changes:
--------
---
/work/SRC/openSUSE:Leap:15.2/python-jaraco.logging/python-jaraco.logging.changes
2020-03-27 16:48:11.439935669 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-jaraco.logging.new.2738/python-jaraco.logging.changes
2020-04-22 14:15:02.018751492 +0200
@@ -1,0 +2,6 @@
+Mon Mar 9 14:19:58 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Update to 3.0.0
+ * Require Python 3.6 or later.
+
+-------------------------------------------------------------------
Old:
----
jaraco.logging-2.0.tar.gz
New:
----
jaraco.logging-3.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jaraco.logging.spec ++++++
--- /var/tmp/diff_new_pack.l1o0sF/_old 2020-04-22 14:15:02.410752283 +0200
+++ /var/tmp/diff_new_pack.l1o0sF/_new 2020-04-22 14:15:02.410752283 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-jaraco.logging
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,25 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define skip_python2 1
Name: python-jaraco.logging
-Version: 2.0
+Version: 3.0.0
Release: 0
Summary: Tools to work with logging
License: MIT
Group: Development/Languages/Python
-Url: https://github.com/jaraco/jaraco.logging
+URL: https://github.com/jaraco/jaraco.logging
Source0:
https://files.pythonhosted.org/packages/source/j/jaraco.logging/jaraco.logging-%{version}.tar.gz
BuildRequires: %{python_module jaraco.base >= 6.1}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
-BuildRequires: %{python_module six}
BuildRequires: %{python_module tempora}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-jaraco.base >= 6.1
-Requires: python-six
Requires: python-tempora
BuildArch: noarch
-
%python_subpackages
%description
@@ -46,6 +44,7 @@
%prep
%setup -q -n jaraco.logging-%{version}
sed -i 's/--flake8//' pytest.ini
+sed -i 's/--black --cov//' pytest.ini
rm -rf jaraco.logging.egg-info
%build
@@ -62,9 +61,7 @@
}
%check
-%{python_expand py.test-%{$python_bin_suffix} \
- --ignore=_build.python2 --ignore=_build.python3
-}
+%pytest
%files %{python_files}
%license LICENSE
++++++ jaraco.logging-2.0.tar.gz -> jaraco.logging-3.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/.coveragerc
new/jaraco.logging-3.0.0/.coveragerc
--- old/jaraco.logging-2.0/.coveragerc 1970-01-01 01:00:00.000000000 +0100
+++ new/jaraco.logging-3.0.0/.coveragerc 2019-12-20 06:06:04.000000000
+0100
@@ -0,0 +1,5 @@
+[run]
+omit = .tox/*
+
+[report]
+show_missing = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/.flake8
new/jaraco.logging-3.0.0/.flake8
--- old/jaraco.logging-2.0/.flake8 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/.flake8 2019-12-20 06:06:04.000000000 +0100
@@ -1,8 +1,9 @@
[flake8]
+max-line-length = 88
ignore =
- # Allow tabs for indentation
- W191
# W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513
W503
# W504 has issues
https://github.com/OCA/maintainer-quality-tools/issues/545
W504
+ # Black creates whitespace before colon
+ E203
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/.pre-commit-config.yaml
new/jaraco.logging-3.0.0/.pre-commit-config.yaml
--- old/jaraco.logging-2.0/.pre-commit-config.yaml 1970-01-01
01:00:00.000000000 +0100
+++ new/jaraco.logging-3.0.0/.pre-commit-config.yaml 2019-12-20
06:06:04.000000000 +0100
@@ -0,0 +1,5 @@
+repos:
+- repo: https://github.com/psf/black
+ rev: 19.3b0
+ hooks:
+ - id: black
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/.travis.yml
new/jaraco.logging-3.0.0/.travis.yml
--- old/jaraco.logging-2.0/.travis.yml 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/.travis.yml 2019-12-20 06:06:04.000000000
+0100
@@ -1,11 +1,9 @@
dist: xenial
-sudo: false
language: python
python:
-- 2.7
- 3.6
-- &latest_py3 3.7
+- &latest_py3 3.8
jobs:
fast_finish: true
@@ -14,11 +12,6 @@
if: tag IS present
python: *latest_py3
before_script: skip
- env:
- - TWINE_USERNAME=jaraco
- # TWINE_PASSWORD
- - secure:
A9qddgr7qXDbBGFCy7AMwwNC32rrcrKlZyv6ENvbR59JJwrBqH9617Dg9FUi9Vl8VTpUjer0L3Ky1TSrwpwssQpHQwIVAr/cT4AicyEeRKrHNFLbXzp6Ilyvv2CvMnNzK0gBB6vJPAhk8vYdFw+PQbfq7XjCRbnDHIT6clQjNs7JOt0nOKkcE0QS9PsN6j7bY3JcbXmc/ofXKbi7i2UySY0WxDie730ruq4MwMbpq55CuAKXZm5yq9n6fnSp5TUceDow4YXYn48fdRYMd8HTBbMoEMer2KhxRUSBncgGNa/1M62PlkQjmTWNG1hfM+/TBjSYbP3dC+7iVLCzCt33AlwOc/FuGkSmIckvo3UdUNKby8iLaiyPths4yUQjNIh1W/uRRoGBYCq56iY/dGPmb5U0V9fV3hleaTguLVEpuEMcWRgSBAUvEC14JEFmXn1ZBzkZYZGTOQ0PBVlONkIRenQNXT+ZeINAYktIFkQWnOxbRjdgsvus26QgNm/hKQMcPctqA/B9bHKKg0fY8YbhV6GxQWqipyVMz9tHCWFYGHO8/c+fGJpv1XNH/GYaxZroEufzuV5XTVczwLVry/p5nFxMWPls2WBmQNS+HoBtKRTZUXJ8qtG5SjkpsrgD6OyrKRpAqsB2SvLrHqwnTSk+o42bNoGMqS5FokDqSCYunuc=
- - TOX_TESTENV_PASSENV="TWINE_USERNAME TWINE_PASSWORD"
script: tox -e release
cache: pip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/CHANGES.rst
new/jaraco.logging-3.0.0/CHANGES.rst
--- old/jaraco.logging-2.0/CHANGES.rst 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/CHANGES.rst 2019-12-20 06:06:04.000000000
+0100
@@ -1,3 +1,8 @@
+v3.0.0
+======
+
+Require Python 3.6 or later.
+
2.0
===
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/PKG-INFO
new/jaraco.logging-3.0.0/PKG-INFO
--- old/jaraco.logging-2.0/PKG-INFO 2019-01-01 16:59:41.000000000 +0100
+++ new/jaraco.logging-3.0.0/PKG-INFO 2019-12-20 06:06:25.498368500 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: jaraco.logging
-Version: 2.0
+Version: 3.0.0
Summary: Support for Python logging facility
Home-page: https://github.com/jaraco/jaraco.logging
Author: Jason R. Coombs
@@ -14,6 +14,10 @@
.. image::
https://img.shields.io/travis/jaraco/jaraco.logging/master.svg
:target: https://travis-ci.org/jaraco/jaraco.logging
+ .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
+ :target: https://github.com/psf/black
+ :alt: Code style: Black
+
.. .. image::
https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg
.. :target:
https://ci.appveyor.com/project/jaraco/skeleton/branch/master
@@ -34,8 +38,7 @@
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Requires-Python: >=2.7
+Requires-Python: >=3.6
Provides-Extra: testing
Provides-Extra: docs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/README.rst
new/jaraco.logging-3.0.0/README.rst
--- old/jaraco.logging-2.0/README.rst 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/README.rst 2019-12-20 06:06:04.000000000 +0100
@@ -6,6 +6,10 @@
.. image:: https://img.shields.io/travis/jaraco/jaraco.logging/master.svg
:target: https://travis-ci.org/jaraco/jaraco.logging
+.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
+ :target: https://github.com/psf/black
+ :alt: Code style: Black
+
.. .. image:: https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg
.. :target: https://ci.appveyor.com/project/jaraco/skeleton/branch/master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/appveyor.yml
new/jaraco.logging-3.0.0/appveyor.yml
--- old/jaraco.logging-2.0/appveyor.yml 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/appveyor.yml 2019-12-20 06:06:04.000000000
+0100
@@ -4,7 +4,7 @@
matrix:
- PYTHON: "C:\\Python36-x64"
- - PYTHON: "C:\\Python27-x64"
+ - PYTHON: "C:\\Python38-x64"
install:
# symlink python from a directory with a space
@@ -18,7 +18,7 @@
- '%LOCALAPPDATA%\pip\Cache'
test_script:
- - "python -m pip install tox tox-venv"
+ - "python -m pip install -U tox tox-venv virtualenv"
- "tox"
version: '{build}'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/docs/conf.py
new/jaraco.logging-3.0.0/docs/conf.py
--- old/jaraco.logging-2.0/docs/conf.py 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/docs/conf.py 2019-12-20 06:06:04.000000000
+0100
@@ -1,25 +1,25 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-extensions = ["sphinx.ext.autodoc", "jaraco.packaging.sphinx", "rst.linker"]
+extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker']
master_doc = "index"
link_files = {
- "../CHANGES.rst": dict(
- using=dict(GH="https://github.com"),
+ '../CHANGES.rst': dict(
+ using=dict(GH='https://github.com'),
replace=[
dict(
- pattern=r"(Issue #|\B#)(?P<issue>\d+)",
- url="{package_url}/issues/{issue}",
+ pattern=r'(Issue #|\B#)(?P<issue>\d+)',
+ url='{package_url}/issues/{issue}',
),
dict(
- pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
- with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n",
+ pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
+ with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
),
dict(
- pattern=r"PEP[- ](?P<pep_number>\d+)",
- url="https://www.python.org/dev/peps/pep-{pep_number:0>4}/",
+ pattern=r'PEP[- ](?P<pep_number>\d+)',
+ url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
),
],
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/jaraco/logging.py
new/jaraco.logging-3.0.0/jaraco/logging.py
--- old/jaraco.logging-2.0/jaraco/logging.py 2019-01-01 16:59:21.000000000
+0100
+++ new/jaraco.logging-3.0.0/jaraco/logging.py 2019-12-20 06:06:04.000000000
+0100
@@ -1,183 +1,199 @@
-from __future__ import absolute_import, unicode_literals
-
-import os
-import logging
-import time
-import datetime
-import string
-
-from six.moves import http_client
-
-import tempora
-
-
-def log_level(level_string):
- """
- Return a log level for a string
-
- >>> log_level('DEBUG') == logging.DEBUG
- True
- >>> log_level('30') == logging.WARNING
- True
- """
- if level_string.isdigit():
- return int(level_string)
- return getattr(logging, level_string.upper())
-
-
-def add_arguments(parser, default_level=logging.INFO):
- """
- Add arguments to an ArgumentParser or OptionParser for purposes of
- grabbing a logging level.
- """
- adder = (
- getattr(parser, 'add_argument', None)
- or getattr(parser, 'add_option')
- )
- adder(
- '-l', '--log-level', default=default_level, type=log_level,
- help="Set log level (DEBUG, INFO, WARNING, ERROR)")
-
-
-def setup(options, **kwargs):
- """
- Setup logging with options or arguments from an OptionParser or
- ArgumentParser. Also pass any keyword arguments to the basicConfig
- call.
- """
- params = dict(kwargs)
- params.update(level=options.log_level)
- logging.basicConfig(**params)
-
-
-def setup_requests_logging(level):
- """
- Setup logging for 'requests' such that it logs details about the
- connection, headers, etc.
- """
- requests_log = logging.getLogger("requests.packages.urllib3")
- requests_log.setLevel(level)
- requests_log.propagate = True
-
- # enable debugging at httplib level
- http_client.HTTPConnection.debuglevel = level <= logging.DEBUG
-
-
-class TimestampFileHandler(logging.StreamHandler):
- """
- A logging handler which will log to a file, similar to
- logging.handlers.RotatingFileHandler, but instead of
- appending a number, uses a timestamp to periodically select
- new file names to log to.
-
- Since this was developed, a TimedRotatingFileHandler was added to
- the Python stdlib. This class is still useful because it allows the
period
- to be specified using simple english words.
- """
- def __init__(self, base_filename, mode='a', period='day'):
- self.base_filename = base_filename
- self.mode = mode
- self._set_period(period)
- logging.StreamHandler.__init__(self, None)
-
- def _set_period(self, period):
- """
- Set the period for the timestamp. If period is 0 or None, no
period
- will be used.
- """
- self._period = period
- if period:
- self._period_seconds =
tempora.get_period_seconds(self._period)
- self._date_format = tempora.get_date_format_string(
- self._period_seconds)
- else:
- self._period_seconds = 0
- self._date_format = ''
-
- def _get_period(self):
- return self._period
- period = property(_get_period, _set_period)
-
- def _use_file(self, filename):
- self._ensure_directory_exists(filename)
- self.stream = open(filename, self.mode)
-
- def _ensure_directory_exists(self, filename):
- dirname = os.path.dirname(filename)
- if dirname and not os.path.exists(dirname):
- os.makedirs(dirname)
-
- def get_filename(self, t):
- """
- Return the appropriate filename for the given time
- based on the defined period.
- """
- root, ext = os.path.splitext(self.base_filename)
- # remove seconds not significant to the period
- if self._period_seconds:
- t -= t % self._period_seconds
- # convert it to a datetime object for formatting
- dt = datetime.datetime.utcfromtimestamp(t)
- # append the datestring to the filename
- # workaround for datetime.strftime not handling '' properly
- appended_date = (
- dt.strftime(self._date_format)
- if self._date_format != '' else ''
- )
- if appended_date:
- # in the future, it would be nice for this format
- # to be supplied as a parameter.
- result = root + ' ' + appended_date + ext
- else:
- result = self.base_filename
- return result
-
- def emit(self, record):
- """
- Emit a record.
-
- Output the record to the file, ensuring that the currently-
- opened file has the correct date.
- """
- now = time.time()
- current_name = self.get_filename(now)
- try:
- if not self.stream.name == current_name:
- self._use_file(current_name)
- except AttributeError:
- # a stream has not been created, so create one.
- self._use_file(current_name)
- logging.StreamHandler.emit(self, record)
-
- def close(self):
- """
- Closes the stream.
- """
- try:
- self.stream.close()
- except AttributeError:
- pass
-
-
-class LogFileWrapper(object):
- """
- Emulates a file to replace stdout or stderr or
- anothe file object and redirects its output to
- a logger.
-
- Since data will often be send in partial lines or
- multiple lines, data is queued up until a new line
- is received. Each line of text is send to the
- logger separately.
- """
- def __init__(self, name, lvl=logging.DEBUG):
- self.logger = logging.getLogger(name)
- self.lvl = lvl
- self.queued = ''
-
- def write(self, data):
- data = self.queued + data
- data = string.split(data, '\n')
- for line in data[:-1]:
- self.logger.log(self.lvl, line)
- self.queued = data[-1]
+import os
+import logging
+import time
+import datetime
+import string
+import http.client
+
+import tempora
+
+
+def log_level(level_string):
+ """
+ Return a log level for a string
+
+ >>> log_level('DEBUG') == logging.DEBUG
+ True
+ >>> log_level('30') == logging.WARNING
+ True
+ """
+ if level_string.isdigit():
+ return int(level_string)
+ return getattr(logging, level_string.upper())
+
+
+def add_arguments(parser, default_level=logging.INFO):
+ """
+ Add arguments to an ArgumentParser or OptionParser for purposes of
+ grabbing a logging level.
+
+ >>> import argparse
+ >>> add_arguments(argparse.ArgumentParser())
+ """
+ adder = getattr(parser, 'add_argument', None) or getattr(parser,
'add_option')
+ adder(
+ '-l',
+ '--log-level',
+ default=default_level,
+ type=log_level,
+ help="Set log level (DEBUG, INFO, WARNING, ERROR)",
+ )
+
+
+def setup(options, **kwargs):
+ """
+ Setup logging with options or arguments from an OptionParser or
+ ArgumentParser. Also pass any keyword arguments to the basicConfig
+ call.
+
+ >>> import argparse
+ >>> parser = argparse.ArgumentParser()
+ >>> add_arguments(parser)
+ >>> monkeypatch = getfixture('monkeypatch')
+ >>> monkeypatch.setattr(logging, 'basicConfig', lambda **kwargs:
print(kwargs))
+ >>> setup(parser.parse_args([]))
+ {'level': 20}
+ """
+ params = dict(kwargs)
+ params.update(level=options.log_level)
+ logging.basicConfig(**params)
+
+
+def setup_requests_logging(level):
+ """
+ Setup logging for 'requests' such that it logs details about the
+ connection, headers, etc.
+
+ >>> monkeypatch = getfixture('monkeypatch')
+ >>> monkeypatch.setattr(http.client.HTTPConnection, 'debuglevel', None)
+ >>> setup_requests_logging(logging.DEBUG)
+ >>> http.client.HTTPConnection.debuglevel
+ True
+ """
+ requests_log = logging.getLogger("requests.packages.urllib3")
+ requests_log.setLevel(level)
+ requests_log.propagate = True
+
+ # enable debugging at httplib level
+ http.client.HTTPConnection.debuglevel = level <= logging.DEBUG
+
+
+class TimestampFileHandler(logging.StreamHandler):
+ """
+ A logging handler which will log to a file, similar to
+ logging.handlers.RotatingFileHandler, but instead of
+ appending a number, uses a timestamp to periodically select
+ new file names to log to.
+
+ Since this was developed, a TimedRotatingFileHandler was added to
+ the Python stdlib. This class is still useful because it allows the period
+ to be specified using simple english words.
+ """
+
+ def __init__(self, base_filename, mode='a', period='day'):
+ self.base_filename = base_filename
+ self.mode = mode
+ self._set_period(period)
+ logging.StreamHandler.__init__(self, None)
+
+ def _set_period(self, period):
+ """
+ Set the period for the timestamp. If period is 0 or None, no period
+ will be used.
+ """
+ self._period = period
+ if period:
+ self._period_seconds = tempora.get_period_seconds(self._period)
+ self._date_format =
tempora.get_date_format_string(self._period_seconds)
+ else:
+ self._period_seconds = 0
+ self._date_format = ''
+
+ def _get_period(self):
+ return self._period
+
+ period = property(_get_period, _set_period)
+
+ def _use_file(self, filename):
+ self._ensure_directory_exists(filename)
+ self.stream = open(filename, self.mode)
+
+ def _ensure_directory_exists(self, filename):
+ dirname = os.path.dirname(filename)
+ if dirname and not os.path.exists(dirname):
+ os.makedirs(dirname)
+
+ def get_filename(self, t):
+ """
+ Return the appropriate filename for the given time
+ based on the defined period.
+ """
+ root, ext = os.path.splitext(self.base_filename)
+ # remove seconds not significant to the period
+ if self._period_seconds:
+ t -= t % self._period_seconds
+ # convert it to a datetime object for formatting
+ dt = datetime.datetime.utcfromtimestamp(t)
+ # append the datestring to the filename
+ # workaround for datetime.strftime not handling '' properly
+ appended_date = (
+ dt.strftime(self._date_format) if self._date_format != '' else ''
+ )
+ if appended_date:
+ # in the future, it would be nice for this format
+ # to be supplied as a parameter.
+ result = root + ' ' + appended_date + ext
+ else:
+ result = self.base_filename
+ return result
+
+ def emit(self, record):
+ """
+ Emit a record.
+
+ Output the record to the file, ensuring that the currently-
+ opened file has the correct date.
+ """
+ now = time.time()
+ current_name = self.get_filename(now)
+ try:
+ if not self.stream.name == current_name:
+ self._use_file(current_name)
+ except AttributeError:
+ # a stream has not been created, so create one.
+ self._use_file(current_name)
+ logging.StreamHandler.emit(self, record)
+
+ def close(self):
+ """
+ Closes the stream.
+ """
+ try:
+ self.stream.close()
+ except AttributeError:
+ pass
+
+
+class LogFileWrapper(object):
+ """
+ Emulates a file to replace stdout or stderr or
+ anothe file object and redirects its output to
+ a logger.
+
+ Since data will often be send in partial lines or
+ multiple lines, data is queued up until a new line
+ is received. Each line of text is send to the
+ logger separately.
+ """
+
+ def __init__(self, name, lvl=logging.DEBUG):
+ self.logger = logging.getLogger(name)
+ self.lvl = lvl
+ self.queued = ''
+
+ def write(self, data):
+ data = self.queued + data
+ data = string.split(data, '\n')
+ for line in data[:-1]:
+ self.logger.log(self.lvl, line)
+ self.queued = data[-1]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/jaraco.logging.egg-info/PKG-INFO
new/jaraco.logging-3.0.0/jaraco.logging.egg-info/PKG-INFO
--- old/jaraco.logging-2.0/jaraco.logging.egg-info/PKG-INFO 2019-01-01
16:59:41.000000000 +0100
+++ new/jaraco.logging-3.0.0/jaraco.logging.egg-info/PKG-INFO 2019-12-20
06:06:25.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: jaraco.logging
-Version: 2.0
+Version: 3.0.0
Summary: Support for Python logging facility
Home-page: https://github.com/jaraco/jaraco.logging
Author: Jason R. Coombs
@@ -14,6 +14,10 @@
.. image::
https://img.shields.io/travis/jaraco/jaraco.logging/master.svg
:target: https://travis-ci.org/jaraco/jaraco.logging
+ .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
+ :target: https://github.com/psf/black
+ :alt: Code style: Black
+
.. .. image::
https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg
.. :target:
https://ci.appveyor.com/project/jaraco/skeleton/branch/master
@@ -34,8 +38,7 @@
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Requires-Python: >=2.7
+Requires-Python: >=3.6
Provides-Extra: testing
Provides-Extra: docs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jaraco.logging-2.0/jaraco.logging.egg-info/SOURCES.txt
new/jaraco.logging-3.0.0/jaraco.logging.egg-info/SOURCES.txt
--- old/jaraco.logging-2.0/jaraco.logging.egg-info/SOURCES.txt 2019-01-01
16:59:41.000000000 +0100
+++ new/jaraco.logging-3.0.0/jaraco.logging.egg-info/SOURCES.txt
2019-12-20 06:06:25.000000000 +0100
@@ -1,4 +1,6 @@
+.coveragerc
.flake8
+.pre-commit-config.yaml
.readthedocs.yml
.travis.yml
CHANGES.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jaraco.logging-2.0/jaraco.logging.egg-info/requires.txt
new/jaraco.logging-3.0.0/jaraco.logging.egg-info/requires.txt
--- old/jaraco.logging-2.0/jaraco.logging.egg-info/requires.txt 2019-01-01
16:59:41.000000000 +0100
+++ new/jaraco.logging-3.0.0/jaraco.logging.egg-info/requires.txt
2019-12-20 06:06:25.000000000 +0100
@@ -8,5 +8,7 @@
[testing]
pytest!=3.7.3,>=3.5
-pytest-checkdocs
+pytest-checkdocs>=1.2.3
pytest-flake8
+pytest-black-multipy
+pytest-cov
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/pyproject.toml
new/jaraco.logging-3.0.0/pyproject.toml
--- old/jaraco.logging-2.0/pyproject.toml 2019-01-01 16:59:21.000000000
+0100
+++ new/jaraco.logging-3.0.0/pyproject.toml 2019-12-20 06:06:04.000000000
+0100
@@ -1,3 +1,6 @@
[build-system]
requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"]
build-backend = "setuptools.build_meta"
+
+[tool.black]
+skip-string-normalization = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/pytest.ini
new/jaraco.logging-3.0.0/pytest.ini
--- old/jaraco.logging-2.0/pytest.ini 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/pytest.ini 2019-12-20 06:06:04.000000000 +0100
@@ -1,11 +1,5 @@
[pytest]
norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8
+addopts=--doctest-modules --flake8 --black --cov
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
filterwarnings=
- ignore:Possible nested set::pycodestyle:113
- ignore:Using or importing the ABCs::flake8:410
- # workaround for https://sourceforge.net/p/docutils/bugs/348/
- ignore:'U' mode is deprecated::docutils.io
- # workaround for https://gitlab.com/pycqa/flake8/issues/275
- ignore:You passed a bytestring as `filenames`.::flake8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/setup.cfg
new/jaraco.logging-3.0.0/setup.cfg
--- old/jaraco.logging-2.0/setup.cfg 2019-01-01 16:59:41.000000000 +0100
+++ new/jaraco.logging-3.0.0/setup.cfg 2019-12-20 06:06:25.498368500 +0100
@@ -13,13 +13,12 @@
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
- Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
[options]
packages = find:
include_package_data = true
-python_requires = >=2.7
+python_requires = >=3.6
install_requires =
tempora
six
@@ -28,8 +27,10 @@
[options.extras_require]
testing =
pytest >= 3.5, !=3.7.3
- pytest-checkdocs
+ pytest-checkdocs >= 1.2.3
pytest-flake8
+ pytest-black-multipy
+ pytest-cov
docs =
sphinx
jaraco.packaging >= 3.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/skeleton.md
new/jaraco.logging-3.0.0/skeleton.md
--- old/jaraco.logging-2.0/skeleton.md 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/skeleton.md 2019-12-20 06:06:04.000000000
+0100
@@ -10,6 +10,8 @@
The primary advantage to using an SCM for maintaining these techniques is that
those tools help facilitate the merge between the template and its adopting
projects.
+Another advantage to using an SCM-managed approach is that tools like GitHub
recognize that a change in the skeleton is the _same change_ across all
projects that merge with that skeleton. Without the ancestry, with a
traditional copy/paste approach, a [commit like
this](https://github.com/jaraco/skeleton/commit/12eed1326e1bc26ce256e7b3f8cd8d3a5beab2d5)
would produce notifications in the upstream project issue for each and every
application, but because it's centralized, GitHub provides just the one
notification when the change is added to the skeleton.
+
# Usage
## new projects
@@ -48,7 +50,8 @@
- setuptools declarative configuration using setup.cfg
- tox for running tests
- A README.rst as reStructuredText with some popular badges, but with
readthedocs and appveyor badges commented out
-- A CHANGES.rst file intended for publishing release notes about the project.
+- A CHANGES.rst file intended for publishing release notes about the project
+- Use of [black](https://black.readthedocs.io/en/stable/) for code formatting
(disabled on unsupported Python 3.5 and earlier)
## Packaging Conventions
@@ -82,7 +85,7 @@
Other environments (invoked with `tox -e {name}`) supplied include:
- - a `build-docs` environment to build the documentation
+ - a `docs` environment to build the documentation
- a `release` environment to publish the package to PyPI
A pytest.ini is included to define common options around running tests. In
particular:
@@ -95,18 +98,12 @@
Relies a .flake8 file to correct some default behaviors:
-- allow tabs for indentation (legacy for jaraco projects)
-- disable mutually incompatible rules W503 and W504.
+- disable mutually incompatible rules W503 and W504
+- support for black format
## Continuous Integration
-The project is pre-configured to run tests in
[Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be
enabled either through their web site or with the `travis enable` command. In
addition to running tests, an additional deploy stage is configured to
automatically release tagged commits. The username and password for PyPI must
be configured for each project using the `travis` command and only after the
travis project is created. As releases are cut with
[twine](https://pypi.org/project/twine), the two values are supplied through
the `TWINE_USERNAME` and `TWINE_PASSWORD`. To configure the latter as a secret,
run the following command:
-
-```
-echo "TWINE_PASSWORD={password}" | travis encrypt
-```
-
-Or disable it in the CI definition and configure it through the web UI.
+The project is pre-configured to run tests in
[Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be
enabled either through their web site or with the `travis enable` command.
Features include:
- test against Python 2 and 3
@@ -115,12 +112,26 @@
Also provided is a minimal template for running under Appveyor (Windows).
+### Continuous Deployments
+
+In addition to running tests, an additional deploy stage is configured to
automatically release tagged commits to PyPI using [API
tokens](https://pypi.org/help/#apitoken). The release process expects an
authorized token to be configured with Travis as the TWINE_PASSWORD environment
variable. After the Travis project is created, configure the token through the
web UI or with a command like the following (bash syntax):
+
+```
+TWINE_PASSWORD={token} travis env copy TWINE_PASSWORD
+```
+
## Building Documentation
-Documentation is automatically built by [Read the
Docs](https://readthedocs.org) when the project is registered with it, by way
of the .readthedocs.yml file. To test the docs build manually, a tox env may be
invoked as `tox -e build-docs`. Both techniques rely on the dependencies
declared in `setup.cfg/options.extras_require.docs`.
+Documentation is automatically built by [Read the
Docs](https://readthedocs.org) when the project is registered with it, by way
of the .readthedocs.yml file. To test the docs build manually, a tox env may be
invoked as `tox -e docs`. Both techniques rely on the dependencies declared in
`setup.cfg/options.extras_require.docs`.
In addition to building the sphinx docs scaffolded in `docs/`, the docs build
a `history.html` file that first injects release dates and hyperlinks into the
CHANGES.rst before incorporating it as history in the docs.
## Cutting releases
By default, tagged commits are released through the continuous integration
deploy stage.
+
+Releases may also be cut manually by invoking the tox environment `release`
with the PyPI token set as the TWINE_PASSWORD:
+
+```
+TWINE_PASSWORD={token} tox -e release
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jaraco.logging-2.0/tox.ini
new/jaraco.logging-3.0.0/tox.ini
--- old/jaraco.logging-2.0/tox.ini 2019-01-01 16:59:21.000000000 +0100
+++ new/jaraco.logging-3.0.0/tox.ini 2019-12-20 06:06:04.000000000 +0100
@@ -1,30 +1,41 @@
[tox]
envlist = python
-minversion = 2.4
+minversion = 3.2
+# https://github.com/jaraco/skeleton/issues/6
+tox_pip_extensions_ext_venv_update = true
+# Ensure that a late version of pip is used even on tox-venv.
+requires =
+ tox-pip-version>=0.0.6
+ tox-venv
+
[testenv]
deps =
setuptools>=31.0.1
+pip_version = pip
commands =
pytest {posargs}
usedevelop = True
extras = testing
-[testenv:build-docs]
+[testenv:docs]
extras =
- docs
- testing
+ docs
+ testing
changedir = docs
commands =
- python -m sphinx . {toxinidir}/build/html
+ python -m sphinx . {toxinidir}/build/html
[testenv:release]
skip_install = True
deps =
pep517>=0.5
- # workaround for https://github.com/pypa/twine/issues/423
- git+https://github.com/pypa/twine
- path.py
+ twine[keyring]>=1.13
+ path
+passenv =
+ TWINE_PASSWORD
+setenv =
+ TWINE_USERNAME = {env:TWINE_USERNAME:__token__}
commands =
python -c "import path; path.Path('dist').rmtree_p()"
python -m pep517.build .