Hello community, here is the log from the commit of package python-twine for openSUSE:Factory checked in at 2020-02-29 21:18:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-twine (Old) and /work/SRC/openSUSE:Factory/.python-twine.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-twine" Sat Feb 29 21:18:48 2020 rev:8 rq:779031 version:1.15.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-twine/python-twine.changes 2019-09-23 12:03:42.965941969 +0200 +++ /work/SRC/openSUSE:Factory/.python-twine.new.26092/python-twine.changes 2020-02-29 21:18:48.770038773 +0100 @@ -1,0 +2,7 @@ +Tue Feb 25 11:22:38 UTC 2020 - Ondřej Súkup <mimi...@gmail.com> + +- update to 1.15.0 +- last with python2 +- Improved output on check command + +------------------------------------------------------------------- Old: ---- twine-1.14.0.tar.gz New: ---- twine-1.15.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-twine.spec ++++++ --- /var/tmp/diff_new_pack.kv8hRi/_old 2020-02-29 21:18:49.646038354 +0100 +++ /var/tmp/diff_new_pack.kv8hRi/_new 2020-02-29 21:18:49.654038350 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-twine # -# 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 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-twine -Version: 1.14.0 +Version: 1.15.0 Release: 0 Summary: Collection of utilities for interacting with PyPI License: Apache-2.0 ++++++ twine-1.14.0.tar.gz -> twine-1.15.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/twine-1.14.0/PKG-INFO new/twine-1.15.0/PKG-INFO --- old/twine-1.14.0/PKG-INFO 2019-09-07 23:30:47.000000000 +0200 +++ new/twine-1.15.0/PKG-INFO 2019-09-17 17:42:02.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: twine -Version: 1.14.0 +Version: 1.15.0 Summary: Collection of utilities for publishing packages on PyPI Home-page: https://twine.readthedocs.io/ Author: Donald Stufft and individual contributors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/twine-1.14.0/docs/changelog.rst new/twine-1.15.0/docs/changelog.rst --- old/twine-1.14.0/docs/changelog.rst 2019-09-07 23:21:42.000000000 +0200 +++ new/twine-1.15.0/docs/changelog.rst 2019-09-17 17:36:48.000000000 +0200 @@ -3,6 +3,11 @@ ========= Changelog ========= +* :release:`1.15.0 <2019-09-17>` +* :feature:`488` Improved output on ``check`` command: + Prints a message when there are no distributions given to check. + Improved handling of errors in a distribution's markup, avoiding + messages flowing through to the next distribution's errors. * :release:`1.14.0 <2019-09-06>` * :feature:`456` Better error handling and gpg2 fallback if gpg not available. * :bug:`341` Fail more gracefully when encountering bad metadata diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/twine-1.14.0/tests/test_check.py new/twine-1.15.0/tests/test_check.py --- old/twine-1.14.0/tests/test_check.py 2019-02-09 21:57:47.000000000 +0100 +++ new/twine-1.15.0/tests/test_check.py 2019-09-17 17:36:48.000000000 +0200 @@ -18,31 +18,31 @@ from twine.commands import check -def test_warningstream_write_match(): - stream = check._WarningStream() - stream.output = pretend.stub(write=pretend.call_recorder(lambda a: None)) +class TestWarningStream: - stream.write("<string>:2: (WARNING/2) Title underline too short.") + def setup(self): + self.stream = check._WarningStream() + self.stream.output = pretend.stub( + write=pretend.call_recorder(lambda a: None), + getvalue=lambda: "result", + ) + + def test_write_match(self): + self.stream.write("<string>:2: (WARNING/2) Title underline too short.") + + assert self.stream.output.write.calls == [ + pretend.call("line 2: Warning: Title underline too short.\n") + ] + + def test_write_nomatch(self): + self.stream.write("this does not match") + + assert self.stream.output.write.calls == [ + pretend.call("this does not match") + ] - assert stream.output.write.calls == [ - pretend.call("line 2: Warning: Title underline too short.\n") - ] - - -def test_warningstream_write_nomatch(): - stream = check._WarningStream() - stream.output = pretend.stub(write=pretend.call_recorder(lambda a: None)) - - stream.write("this does not match") - - assert stream.output.write.calls == [pretend.call("this does not match")] - - -def test_warningstream_str(): - stream = check._WarningStream() - stream.output = pretend.stub(getvalue=lambda: "result") - - assert str(stream) == "result" + def test_str_representation(self): + assert str(self.stream) == "result" def test_check_no_distributions(monkeypatch): @@ -51,7 +51,7 @@ monkeypatch.setattr(check, "_find_dists", lambda a: []) assert not check.check("dist/*", output_stream=stream) - assert stream.getvalue() == "" + assert stream.getvalue() == "No files to check.\n" def test_check_passing_distribution(monkeypatch): @@ -74,10 +74,7 @@ monkeypatch.setattr(check, "_WarningStream", lambda: warning_stream) assert not check.check("dist/*", output_stream=output_stream) - assert ( - output_stream.getvalue() - == "Checking distribution dist/dist.tar.gz: Passed\n" - ) + assert output_stream.getvalue() == "Checking dist/dist.tar.gz: PASSED\n" assert renderer.render.calls == [ pretend.call("blah", stream=warning_stream) ] @@ -99,11 +96,10 @@ output_stream = check.StringIO() check.check("dist/*", output_stream=output_stream) assert output_stream.getvalue() == ( - 'Checking distribution dist/dist.tar.gz: ' - 'warning: `long_description_content_type` missing. ' + 'Checking dist/dist.tar.gz: PASSED, with warnings\n' + ' warning: `long_description_content_type` missing. ' 'defaulting to `text/x-rst`.\n' - 'warning: `long_description` missing.\n' - 'Passed\n' + ' warning: `long_description` missing.\n' ) @@ -128,10 +124,10 @@ assert check.check("dist/*", output_stream=output_stream) assert output_stream.getvalue() == ( - "Checking distribution dist/dist.tar.gz: Failed\n" - "The project's long_description has invalid markup which will not be " - "rendered on PyPI. The following syntax errors were detected:\n" - "WARNING" + "Checking dist/dist.tar.gz: FAILED\n" + " `long_description` has syntax errors in markup and would not be " + "rendered on PyPI.\n" + " WARNING" ) assert renderer.render.calls == [ pretend.call("blah", stream=warning_stream) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/twine-1.14.0/twine/__init__.py new/twine-1.15.0/twine/__init__.py --- old/twine-1.14.0/twine/__init__.py 2019-09-07 23:21:42.000000000 +0200 +++ new/twine-1.15.0/twine/__init__.py 2019-09-17 17:36:48.000000000 +0200 @@ -22,7 +22,7 @@ __summary__ = "Collection of utilities for publishing packages on PyPI" __uri__ = "https://twine.readthedocs.io/" -__version__ = "1.14.0" +__version__ = "1.15.0" __author__ = "Donald Stufft and individual contributors" __email__ = "don...@stufft.io" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/twine-1.14.0/twine/commands/check.py new/twine-1.15.0/twine/commands/check.py --- old/twine-1.14.0/twine/commands/check.py 2019-09-07 20:50:56.000000000 +0200 +++ new/twine-1.15.0/twine/commands/check.py 2019-09-17 17:36:48.000000000 +0200 @@ -68,47 +68,80 @@ return self.output.getvalue() +def _check_file(filename, render_warning_stream): + """Check given distribution.""" + warnings = [] + is_ok = True + + package = PackageFile.from_filename(filename, comment=None) + + metadata = package.metadata_dictionary() + description = metadata["description"] + description_content_type = metadata["description_content_type"] + + if description_content_type is None: + warnings.append( + '`long_description_content_type` missing. ' + 'defaulting to `text/x-rst`.' + ) + description_content_type = 'text/x-rst' + + content_type, params = cgi.parse_header(description_content_type) + renderer = _RENDERERS.get(content_type, _RENDERERS[None]) + + if description in {None, 'UNKNOWN\n\n\n'}: + warnings.append('`long_description` missing.') + elif renderer: + rendering_result = renderer.render( + description, stream=render_warning_stream, **params + ) + if rendering_result is None: + is_ok = False + + return warnings, is_ok + + +# TODO: Replace with textwrap.indent when Python 2 support is dropped +def _indented(text, prefix): + """Adds 'prefix' to all non-empty lines on 'text'.""" + def prefixed_lines(): + for line in text.splitlines(True): + yield (prefix + line if line.strip() else line) + return ''.join(prefixed_lines()) + + def check(dists, output_stream=sys.stdout): uploads = [i for i in _find_dists(dists) if not i.endswith(".asc")] - stream = _WarningStream() + if not uploads: # Return early, if there are no files to check. + output_stream.write("No files to check.\n") + return False + failure = False for filename in uploads: - output_stream.write("Checking distribution %s: " % filename) - package = PackageFile.from_filename(filename, comment=None) - - metadata = package.metadata_dictionary() - description = metadata["description"] - description_content_type = metadata["description_content_type"] - - if description_content_type is None: - output_stream.write( - 'warning: `long_description_content_type` missing. ' - 'defaulting to `text/x-rst`.\n' + output_stream.write("Checking %s: " % filename) + render_warning_stream = _WarningStream() + warnings, is_ok = _check_file(filename, render_warning_stream) + + # Print the status and/or error + if not is_ok: + failure = True + output_stream.write("FAILED\n") + + error_text = ( + "`long_description` has syntax errors in markup and " + "would not be rendered on PyPI.\n" ) - description_content_type = 'text/x-rst' - - content_type, params = cgi.parse_header(description_content_type) - renderer = _RENDERERS.get(content_type, _RENDERERS[None]) - - if description in {None, 'UNKNOWN\n\n\n'}: - output_stream.write('warning: `long_description` missing.\n') - output_stream.write("Passed\n") + output_stream.write(_indented(error_text, " ")) + output_stream.write(_indented(str(render_warning_stream), " ")) + elif warnings: + output_stream.write("PASSED, with warnings\n") else: - if ( - renderer - and renderer.render(description, stream=stream, **params) - is None - ): - failure = True - output_stream.write("Failed\n") - output_stream.write( - "The project's long_description has invalid markup which " - "will not be rendered on PyPI. The following syntax " - "errors were detected:\n%s" % stream - ) - else: - output_stream.write("Passed\n") + output_stream.write("PASSED\n") + + # Print warnings after the status and/or error + for message in warnings: + output_stream.write(' warning: ' + message + '\n') return failure diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/twine-1.14.0/twine.egg-info/PKG-INFO new/twine-1.15.0/twine.egg-info/PKG-INFO --- old/twine-1.14.0/twine.egg-info/PKG-INFO 2019-09-07 23:30:47.000000000 +0200 +++ new/twine-1.15.0/twine.egg-info/PKG-INFO 2019-09-17 17:42:02.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: twine -Version: 1.14.0 +Version: 1.15.0 Summary: Collection of utilities for publishing packages on PyPI Home-page: https://twine.readthedocs.io/ Author: Donald Stufft and individual contributors