summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--README.rst8
-rw-r--r--__init__.py4
-rw-r--r--_doc/_static/pypi.svg2
-rw-r--r--_test/test_cyaml.py10
-rw-r--r--_test/test_yamlobject.py11
-rw-r--r--setup.py36
-rwxr-xr-xtox.ini2
8 files changed, 62 insertions, 15 deletions
diff --git a/CHANGES b/CHANGES
index 528789a..e80f232 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+[0, 15, 78]: 2018-11-15
+ - fix setup issue for 3.8 (reported by `Sidney Kuyateh
+ <https://bitbucket.org/autinerd/>`__)
+
[0, 15, 77]: 2018-11-09
- setting `yaml.sort_base_mapping_type_on_output = False`, will prevent
explicit sorting by keys in the base representer of mappings. Roundtrip
diff --git a/README.rst b/README.rst
index a9a645b..0b6dcc1 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.77
-:updated: 2018-11-09
+:version: 0.15.78
+:updated: 2018-11-15
:documentation: http://yaml.readthedocs.io
:repository: https://bitbucket.org/ruamel/
:pypi: https://pypi.org/project/ruamel.yaml/
@@ -54,6 +54,10 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key (with empty line)
+0.15.78 (2018-11-15):
+ - fix setup issue for 3.8 (reported by `Sidney Kuyateh
+ <https://bitbucket.org/autinerd/>`__)
+
0.15.77 (2018-11-09):
- setting `yaml.sort_base_mapping_type_on_output = False`, will prevent
explicit sorting by keys in the base representer of mappings. Roundtrip
diff --git a/__init__.py b/__init__.py
index bdc47aa..a2e7a02 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, 77),
- __version__='0.15.77',
+ version_info=(0, 15, 78),
+ __version__='0.15.78',
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
diff --git a/_doc/_static/pypi.svg b/_doc/_static/pypi.svg
index b48d281..5364f4e 100644
--- a/_doc/_static/pypi.svg
+++ b/_doc/_static/pypi.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.15.77</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.77</text></g> </svg>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.15.78</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.78</text></g> </svg>
diff --git a/_test/test_cyaml.py b/_test/test_cyaml.py
index 5ac6f31..1d4c356 100644
--- a/_test/test_cyaml.py
+++ b/_test/test_cyaml.py
@@ -1,5 +1,6 @@
# coding: utf-8
+import sys
import platform
import pytest
from textwrap import dedent
@@ -11,15 +12,20 @@ from textwrap import dedent
def test_load_cyaml():
import ruamel.yaml
+ if sys.version_info >= (3, 8):
+ return
assert ruamel.yaml.__with_libyaml__
from ruamel.yaml.cyaml import CLoader
ruamel.yaml.load('abc: 1', Loader=CLoader)
+@pytest.mark.skipif(sys.version_info >= (3, 8), reason='no _PyGC_FINALIZED')
def test_dump_cyaml():
import ruamel.yaml
+ if sys.version_info >= (3, 8):
+ return
data = {'a': 1, 'b': 2}
res = ruamel.yaml.dump(
data,
@@ -34,6 +40,8 @@ def test_load_cyaml_1_2():
# issue 155
import ruamel.yaml
+ if sys.version_info >= (3, 8):
+ return
assert ruamel.yaml.__with_libyaml__
inp = dedent("""\
%YAML 1.2
@@ -49,6 +57,8 @@ def test_dump_cyaml_1_2():
import ruamel.yaml
from ruamel.yaml.compat import StringIO
+ if sys.version_info >= (3, 8):
+ return
assert ruamel.yaml.__with_libyaml__
yaml = ruamel.yaml.YAML(typ='safe')
yaml.version = (1, 2)
diff --git a/_test/test_yamlobject.py b/_test/test_yamlobject.py
index 376d4f8..7c4f7ec 100644
--- a/_test/test_yamlobject.py
+++ b/_test/test_yamlobject.py
@@ -56,11 +56,13 @@ def test_qualified_name00(tmpdir):
def f(self):
pass
- yaml = YAML(typ='unsafe')
+ yaml = YAML(typ='unsafe', pure=True)
+ yaml.explicit_end = True
buf = StringIO()
yaml.dump(A.f, buf)
res = buf.getvalue()
- assert res == '!!python/name:__main__.A.f \\n...\\n'
+ print('res', repr(res))
+ assert res == "!!python/name:__main__.A.f ''\\n...\\n"
x = yaml.load(res)
assert x == A.f
"""
@@ -74,10 +76,11 @@ def test_qualified_name01(tmpdir):
import ruamel.yaml.comments
from ruamel.yaml.compat import StringIO
- yaml = YAML(typ='unsafe')
+ yaml = YAML(typ='unsafe', pure=True)
+ yaml.explicit_end = True
buf = StringIO()
yaml.dump(ruamel.yaml.comments.CommentedBase.yaml_anchor, buf)
res = buf.getvalue()
- assert res == '!!python/name:ruamel.yaml.comments.CommentedBase.yaml_anchor \n...\n'
+ assert res == "!!python/name:ruamel.yaml.comments.CommentedBase.yaml_anchor ''\n...\n"
x = yaml.load(res)
assert x == ruamel.yaml.comments.CommentedBase.yaml_anchor
diff --git a/setup.py b/setup.py
index 857b5e2..e75711c 100644
--- a/setup.py
+++ b/setup.py
@@ -44,6 +44,10 @@ if sys.version_info < (3, 4):
class NameConstant:
pass
+if sys.version_info >= (3, 8):
+
+ from ast import Str, Num, Bytes, NameConstant # NOQA
+
if sys.version_info < (3,):
open_kw = dict()
@@ -830,7 +834,7 @@ class NameSpacePackager(object):
sources=[self.pn(x) for x in target['src']],
libraries=[self.pn(x) for x in target.get('lib')],
)
- # debug('test in target', 'test' in target, target)
+ # debug('test1 in target', 'test' in target, target)
if 'test' not in target: # no test, just hope it works
self._ext_modules.append(ext)
continue
@@ -871,8 +875,8 @@ class NameSpacePackager(object):
print('compile error:', file_name)
continue
except LinkError:
- debug('libyaml link error', file_name)
- print('libyaml link error', file_name)
+ debug('link error', file_name)
+ print('link error', file_name)
continue
self._ext_modules.append(ext)
except Exception as e: # NOQA
@@ -893,10 +897,10 @@ class NameSpacePackager(object):
https://bitbucket.org/pypa/wheel/issues/47
"""
if 'bdist_wheel' not in sys.argv:
- return
+ return False
file_name = 'setup.cfg'
if os.path.exists(file_name): # add it if not in there?
- return
+ return False
with open(file_name, 'w') as fp:
if os.path.exists('LICENSE'):
fp.write('[metadata]\nlicense-file = LICENSE\n')
@@ -964,6 +968,8 @@ def main():
for k in sorted(kw):
v = kw[k]
print(' "{0}": "{1}",'.format(k, v))
+ # if '--record' in sys.argv:
+ # return
if dump_kw in sys.argv:
sys.argv.remove(dump_kw)
try:
@@ -971,7 +977,26 @@ def main():
kw['long_description'] = fp.read()
except Exception:
pass
+
if nsp.wheel(kw, setup):
+ if nsp.nested and 'bdist_wheel' in sys.argv:
+ try:
+ d = sys.argv[sys.argv.index('-d') + 1]
+ except ValueError:
+ dist_base = os.environ.get('PYDISTBASE')
+ if dist_base:
+ d = os.path.join(dist_base, nsp.full_package_name)
+ else:
+ d = 'dist'
+ for x in os.listdir(d):
+ dashed_vs = '-' + version_str + '-'
+ if x.endswith('.whl') and dashed_vs in x:
+ # remove .pth file from the wheel
+ full_name = os.path.join(d, x)
+ print('patching .pth from', full_name)
+ with InMemoryZipFile(full_name) as imz:
+ imz.delete_from_zip_file(nsp.full_package_name + '.*.pth')
+ break
return
for x in ['-c', 'egg_info', '--egg-base', 'pip-egg-info']:
if x not in sys.argv:
@@ -1002,6 +1027,7 @@ def main():
if x.endswith('.whl'):
# remove .pth file from the wheel
full_name = os.path.join(d, x)
+ print('patching .pth from', full_name)
with InMemoryZipFile(full_name) as imz:
imz.delete_from_zip_file(nsp.full_package_name + '.*.pth')
break
diff --git a/tox.ini b/tox.ini
index 9a7f3b0..86baf60 100755
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
# toxworkdir = /data1/DATA/tox/ruamel.yaml
-envlist = cs,py37,py27,py36,py35,py34,pypy,py27m
+envlist = cs,py37,py27,py36,py35,py34,py38,pypy,py27m
[testenv]
commands =