Hello community,
here is the log from the commit of package python-docformatter for openSUSE:Factory checked in at 2019-03-10 09:40:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-docformatter (Old)
and /work/SRC/openSUSE:Factory/.python-docformatter.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-docformatter"
Sun Mar 10 09:40:20 2019 rev:4 rq:682864 version:1.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-docformatter/python-docformatter.changes 2018-12-13 19:43:14.905106249 +0100
+++ /work/SRC/openSUSE:Factory/.python-docformatter.new.28833/python-docformatter.changes 2019-03-10 09:40:21.712104594 +0100
@@ -1,0 +2,7 @@
+Fri Mar 8 14:28:00 UTC 2019 - Tomáš Chvátal
+
+- Update to 1.1:
+ * fixes for python 3.7
+ * varioius cleanups
+
+-------------------------------------------------------------------
Old:
----
docformatter-1.0.tar.gz
New:
----
docformatter-1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-docformatter.spec ++++++
--- /var/tmp/diff_new_pack.2sRDhZ/_old 2019-03-10 09:40:22.340104443 +0100
+++ /var/tmp/diff_new_pack.2sRDhZ/_new 2019-03-10 09:40:22.344104442 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-docformatter
#
-# 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-docformatter
-Version: 1.0
+Version: 1.1
Release: 0
Summary: Utility to re-format docstrings per PEP 257
License: MIT
++++++ docformatter-1.0.tar.gz -> docformatter-1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/LICENSE new/docformatter-1.1/LICENSE
--- old/docformatter-1.0/LICENSE 1970-01-01 01:00:00.000000000 +0100
+++ new/docformatter-1.1/LICENSE 2018-05-26 00:46:35.000000000 +0200
@@ -0,0 +1,19 @@
+Copyright (C) 2012-2018 Steven Myint
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/MANIFEST.in new/docformatter-1.1/MANIFEST.in
--- old/docformatter-1.0/MANIFEST.in 2014-03-01 04:41:42.000000000 +0100
+++ new/docformatter-1.1/MANIFEST.in 2018-06-14 15:54:54.000000000 +0200
@@ -1,7 +1,9 @@
include AUTHORS.rst
+include LICENSE
include MANIFEST.in
include README.rst
include test_docformatter.py
+exclude .pre-commit-hooks.yaml
exclude .travis.yml
exclude Makefile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/PKG-INFO new/docformatter-1.1/PKG-INFO
--- old/docformatter-1.0/PKG-INFO 2018-02-21 16:04:42.000000000 +0100
+++ new/docformatter-1.1/PKG-INFO 2019-03-02 18:02:17.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: docformatter
-Version: 1.0
+Version: 1.1
Summary: Formats docstrings to follow PEP 257.
Home-page: https://github.com/myint/docformatter
Author: Steven Myint
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/docformatter.egg-info/PKG-INFO new/docformatter-1.1/docformatter.egg-info/PKG-INFO
--- old/docformatter-1.0/docformatter.egg-info/PKG-INFO 2018-02-21 16:04:42.000000000 +0100
+++ new/docformatter-1.1/docformatter.egg-info/PKG-INFO 2019-03-02 18:02:17.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: docformatter
-Version: 1.0
+Version: 1.1
Summary: Formats docstrings to follow PEP 257.
Home-page: https://github.com/myint/docformatter
Author: Steven Myint
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/docformatter.egg-info/SOURCES.txt new/docformatter-1.1/docformatter.egg-info/SOURCES.txt
--- old/docformatter-1.0/docformatter.egg-info/SOURCES.txt 2018-02-21 16:04:42.000000000 +0100
+++ new/docformatter-1.1/docformatter.egg-info/SOURCES.txt 2019-03-02 18:02:17.000000000 +0100
@@ -1,4 +1,5 @@
AUTHORS.rst
+LICENSE
MANIFEST.in
README.rst
docformatter.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/docformatter.py new/docformatter-1.1/docformatter.py
--- old/docformatter-1.0/docformatter.py 2018-02-21 16:03:56.000000000 +0100
+++ new/docformatter-1.1/docformatter.py 2019-03-02 18:01:48.000000000 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (C) 2012-2016 Steven Myint
+# Copyright (C) 2012-2019 Steven Myint
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -41,7 +41,7 @@
import untokenize
-__version__ = '1.0'
+__version__ = '1.1'
try:
@@ -341,6 +341,8 @@
re.match(r'.*\s+[\-*:=@]\s+', line) or
# "parameter: description"
re.match(r'\s*\S+[\-*:=@]\s+', line) or
+ # "parameter:\n description"
+ re.match(r'\s*\S+:\s*$', line) or
# "parameter -- description"
re.match(r'\s*\S+\s+--\s+', line)
):
@@ -351,10 +353,7 @@
def is_some_sort_of_code(text):
"""Return True if text looks like code."""
- for word in text.split():
- if len(word) > 50:
- return True
- return False
+ return any(len(word) > 50 for word in text.split())
def _find_shortest_indentation(lines):
@@ -376,21 +375,13 @@
def strip_docstring(docstring):
"""Return contents of docstring."""
docstring = docstring.strip()
+ quote_types = ["'''", '"""', "'", '"']
- if docstring.startswith("'''"):
- quote = "'''"
- elif docstring.startswith('"""'):
- quote = '"""'
- elif docstring.startswith("'"):
- quote = "'"
- elif docstring.startswith('"'):
- quote = '"'
- else:
- raise ValueError('We only handle strings that start with quotes')
-
- assert docstring.endswith(quote)
+ for quote in quote_types:
+ if docstring.startswith(quote) and docstring.endswith(quote):
+ return docstring.split(quote, 1)[1].rsplit(quote, 1)[0].strip()
- return docstring.split(quote, 1)[1].rsplit(quote, 1)[0].strip()
+ raise ValueError('We only handle strings that start with quotes')
def normalize_summary(summary):
@@ -459,10 +450,10 @@
return text
first = stripped[0]
- if (
- not first.isalnum() and
- not first.isspace() and
- not stripped.splitlines()[0].strip(first).strip()
+ if not (
+ first.isalnum() or
+ first.isspace() or
+ stripped.splitlines()[0].strip(first).strip()
):
return stripped.lstrip(first).lstrip()
@@ -541,7 +532,7 @@
def _main(argv, standard_out, standard_error, standard_in):
- """Internal main entry point."""
+ """Run internal main entry point."""
import argparse
parser = argparse.ArgumentParser(description=__doc__, prog='docformatter')
parser.add_argument('-i', '--in-place', action='store_true',
@@ -631,27 +622,41 @@
return locale.getpreferredencoding() or sys.getdefaultencoding()
+def find_py_files(sources, recursive):
+ """Find Python source files.
+
+ Parameters:
+ - sources: iterable with paths as strings.
+ - recursive: drill down directories if True.
+
+ Return: yields paths to found files.
+ """
+ def not_hidden(name):
+ """Return True if file 'name' isn't .hidden."""
+ return not name.startswith('.')
+
+ for name in sorted(sources):
+ if recursive and os.path.isdir(name):
+ for root, dirs, children in os.walk(unicode(name)):
+ dirs[:] = sorted(filter(not_hidden, dirs))
+ for filename in sorted(filter(not_hidden, children)):
+ if filename.endswith('.py'):
+ yield os.path.join(root, filename)
+ else:
+ yield name
+
+
def _format_files(args, standard_out, standard_error):
"""Format multiple files."""
- filenames = list(set(args.files))
- while filenames:
- name = filenames.pop(0)
- if args.recursive and os.path.isdir(name):
- for root, directories, children in os.walk(unicode(name)):
- filenames += [os.path.join(root, f) for f in children
- if f.endswith('.py') and
- not f.startswith('.')]
- directories[:] = [d for d in directories
- if not d.startswith('.')]
- else:
- try:
- format_file(name, args=args, standard_out=standard_out)
- except IOError as exception:
- print(unicode(exception), file=standard_error)
+ for filename in find_py_files(set(args.files), args.recursive):
+ try:
+ format_file(filename, args=args, standard_out=standard_out)
+ except IOError as exception:
+ print(unicode(exception), file=standard_error)
def main():
- """Main entry point."""
+ """Run main entry point."""
try:
# Exit on broken pipe.
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/setup.cfg new/docformatter-1.1/setup.cfg
--- old/docformatter-1.0/setup.cfg 2018-02-21 16:04:42.000000000 +0100
+++ new/docformatter-1.1/setup.cfg 2019-03-02 18:02:17.000000000 +0100
@@ -1,5 +1,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docformatter-1.0/test_docformatter.py new/docformatter-1.1/test_docformatter.py
--- old/docformatter-1.0/test_docformatter.py 2018-01-05 17:52:36.000000000 +0100
+++ new/docformatter-1.1/test_docformatter.py 2019-02-09 19:42:35.000000000 +0100
@@ -1074,6 +1074,12 @@
release-1.5/
"""))
+ def test_is_some_sort_of_list_of_parameter_list_with_newline(self):
+ self.assertTrue(docformatter.is_some_sort_of_list("""\
+Args:
+ stream (BinaryIO): Binary stream (usually a file object).
+"""))
+
def test_is_some_sort_of_code(self):
self.assertTrue(docformatter.is_some_sort_of_code("""\
__________=__________(__________,__________,__________,__________[