Commit 765b8bbf authored by Ole Streicher's avatar Ole Streicher

New upstream version 2.3.2

parent 889eb61e
2.3.1 (2018-12-20)
2.3.2 (2019-02-19)
------------------
- Ensure that top-level accesses to the tree outside a closed context handler
result in an ``OSError``. [#628]
- Fix bug that occurs when comparing installed extension version with that
found in file. [#641]
2.3.1 (2018-12-20)
------------------
- Provide source information for ``AsdfDeprecationWarning`` that come from
extensions from external packages. [#629]
- Ensure that top-level accesses to the tree outside a closed context handler
result in an ``OSError``. [#628]
- Fix the way ``generic_io`` handles URIs and paths on Windows. [#632]
- Fix bug in ``asdftool`` that prevented ``extract`` command from being
......
Metadata-Version: 1.2
Name: asdf
Version: 2.3.1
Version: 2.3.2
Summary: Python tools to handle ASDF files
Home-page: http://github.com/spacetelescope/asdf
Author: Erik Bray, Dan D'Avella, Michael Droettboom
......
......@@ -10,7 +10,7 @@ import copy
import datetime
import warnings
import importlib
from distutils.version import LooseVersion
from pkg_resources import parse_version
import numpy as np
from jsonschema import ValidationError
......@@ -188,7 +188,7 @@ class AsdfFile(versioning.VersionedMixin):
if not installed[1]:
continue
# Compare version in file metadata with installed version
if LooseVersion(installed[1]) < LooseVersion(extension.software['version']):
if parse_version(installed[1]) < parse_version(extension.software['version']):
msg = "File {}was created with extension '{}' from " \
"package {}-{}, but older version {}-{} is installed"
fmt_msg = msg.format(
......
......@@ -253,6 +253,40 @@ def test_open_pathlib_path(tmpdir):
assert (af['data'] == tree['data']).all()
@pytest.mark.parametrize('installed,extension,warns', [
('1.2.3', '2.0.0', True),
('1.2.3', '2.0.dev10842', True),
('2.0.0', '2.0.0', False),
('2.0.1', '2.0.0', False),
('2.0.1', '2.0.dev12345', False),
])
def test_extension_version_check(installed, extension, warns):
af = asdf.AsdfFile()
af._fname = 'test.asdf'
af._extension_metadata['foo.extension.FooExtension'] = ('foo', installed)
tree = {
'history': {
'extensions': [
asdf.tags.core.ExtensionMetadata('foo.extension.FooExtension',
asdf.tags.core.Software(name='foo', version=extension)),
]
}
}
if warns:
with pytest.warns(UserWarning) as w:
af._check_extensions(tree)
assert str(w[0].message).startswith("File 'test.asdf' was created with")
with pytest.raises(RuntimeError) as err:
af._check_extensions(tree, strict=True)
err.match("^File 'test.asdf' was created with")
else:
af._check_extensions(tree)
@pytest.mark.xfail(reason='Setting auto_inline option modifies AsdfFile state')
def test_auto_inline(tmpdir):
......
......@@ -186,6 +186,19 @@ def test_implicit_conversion_warning():
assert len(w) == 0
@pytest.mark.xfail(reason='pyyaml has a bug and does not support tuple keys')
def test_python_tuple_key(tmpdir):
"""
This tests whether tuple keys are round-tripped properly.
As of this writing, this does not work in pyyaml but does work in
ruamel.yaml. If/when we decide to switch to ruamel.yaml, this test should
pass.
"""
tree = { (42, 1): 'foo' }
helpers.assert_roundtrip_tree(tree, tmpdir)
def test_tags_removed_after_load(tmpdir):
tree = {
"foo": ["bar", (1, 2, None)]
......
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2018-12-20 21:12:26 UTC
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2019-02-19 15:56:21 UTC
from __future__ import unicode_literals
import datetime
......@@ -187,8 +187,8 @@ def _get_repo_path(pathname, levels=None): # pragma: no cover
_packagename = "asdf"
_last_generated_version = "2.3.1"
_last_githash = "d09a3410aa3a3bf772f1ff95ab797edd6f624344"
_last_generated_version = "2.3.2"
_last_githash = "d47e50a0d0fb175f1763d7b768712276e4cbadee"
# Determine where the source code for this module
# lives. If __file__ is not a filesystem path then
......@@ -206,10 +206,10 @@ else:
major = 2
minor = 3
bugfix = 1
bugfix = 2
release = True
timestamp = datetime.datetime(2018, 12, 20, 21, 12, 26)
timestamp = datetime.datetime(2019, 2, 19, 15, 56, 21)
debug = False
astropy_helpers_version = "2.0.1"
......
......@@ -31,7 +31,7 @@ URL = metadata.get('url', '')
builtins._PACKAGE_NAME_ = PACKAGE_NAME
# VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
VERSION = '2.3.1'
VERSION = '2.3.2'
# Indicates if this version is a release version
RELEASE = 'dev' not in VERSION
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment