Hello community, here is the log from the commit of package python-py for openSUSE:Factory checked in at 2018-11-08 09:39:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-py (Old) and /work/SRC/openSUSE:Factory/.python-py.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-py" Thu Nov 8 09:39:33 2018 rev:30 rq:644860 version:1.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-py/python-py-doc.changes 2018-08-07 09:41:06.141103576 +0200 +++ /work/SRC/openSUSE:Factory/.python-py.new/python-py-doc.changes 2018-11-08 09:39:36.153721699 +0100 @@ -1,0 +2,13 @@ +Fri Oct 26 13:07:32 UTC 2018 - Ondřej Súkup <[email protected]> + +- update to 1.7.0 + * use ``shutil.get_terminal_size()`` in Python 3.3+ to determine the size of the + terminal, which produces more accurate results than the previous method. + * introduce new ``PY_IGNORE_IMPORTMISMATCH`` environment variable + that suppresses ``ImportMismatchError`` exceptions when set to ``1``. + * add ``TerminalWriter.width_of_current_line`` (i18n version of + ``TerminalWriter.chars_on_current_line``), a read-only property + that tracks how wide the current line is, attempting to take + into account international characters in the calculation. + +------------------------------------------------------------------- python-py.changes: same change Old: ---- py-1.5.4.tar.gz New: ---- py-1.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-py-doc.spec ++++++ --- /var/tmp/diff_new_pack.fepyDi/_old 2018-11-08 09:39:37.149720549 +0100 +++ /var/tmp/diff_new_pack.fepyDi/_new 2018-11-08 09:39:37.153720545 +0100 @@ -12,28 +12,28 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-py-doc -Version: 1.5.4 +Version: 1.7.0 Release: 0 Summary: Library with cross-python path, ini-parsing, io, code, log facilities License: MIT Group: Development/Languages/Python -Url: https://github.com/pytest-dev/py +URL: https://github.com/pytest-dev/py Source: https://files.pythonhosted.org/packages/source/p/py/py-%{version}.tar.gz BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} BuildRequires: %{python_module py} -BuildRequires: python-rpm-macros # Documentation requirements: BuildRequires: dos2unix +BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx -BuildArch: noarch Provides: %{python_module py-doc = %{version}} +BuildArch: noarch %description The py lib is a Python development support library featuring @@ -47,7 +47,6 @@ This package contains the documentation for Babel - %prep %setup -q -n py-%{version} dos2unix LICENSE doc/*.txt doc/announce/*.txt @@ -59,7 +58,6 @@ # Only building documentation %files -%defattr(-,root,root,-) %doc doc/_build/html %license LICENSE ++++++ python-py.spec ++++++ --- /var/tmp/diff_new_pack.fepyDi/_old 2018-11-08 09:39:37.161720535 +0100 +++ /var/tmp/diff_new_pack.fepyDi/_new 2018-11-08 09:39:37.165720531 +0100 @@ -12,26 +12,23 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-py -Version: 1.5.4 +Version: 1.7.0 Release: 0 Summary: Library with cross-python path, ini-parsing, io, code, log facilities License: MIT Group: Development/Languages/Python -Url: https://github.com/pytest-dev/py +URL: https://github.com/pytest-dev/py Source: https://files.pythonhosted.org/packages/source/p/py/py-%{version}.tar.gz -BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools_scm} -BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch - %python_subpackages %description @@ -44,7 +41,6 @@ * py.code: dynamic code generation and introspection * py.path: uniform local and svn path objects - %prep %setup -q -n py-%{version} rm -rf py.egg-info @@ -57,7 +53,6 @@ %python_exec %fdupes %{buildroot}%{$python_sitelib} %files %{python_files} -%defattr(-,root,root,-) %doc README.rst %license LICENSE %{python_sitelib}/* ++++++ py-1.5.4.tar.gz -> py-1.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/AUTHORS new/py-1.7.0/AUTHORS --- old/py-1.5.4/AUTHORS 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/AUTHORS 2018-10-12 12:51:54.000000000 +0200 @@ -22,3 +22,4 @@ Grig Gheorghiu Bob Ippolito Christian Tismer +Wim Glenn diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/CHANGELOG new/py-1.7.0/CHANGELOG --- old/py-1.5.4/CHANGELOG 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/CHANGELOG 2018-10-12 12:51:54.000000000 +0200 @@ -1,3 +1,21 @@ +1.7.0 (2018-10-11) +================== + +- fix #174: use ``shutil.get_terminal_size()`` in Python 3.3+ to determine the size of the + terminal, which produces more accurate results than the previous method. + +- fix pytest-dev/pytest#2042: introduce new ``PY_IGNORE_IMPORTMISMATCH`` environment variable + that suppresses ``ImportMismatchError`` exceptions when set to ``1``. + + +1.6.0 (2018-08-27) +================== + +- add ``TerminalWriter.width_of_current_line`` (i18n version of + ``TerminalWriter.chars_on_current_line``), a read-only property + that tracks how wide the current line is, attempting to take + into account international characters in the calculation. + 1.5.4 (2018-06-27) ================== @@ -80,7 +98,7 @@ 1.4.30 ================================================== -- fix issue68 an assert with a multiline list comprehension +- fix issue68 an assert with a multiline list comprehension was not reported correctly. Thanks Henrik Heibuerger. @@ -108,7 +126,7 @@ - allow a new ensuresyspath="append" mode for py.path.local.pyimport() so that a neccessary import path is appended instead of prepended to - sys.path + sys.path - strike undocumented, untested argument to py.path.local.pypkgpath @@ -156,10 +174,10 @@ thus triggering the alias module to resolve and blowing up with ImportError. The negative side is that something like "py.test.X" will now result in None instead of "importerror: pytest" - if pytest is not installed. But you shouldn't import "py.test" + if pytest is not installed. But you shouldn't import "py.test" anyway anymore. -- adapt one svn test to only check for any exception instead +- adapt one svn test to only check for any exception instead of specific ones because different svn versions cause different errors and we don't care. @@ -182,8 +200,8 @@ its output even if it didn't flush itself. - refactor traceback generation in light of pytest issue 364 - (shortening tracebacks). you can now set a new traceback style - on a per-entry basis such that a caller can force entries to be + (shortening tracebacks). you can now set a new traceback style + on a per-entry basis such that a caller can force entries to be isplayed as short or long entries. - win32: py.path.local.sysfind(name) will preferrably return files with @@ -195,7 +213,7 @@ - ignore unicode decode errors in xmlescape. Thanks Anatoly Bubenkoff. -- on python2 modify traceback.format_exception_only to match python3 +- on python2 modify traceback.format_exception_only to match python3 behaviour, namely trying to print unicode for Exception instances - use a safer way for serializing exception reports (helps to fix @@ -225,7 +243,7 @@ - introduce path.ensure_dir() as a synonym for ensure(..., dir=1) - some unicode/python3 related fixes wrt to path manipulations - (if you start passing unicode particular in py2 you might + (if you start passing unicode particular in py2 you might still get problems, though) Changes between 1.4.16 and 1.4.17 @@ -292,7 +310,7 @@ Changes between 1.4.11 and 1.4.12 ================================================== -- fix python2.4 support - for pre-AST interpreters re-introduce +- fix python2.4 support - for pre-AST interpreters re-introduce old way to find statements in exceptions (closes pytest issue 209) - add tox.ini to distribution - fix issue23 - print *,** args information in tracebacks, @@ -310,7 +328,7 @@ unicodeencode/decode problems, amend according test - introduce py.builtin.text and py.builtin.bytes to point to respective str/unicode (py2) and bytes/str (py3) types -- fix error handling on win32/py33 for ENODIR +- fix error handling on win32/py33 for ENODIR Changes between 1.4.9 and 1.4.10 ================================================== @@ -347,12 +365,12 @@ Changes between 1.4.5 and 1.4.6 ================================================== -- help to fix pytest issue99: unify output of +- help to fix pytest issue99: unify output of ExceptionInfo.getrepr(style="native") with ...(style="long") - fix issue7: source.getstatementrange() now raises proper error if no valid statement can be found -- fix issue8: fix code and tests of svnurl/svnwc to work on subversion 1.7 - - note that path.status(updates=1) will not properly work svn-17's status +- fix issue8: fix code and tests of svnurl/svnwc to work on subversion 1.7 - + note that path.status(updates=1) will not properly work svn-17's status --xml output is broken. - make source.getstatementrange() more resilent about non-python code frames (as seen from jnja2) @@ -421,7 +439,7 @@ - py.test was moved to a separate "pytest" package. What remains is a stub hook which will proxy ``import py.test`` to ``pytest``. -- all command line tools ("py.cleanup/lookup/countloc/..." moved +- all command line tools ("py.cleanup/lookup/countloc/..." moved to "pycmd" package) - removed the old and deprecated "py.magic" namespace - use apipkg-1.1 and make py.apipkg.initpkg|ApiModule available diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/PKG-INFO new/py-1.7.0/PKG-INFO --- old/py-1.5.4/PKG-INFO 2018-06-27 13:24:18.000000000 +0200 +++ new/py-1.7.0/PKG-INFO 2018-10-12 12:52:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: py -Version: 1.5.4 +Version: 1.7.0 Summary: library with cross-python path, ini-parsing, io, code, log facilities Home-page: http://py.readthedocs.io/ Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others @@ -9,7 +9,7 @@ Description: .. image:: https://img.shields.io/pypi/v/py.svg :target: https://pypi.org/project/py - .. image:: https://anaconda.org/conda-forge/py/badges/version.svg + .. image:: https://img.shields.io/conda/vn/conda-forge/py.svg :target: https://anaconda.org/conda-forge/py .. image:: https://img.shields.io/pypi/pyversions/pytest.svg @@ -62,6 +62,7 @@ Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/README.rst new/py-1.7.0/README.rst --- old/py-1.5.4/README.rst 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/README.rst 2018-10-12 12:51:54.000000000 +0200 @@ -1,7 +1,7 @@ .. image:: https://img.shields.io/pypi/v/py.svg :target: https://pypi.org/project/py -.. image:: https://anaconda.org/conda-forge/py/badges/version.svg +.. image:: https://img.shields.io/conda/vn/conda-forge/py.svg :target: https://anaconda.org/conda-forge/py .. image:: https://img.shields.io/pypi/pyversions/pytest.svg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/appveyor.yml new/py-1.7.0/appveyor.yml --- old/py-1.5.4/appveyor.yml 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/appveyor.yml 2018-10-12 12:51:54.000000000 +0200 @@ -13,14 +13,20 @@ - TOXENV: "py36-pytest29" - TOXENV: "py36-pytest30" - TOXENV: "py36-pytest31" + - TOXENV: "py37-pytest30" + - TOXENV: "py37-pytest31" install: - echo Installed Pythons - dir c:\Python* - - C:\Python36\python -m pip install --upgrade --pre tox + - C:\Python37\python -m pip install --upgrade --pre tox build: false # Not a C# project, build stuff at the test step instead. test_script: - - C:\Python36\python -m tox + - C:\Python37\python -m tox + +# We don't deploy anything on tags with AppVeyor, we use Travis instead, so we +# might as well save resources +skip_tags: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/bench/localpath.py new/py-1.7.0/bench/localpath.py --- old/py-1.5.4/bench/localpath.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/bench/localpath.py 2018-10-12 12:51:54.000000000 +0200 @@ -1,6 +1,4 @@ - import py -import timeit class Listdir: numiter = 100000 @@ -70,6 +68,6 @@ for i in xrange(cls.numiter): inst.run() elapsed = time.time() - now - print "%s: %d loops took %.2f seconds, per call %.6f" %( + print("%s: %d loops took %.2f seconds, per call %.6f" %( cls.__name__, - cls.numiter, elapsed, elapsed / cls.numiter) + cls.numiter, elapsed, elapsed / cls.numiter)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/doc/example/genhtml.py new/py-1.7.0/doc/example/genhtml.py --- old/py-1.5.4/doc/example/genhtml.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/doc/example/genhtml.py 2018-10-12 12:51:54.000000000 +0200 @@ -8,6 +8,6 @@ html.body( [html.p(p) for p in paras])) -print unicode(doc).encode('latin1') +print(unicode(doc).encode('latin1')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/doc/example/genhtmlcss.py new/py-1.7.0/doc/example/genhtmlcss.py --- old/py-1.5.4/doc/example/genhtmlcss.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/doc/example/genhtmlcss.py 2018-10-12 12:51:54.000000000 +0200 @@ -20,4 +20,4 @@ ) ) -print doc.unicode(indent=2) +print(doc.unicode(indent=2)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/doc/example/genxml.py new/py-1.7.0/doc/example/genxml.py --- old/py-1.5.4/doc/example/genxml.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/doc/example/genxml.py 2018-10-12 12:51:54.000000000 +0200 @@ -12,6 +12,6 @@ ns.title("Java for Python programmers"),), publisher="N.N", ) -print doc.unicode(indent=2).encode('utf8') +print(doc.unicode(indent=2).encode('utf8')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/doc/install.txt new/py-1.7.0/doc/install.txt --- old/py-1.5.4/doc/install.txt 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/doc/install.txt 2018-10-12 12:51:54.000000000 +0200 @@ -7,7 +7,7 @@ **PyPI name**: py_ -**Pythons**: CPython 2.7, 3.4, 3.5, 3.6, PyPy-5.4 +**Pythons**: CPython 2.7, 3.4, 3.5, 3.6, 3.7, PyPy-5.4 **Operating systems**: Linux, Windows, OSX, Unix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/py/_io/terminalwriter.py new/py-1.7.0/py/_io/terminalwriter.py --- old/py-1.5.4/py/_io/terminalwriter.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/py/_io/terminalwriter.py 2018-10-12 12:51:54.000000000 +0200 @@ -5,9 +5,10 @@ """ -import sys, os +import sys, os, unicodedata import py py3k = sys.version_info[0] >= 3 +py33 = sys.version_info >= (3, 3) from py.builtin import text, bytes win32_and_ctypes = False @@ -24,10 +25,15 @@ def _getdimensions(): - import termios,fcntl,struct - call = fcntl.ioctl(1,termios.TIOCGWINSZ,"\000"*8) - height,width = struct.unpack( "hhhh", call ) [:2] - return height, width + if py33: + import shutil + size = shutil.get_terminal_size() + return size.lines, size.columns + else: + import termios, fcntl, struct + call = fcntl.ioctl(1, termios.TIOCGWINSZ, "\000" * 8) + height, width = struct.unpack("hhhh", call)[:2] + return height, width def get_terminal_width(): @@ -53,6 +59,21 @@ terminal_width = get_terminal_width() +char_width = { + 'A': 1, # "Ambiguous" + 'F': 2, # Fullwidth + 'H': 1, # Halfwidth + 'N': 1, # Neutral + 'Na': 1, # Narrow + 'W': 2, # Wide +} + + +def get_line_width(text): + text = unicodedata.normalize('NFC', text) + return sum(char_width.get(unicodedata.east_asian_width(c), 1) for c in text) + + # XXX unify with _escaped func below def ansi_print(text, esc, file=None, newline=True, flush=False): if file is None: @@ -140,6 +161,7 @@ self.hasmarkup = should_do_markup(file) self._lastlen = 0 self._chars_on_current_line = 0 + self._width_of_current_line = 0 @property def fullwidth(self): @@ -164,6 +186,16 @@ """ return self._chars_on_current_line + @property + def width_of_current_line(self): + """Return an estimate of the width so far in the current line. + + .. versionadded:: 1.6.0 + + :rtype: int + """ + return self._width_of_current_line + def _escaped(self, text, esc): if esc and self.hasmarkup: text = (''.join(['\x1b[%sm' % cod for cod in esc]) + @@ -223,12 +255,17 @@ markupmsg = msg write_out(self._file, markupmsg) - def _update_chars_on_current_line(self, text): - fields = text.rsplit('\n', 1) - if '\n' in text: - self._chars_on_current_line = len(fields[-1]) + def _update_chars_on_current_line(self, text_or_bytes): + newline = b'\n' if isinstance(text_or_bytes, bytes) else '\n' + current_line = text_or_bytes.rsplit(newline, 1)[-1] + if isinstance(current_line, bytes): + current_line = current_line.decode('utf-8', errors='replace') + if newline in text_or_bytes: + self._chars_on_current_line = len(current_line) + self._width_of_current_line = get_line_width(current_line) else: - self._chars_on_current_line += len(fields[-1]) + self._chars_on_current_line += len(current_line) + self._width_of_current_line += get_line_width(current_line) def line(self, s='', **kw): self.write(s, **kw) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/py/_path/local.py new/py-1.7.0/py/_path/local.py --- old/py-1.5.4/py/_path/local.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/py/_path/local.py 2018-10-12 12:51:54.000000000 +0200 @@ -683,7 +683,9 @@ except py.error.ENOENT: issame = False if not issame: - raise self.ImportMismatchError(modname, modfile, self) + ignore = os.getenv('PY_IGNORE_IMPORTMISMATCH') + if ignore != '1': + raise self.ImportMismatchError(modname, modfile, self) return mod else: try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/py/_version.py new/py-1.7.0/py/_version.py --- old/py-1.5.4/py/_version.py 2018-06-27 13:24:18.000000000 +0200 +++ new/py-1.7.0/py/_version.py 2018-10-12 12:52:18.000000000 +0200 @@ -1,4 +1,4 @@ # coding: utf-8 # file generated by setuptools_scm # don't change, don't track in version control -version = '1.5.4' +version = '1.7.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/py.egg-info/PKG-INFO new/py-1.7.0/py.egg-info/PKG-INFO --- old/py-1.5.4/py.egg-info/PKG-INFO 2018-06-27 13:24:18.000000000 +0200 +++ new/py-1.7.0/py.egg-info/PKG-INFO 2018-10-12 12:52:18.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: py -Version: 1.5.4 +Version: 1.7.0 Summary: library with cross-python path, ini-parsing, io, code, log facilities Home-page: http://py.readthedocs.io/ Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others @@ -9,7 +9,7 @@ Description: .. image:: https://img.shields.io/pypi/v/py.svg :target: https://pypi.org/project/py - .. image:: https://anaconda.org/conda-forge/py/badges/version.svg + .. image:: https://img.shields.io/conda/vn/conda-forge/py.svg :target: https://anaconda.org/conda-forge/py .. image:: https://img.shields.io/pypi/pyversions/pytest.svg @@ -62,6 +62,7 @@ Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/py.egg-info/SOURCES.txt new/py-1.7.0/py.egg-info/SOURCES.txt --- old/py-1.5.4/py.egg-info/SOURCES.txt 2018-06-27 13:24:18.000000000 +0200 +++ new/py-1.7.0/py.egg-info/SOURCES.txt 2018-10-12 12:52:18.000000000 +0200 @@ -115,6 +115,7 @@ testing/io_/test_capture.py testing/io_/test_saferepr.py testing/io_/test_terminalwriter.py +testing/io_/test_terminalwriter_linewidth.py testing/log/__init__.py testing/log/test_log.py testing/log/test_warning.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/setup.py new/py-1.7.0/setup.py --- old/py-1.5.4/setup.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/setup.py 2018-10-12 12:51:54.000000000 +0200 @@ -30,6 +30,7 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/testing/io_/test_terminalwriter.py new/py-1.7.0/testing/io_/test_terminalwriter.py --- old/py-1.5.4/testing/io_/test_terminalwriter.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/testing/io_/test_terminalwriter.py 2018-10-12 12:51:54.000000000 +0200 @@ -1,3 +1,4 @@ +from collections import namedtuple import py import os, sys @@ -10,16 +11,22 @@ assert x == terminalwriter.get_terminal_width def test_getdimensions(monkeypatch): - fcntl = py.test.importorskip("fcntl") - import struct - l = [] - monkeypatch.setattr(fcntl, 'ioctl', lambda *args: l.append(args)) - try: - terminalwriter._getdimensions() - except (TypeError, struct.error): - pass - assert len(l) == 1 - assert l[0][0] == 1 + if sys.version_info >= (3, 3): + import shutil + Size = namedtuple('Size', 'lines columns') + monkeypatch.setattr(shutil, 'get_terminal_size', lambda: Size(60, 100)) + assert terminalwriter._getdimensions() == (60, 100) + else: + fcntl = py.test.importorskip("fcntl") + import struct + l = [] + monkeypatch.setattr(fcntl, 'ioctl', lambda *args: l.append(args)) + try: + terminalwriter._getdimensions() + except (TypeError, struct.error): + pass + assert len(l) == 1 + assert l[0][0] == 1 def test_terminal_width_COLUMNS(monkeypatch): """ Dummy test for get_terminal_width diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/testing/io_/test_terminalwriter_linewidth.py new/py-1.7.0/testing/io_/test_terminalwriter_linewidth.py --- old/py-1.5.4/testing/io_/test_terminalwriter_linewidth.py 1970-01-01 01:00:00.000000000 +0100 +++ new/py-1.7.0/testing/io_/test_terminalwriter_linewidth.py 2018-10-12 12:51:54.000000000 +0200 @@ -0,0 +1,56 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from py._io.terminalwriter import TerminalWriter + + +def test_terminal_writer_line_width_init(): + tw = TerminalWriter() + assert tw.chars_on_current_line == 0 + assert tw.width_of_current_line == 0 + + +def test_terminal_writer_line_width_update(): + tw = TerminalWriter() + tw.write('hello world') + assert tw.chars_on_current_line == 11 + assert tw.width_of_current_line == 11 + + +def test_terminal_writer_line_width_update_with_newline(): + tw = TerminalWriter() + tw.write('hello\nworld') + assert tw.chars_on_current_line == 5 + assert tw.width_of_current_line == 5 + + +def test_terminal_writer_line_width_update_with_wide_text(): + tw = TerminalWriter() + tw.write('乇乂ㄒ尺卂 ㄒ卄丨匚匚') + assert tw.chars_on_current_line == 11 + assert tw.width_of_current_line == 21 # 5*2 + 1 + 5*2 + + +def test_terminal_writer_line_width_update_with_wide_bytes(): + tw = TerminalWriter() + tw.write('乇乂ㄒ尺卂 ㄒ卄丨匚匚'.encode('utf-8')) + assert tw.chars_on_current_line == 11 + assert tw.width_of_current_line == 21 + + +def test_terminal_writer_line_width_composed(): + tw = TerminalWriter() + text = 'café food' + assert len(text) == 9 + tw.write(text) + assert tw.chars_on_current_line == 9 + assert tw.width_of_current_line == 9 + + +def test_terminal_writer_line_width_combining(): + tw = TerminalWriter() + text = 'café food' + assert len(text) == 10 + tw.write(text) + assert tw.chars_on_current_line == 10 + assert tw.width_of_current_line == 9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/testing/path/test_local.py new/py-1.7.0/testing/path/test_local.py --- old/py-1.5.4/testing/path/test_local.py 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/testing/path/test_local.py 2018-10-12 12:51:54.000000000 +0200 @@ -475,13 +475,22 @@ assert obj.x == 42 assert obj.__name__ == 'execfile' - def test_pyimport_renamed_dir_creates_mismatch(self, tmpdir): + def test_pyimport_renamed_dir_creates_mismatch(self, tmpdir, monkeypatch): p = tmpdir.ensure("a", "test_x123.py") p.pyimport() tmpdir.join("a").move(tmpdir.join("b")) with pytest.raises(tmpdir.ImportMismatchError): tmpdir.join("b", "test_x123.py").pyimport() + # Errors can be ignored. + monkeypatch.setenv('PY_IGNORE_IMPORTMISMATCH', '1') + tmpdir.join("b", "test_x123.py").pyimport() + + # PY_IGNORE_IMPORTMISMATCH=0 does not ignore error. + monkeypatch.setenv('PY_IGNORE_IMPORTMISMATCH', '0') + with pytest.raises(tmpdir.ImportMismatchError): + tmpdir.join("b", "test_x123.py").pyimport() + def test_pyimport_messy_name(self, tmpdir): # http://bitbucket.org/hpk42/py-trunk/issue/129 path = tmpdir.ensure('foo__init__.py') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.5.4/tox.ini new/py-1.7.0/tox.ini --- old/py-1.5.4/tox.ini 2018-06-27 13:23:59.000000000 +0200 +++ new/py-1.7.0/tox.ini 2018-10-12 12:51:54.000000000 +0200 @@ -1,5 +1,6 @@ [tox] -envlist=py{27,34,35,36}-pytest{29,30,31} +# Skip py37-pytest29 as such a combination does not work (#192) +envlist=py{27,34,35,36}-pytest{29,30,31},py37-pytest{30,31} [testenv] changedir=testing
