Skip to content

Commit

Permalink
Merge pull request #734 from spacetelescope/2.5.1x
Browse files Browse the repository at this point in the history
2.5.1x
  • Loading branch information
eslavich authored Jan 7, 2020
2 parents 29f897c + 6c4b11b commit 78df4d9
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ matrix:
# Test against prerelease versions of all dependencies
- env: TOXENV='prerelease'

# Test against an installed asdf package
- env: TOXENV='packaged'

# Try a run on OSX
- os: osx
env: TOXENV='py37-stable'
Expand Down
14 changes: 14 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2.6 (unreleased)
------------------

- Add ``package`` property to extension metadata, and deprecate
use of ``software``. [#728]

- AsdfDeprecationWarning now subclasses DeprecationWarning. [#710]

2.5.1 (2020-01-07)
------------------

- Fix bug in test causing failure when test suite is run against
an installed asdf package. [#732]

2.5.0 (2019-12-23)
------------------

Expand Down
2 changes: 1 addition & 1 deletion asdf/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,4 +428,4 @@ def test_get_default_resolver():

result = resolver('tag:stsci.edu:asdf/core/ndarray-1.0.0')

assert result.endswith("asdf-standard/schemas/stsci.edu/asdf/core/ndarray-1.0.0.yaml")
assert result.endswith("/schemas/stsci.edu/asdf/core/ndarray-1.0.0.yaml")
18 changes: 9 additions & 9 deletions asdf/tests/test_asdftypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def types(self):

def test_extension_override(tmpdir):

gwcs = pytest.importorskip('gwcs', '0.9.0')
gwcs = pytest.importorskip('gwcs', '0.12.0')

from asdf.extension import default_extensions
default_extensions.reset()
Expand All @@ -603,19 +603,19 @@ def test_extension_override(tmpdir):

with asdf.AsdfFile() as aa:
wti = aa.type_index._write_type_indices[version]
assert wti.from_custom_type(gwcs.WCS) is gwcs.tags.WCSType
assert wti.from_custom_type(gwcs.WCS) is gwcs.tags.wcs.WCSType
aa.tree['wcs'] = gwcs.WCS(output_frame='icrs')
aa.write_to(tmpfile)

with open(tmpfile, 'rb') as ff:
contents = str(ff.read())
assert gwcs.tags.WCSType.yaml_tag in contents
assert gwcs.tags.wcs.WCSType.yaml_tag in contents


def test_extension_override_subclass(tmpdir):

gwcs = pytest.importorskip('gwcs', '0.9.0')
astropy = pytest.importorskip('astropy', '3.0.0')
gwcs = pytest.importorskip('gwcs', '0.12.0')
astropy = pytest.importorskip('astropy', '4.0.0')
from astropy.modeling import models

from asdf.extension import default_extensions
Expand All @@ -629,16 +629,16 @@ class SubclassWCS(gwcs.WCS):

with asdf.AsdfFile() as aa:
wti = aa.type_index._write_type_indices[version]
assert wti.from_custom_type(gwcs.WCS) is gwcs.tags.WCSType
assert wti.from_custom_type(SubclassWCS) is gwcs.tags.WCSType
assert wti.from_custom_type(gwcs.WCS) is gwcs.tags.wcs.WCSType
assert wti.from_custom_type(SubclassWCS) is gwcs.tags.wcs.WCSType
# The duplication here is deliberate: make sure that nothing has changed
assert wti.from_custom_type(gwcs.WCS) is gwcs.tags.WCSType
assert wti.from_custom_type(gwcs.WCS) is gwcs.tags.wcs.WCSType
aa.tree['wcs'] = SubclassWCS(output_frame='icrs')
aa.write_to(tmpfile)

with open(tmpfile, 'rb') as ff:
contents = str(ff.read())
assert gwcs.tags.WCSType.yaml_tag in contents
assert gwcs.tags.wcs.WCSType.yaml_tag in contents


def test_tag_without_schema(tmpdir):
Expand Down
10 changes: 10 additions & 0 deletions docs/asdf/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
Changes
*******

What's New in ASDF 2.5.1?
=========================

The ASDF Standard is at v1.4.0.

Changes include:

- Fix bug in test causing failure when test suite is run against
an installed asdf package.

What's New in ASDF 2.5.0?
=========================

Expand Down
11 changes: 11 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ commands=
basepython= python3.7
pip_pre= true

[testenv:packaged]
basepython= python3.7
# The default tox working directory is in .tox in the source directory. If we
# execute pytest from there, it will discover tox.ini in the source directory
# and load the asdf module from the unpackaged sourcee, which is not what we
# want. The home directory does not have a tox.ini in any of its ancestors,
# so this will allow us to test the installed package.
changedir= {homedir}
commands=
pytest --pyargs asdf

[testenv:egg_info]
deps=
conda_deps=
Expand Down

0 comments on commit 78df4d9

Please sign in to comment.