summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-07-01 16:25:00 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-07-01 16:25:00 +0200
commitc3869f9866e3507bbb6767aeb5bc02ba41a98d60 (patch)
treed901c684ffdb978a02dd83a728e609e6a07c8b97
parent4eed1d5eef4f20ea32ee7af1f01d02ffcc7e229c (diff)
downloadruamel.yaml-c3869f9866e3507bbb6767aeb5bc02ba41a98d60.tar.gz
fix regression caused by PR 270.15.42
-rw-r--r--.appveyor.yaml5
-rw-r--r--CHANGES8
-rw-r--r--Dockerfile4
-rw-r--r--README.rst16
-rw-r--r--__init__.py6
-rw-r--r--_test/test_comments.py2
-rw-r--r--compat.py5
-rw-r--r--docker-compose.yml3
-rw-r--r--reader.py10
-rw-r--r--tox.ini7
10 files changed, 43 insertions, 23 deletions
diff --git a/.appveyor.yaml b/.appveyor.yaml
index 0aee751..fcc4086 100644
--- a/.appveyor.yaml
+++ b/.appveyor.yaml
@@ -4,9 +4,6 @@ environment:
matrix:
- PYTHON: C:\Python27
- PYTHON: C:\Python27-x64
- - PYTHON: C:\Python33
- - PYTHON: C:\Python33-x64
- DISTUTILS_USE_SDK: '1'
- PYTHON: C:\Python34
- PYTHON: C:\Python34-x64
DISTUTILS_USE_SDK: '1'
@@ -14,6 +11,8 @@ environment:
- PYTHON: C:\Python35-x64
- PYTHON: C:\Python36
- PYTHON: C:\Python36-x64
+ - PYTHON: C:\Python37
+ - PYTHON: C:\Python37-x64
install:
- |
diff --git a/CHANGES b/CHANGES
index 1971a74..cc13e6c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+[0, 15, 42]: 2018-07-01
+ - fix regression showing only on narrow Python 2.7 (py27mu) builds
+ (with help from
+ `Marcel Bargull <https://bitbucket.org/mbargull/>`__ and
+ `Colm O'Connor <>`__).
+ - run pre-commit ``tox`` on Python 2.7 wide and narrow, as well as
+ 3.4/3.5/3.6/3.7/pypy
+
[0, 15, 41]: 2018-06-27
- add detection of C-compile failure (investigation prompted by
`StackOverlow <https://stackoverflow.com/a/51057399/1307905>`__ by
diff --git a/Dockerfile b/Dockerfile
index 0482f06..3dac3b5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -22,7 +22,7 @@ RUN chmod 755 /usr/bin/makewheel
# RUN yum install -y libyaml-devel
-CMD /usr/bin/makewheel 27 33 34 35 36
+CMD /usr/bin/makewheel 27 34 35 36 37
-#cp26-cp26m cp27-cp27m cp33-cp33m cp35-cp35m cp26-cp26mu cp27-cp27mu cp34-cp34m cp36-cp36m
+# cp27-cp27m p27-cp27mu cp34-cp34m cp35-cp35m cp36-cp36m cp37-cp37m
diff --git a/README.rst b/README.rst
index 97d2809..5f5118e 100644
--- a/README.rst
+++ b/README.rst
@@ -4,8 +4,8 @@ ruamel.yaml
``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python.
-:version: 0.15.41
-:updated: 2018-06-27
+:version: 0.15.42
+:updated: 2018-07-01
:documentation: http://yaml.readthedocs.io
:repository: https://bitbucket.org/ruamel/
:pypi: https://pypi.org/project/ruamel.yaml/
@@ -42,9 +42,17 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key (with empty line)
+0.15.42 (2018-07-01):
+ - fix regression showing only on narrow Python 2.7 (py27mu) builds
+ (with help from
+ `Marcel Bargull <https://bitbucket.org/mbargull/>`__ and
+ `Colm O'Connor <>`__).
+ - run pre-commit ``tox`` on Python 2.7 wide and narrow, as well as
+ 3.4/3.5/3.6/3.7/pypy
+
0.15.41 (2018-06-27):
- - add detection of C-compile failure (investigation prompted by
- `StackOverlow <https://stackoverflow.com/a/51057399/1307905>`__ by
+ - add detection of C-compile failure (investigation prompted by
+ `StackOverlow <https://stackoverflow.com/a/51057399/1307905>`__ by
`Emmanuel Blot <https://stackoverflow.com/users/8233409/emmanuel-blot>`__),
which was removed while no longer dependent on ``libyaml``, C-extensions
compilation still needs a compiler though.
diff --git a/__init__.py b/__init__.py
index 29d2938..505a11e 100644
--- a/__init__.py
+++ b/__init__.py
@@ -7,8 +7,8 @@ if False: # MYPY
_package_data = dict(
full_package_name='ruamel.yaml',
- version_info=(0, 15, 41),
- __version__='0.15.41',
+ version_info=(0, 15, 42),
+ __version__='0.15.42',
author='Anthon van der Neut',
author_email='a.van.der.neut@ruamel.eu',
description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA
@@ -55,7 +55,7 @@ _package_data = dict(
supported=[(2, 7), (3, 4)], # minimum
tox=dict(
flake8=dict(version='==2.5.5'),
- env='*p',
+ env='*pn', # also test narrow 2.7.15
deps='ruamel.std.pathlib',
fl8excl='_test/lib',
),
diff --git a/_test/test_comments.py b/_test/test_comments.py
index b3e39d2..11e452f 100644
--- a/_test/test_comments.py
+++ b/_test/test_comments.py
@@ -695,7 +695,7 @@ class TestEmptyLines:
class TestUnicodeComments:
- @pytest.mark.skipif(ruamel.yaml.reader.Reader.UNICODE_SIZE < 4,
+ @pytest.mark.skipif(ruamel.yaml.compat.UNICODE_SIZE < 4,
reason="unicode not wide enough")
def test_issue_55(self): # reported by Haraguroicha Hsu
round_trip("""\
diff --git a/compat.py b/compat.py
index 0a11341..521b8e6 100644
--- a/compat.py
+++ b/compat.py
@@ -7,6 +7,7 @@ from __future__ import print_function
import sys
import os
import types
+import sysconfig
if False: # MYPY
from typing import Any, Dict, Optional, List, Union, BinaryIO, IO, Text, Tuple # NOQA
@@ -112,6 +113,10 @@ if PY3:
else:
builtins_module = '__builtin__'
+UNICODE_SIZE = sysconfig.get_config_var('Py_UNICODE_SIZE')
+if UNICODE_SIZE is None: # on Python >= 3.3 unicode has no fixed bytesize
+ UNICODE_SIZE = 4
+
def with_metaclass(meta, *bases):
# type: (Any, Any) -> Any
diff --git a/docker-compose.yml b/docker-compose.yml
index c737838..be63d4a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,7 +2,8 @@ version: '2'
user-data:
author: Anthon van der Neut <a.van.der.neut@ruamel.eu>
description: manylinux1 wheel build container for ruamel.yaml
- # env-defaults:
+ env-defaults:
+ PYDISTBASE: /tmp # for building, normally set by `dv --distbase`
services:
yamlmanylinux1:
container_name: yamlmanylinux1
diff --git a/reader.py b/reader.py
index 9686aa8..96bb96b 100644
--- a/reader.py
+++ b/reader.py
@@ -21,10 +21,9 @@ from __future__ import absolute_import
# character.
import codecs
-import re
from ruamel.yaml.error import YAMLError, FileMark, StringMark, YAMLStreamError
-from ruamel.yaml.compat import text_type, binary_type, PY3
+from ruamel.yaml.compat import text_type, binary_type, PY3, UNICODE_SIZE
from ruamel.yaml.util import RegExp
if False: # MYPY
@@ -180,17 +179,13 @@ class Reader(object):
self.encoding = 'utf-8'
self.update(1)
- # 4 if 32 bit unicode supported, 2 e.g. on MacOS (issue 56)
- try:
- re.compile(u'[^\U00010000]')
- except: # NOQA
+ if UNICODE_SIZE == 2:
NON_PRINTABLE = RegExp(
u'[^\x09\x0A\x0D\x20-\x7E\x85'
u'\xA0-\uD7FF'
u'\uE000-\uFFFD'
u']'
)
- UNICODE_SIZE = 2
else:
NON_PRINTABLE = RegExp(
u'[^\x09\x0A\x0D\x20-\x7E\x85'
@@ -199,7 +194,6 @@ class Reader(object):
u'\U00010000-\U0010FFFF'
u']'
)
- UNICODE_SIZE = 4
_printable_ascii = ('\x09\x0A\x0D' + ''.join(map(chr, range(0x20, 0x7F)))).encode('ascii')
diff --git a/tox.ini b/tox.ini
index 3244c1e..9057c82 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,14 +1,19 @@
[tox]
-envlist = cs,py36,py27,py35,py34,pypy
+toxworkdir = /data1/DATA/tox/ruamel.yaml
+envlist = cs,py36,py27,py35,py34,pypy,py27m
[testenv]
commands =
+ python -c "import sys, sysconfig; print('%s ucs-%s' % (sys.version.replace('\n', ' '), sysconfig.get_config_var('Py_UNICODE_SIZE')))"
/bin/bash -c 'pytest _test/test_*.py'
deps =
pytest
flake8==2.5.5
ruamel.std.pathlib
+[testenv:py27m]
+basepython = /opt/python/2.7.15m/bin/python
+
[testenv:cs]
basepython = python3.6
commands =