Skip to content

Commit

Permalink
Merge pull request #620 from drdavella/v2.3.x
Browse files Browse the repository at this point in the history
Release candidate for v2.3.0
  • Loading branch information
drdavella authored Nov 28, 2018
2 parents 1388aa6 + 41a1990 commit 802995d
Show file tree
Hide file tree
Showing 60 changed files with 2,101 additions and 2,073 deletions.
52 changes: 28 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,64 +22,65 @@ env:
# overidden underneath. They are defined here in order to save having
# to repeat them for all configurations.
- PYTHON_VERSION=3.6
- PYTEST_VERSION=3.7
- PYTEST_VERSION=3.10
- ASTROPY_VERSION=stable
- NUMPY_VERSION=stable
- PIP_DEPENDENCIES='pytest-faulthandler importlib_resources'
- CONDA_DEPENDENCIES='semantic_version jsonschema pyyaml six lz4 pytest-astropy'
- ALL_PIP_DEPENDENCIES='pytest-faulthandler importlib_resources'
- PIP_DEPENDENCIES="$ALL_PIP_DEPENDENCIES"
- ALL_CONDA_DEPENDENCIES='semantic_version jsonschema pyyaml six lz4 pytest-astropy'
- CONDA_DEPENDENCIES="$ALL_CONDA_DEPENDENCIES"
- GWCS_GIT='git+git://github.com/spacetelescope/gwcs.git#egg=gwcs'
- GWCS_PIP='gwcs'
- MAIN_CMD='python setup.py'
- SETUP_CMD='test --remote-data'
- RUN_CMD='pytest'

matrix:
# Make sure that installation does not fail
- SETUP_CMD='install'
- RUN_CMD='python setup.py install'
# Make sure README will display properly on pypi
- PIP_DEPENDENCIES='twine' TWINE_CHECK=1
- PYTHON_VERSION=3.5 SETUP_CMD='test'
- PYTHON_VERSION=3.6 SETUP_CMD='test'
- PYTHON_VERSION=3.7 PYTEST_VERSION=3.8 SETUP_CMD='test'
- PYTHON_VERSION=3.5
- PYTHON_VERSION=3.6 PYTEST_VERSION=3.8
- PYTHON_VERSION=3.7 PYTEST_VERSION=3.9

matrix:
fast_finish: true
include:

# Do a coverage test
- env: SETUP_CMD='test --coverage --open-files --remote-data'
- env: COVERAGE=1
PIP_DEPENDENCIES="$ALL_PIP_DEPENDENCIES coverage coveralls"

# Check for sphinx doc build warnings - we do this first because it
# may run for a long time
- env: SETUP_CMD='build_docs -w'
- env: RUN_CMD='python setup.py build_docs -w'
CONDA_DEPENDENCIES="$ALL_CONDA_DEPENDENCIES sphinx-astropy"

# Do a code style check
- env: MAIN_CMD="flake8 asdf --count" SETUP_CMD=''
- env: RUN_CMD="flake8 asdf --count"
PIP_DEPENDENCIES="$ALL_PIP_DEPENDENCIES flake8"

# try older numpy versions
- env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.11 SETUP_CMD='test'
- env: NUMPY_VERSION=1.12 SETUP_CMD='test'
- env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.11
- env: NUMPY_VERSION=1.12

# run a test using native pytest
# also test against development version of Astropy
- env: MAIN_CMD='pytest' SETUP_CMD='' ASTROPY_VERSION=development
GWCS_PIP="$GWCS_GIT"
PYTEST_VERSION=3.8
- env: ASTROPY_VERSION=development GWCS_PIP="$GWCS_GIT"

# latest stable versions
- env: NUMPY_VERSION=stable SETUP_CMD='test'
- env: NUMPY_VERSION=stable

# Test against development version of numpy (this job can fail)
- env: NUMPY_VERSION=development SETUP_CMD='test'
- env: NUMPY_VERSION=development

# Try a run on OSX
- os: osx
env: NUMPY_VERSION=stable SETUP_CMD='test'
env: NUMPY_VERSION=stable

# Test against latest version of jsonschema
- env: PIP_DEPENDENCIES='jsonschema pytest-faulthandler importlib_resources'

allow_failures:
- env: NUMPY_VERSION=development SETUP_CMD='test'
- env: NUMPY_VERSION=development
- env: PIP_DEPENDENCIES='jsonschema pytest-faulthandler importlib_resources'

install:
Expand All @@ -92,12 +93,15 @@ script:
- if [[ $TWINE_CHECK ]]; then
python setup.py build sdist;
twine check dist/*;
elif [[ $COVERAGE ]]; then
coverage run --source=asdf -m pytest --remote-data --open-files;
coverage report -m;
else
$MAIN_CMD $SETUP_CMD;
$RUN_CMD;
fi

after_success:
# If coveralls.io is set up for this package, uncomment the line
# below and replace "packagename" with the name of your package.
# The coveragerc file may be customized as needed for your package.
- if [[ $SETUP_CMD == 'test --coverage --open-files --remote-data' ]]; then coveralls --rcfile='asdf/tests/coveragerc'; fi
- if [[ $COVERAGE ]]; then coveralls --rcfile='asdf/tests/coveragerc'; fi
22 changes: 22 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
2.3.0 (unreleased)
------------------

- Storage of arbitrary precision integers is now provided by
``asdf.IntegerType``. Reading a file with integer literals that are too
large now causes only a warning instead of a validation error. This is to
provide backwards compatibility for files that were created with a buggy
version of ASDF (see #553 below). [#566]

- Remove WCS tags. These are now provided by the `gwcs package
<https://github.com/spacetelescope/gwcs>`_. [#593]

- Deprecate the ``asdf.asdftypes`` module in favor of ``asdf.types``. [#611]

- Support use of ``pathlib.Path`` with ``asdf.open`` and ``AsdfFile.write_to``.
[#617]

- Update ASDF Standard submodule to version 1.3.0.

2.2.1 (2018-11-15)
------------------

Expand Down Expand Up @@ -31,6 +50,9 @@
index before any others. This fixes a bug that was related to the way that
subclass tags were overwritten by external extensions. [#598]

- Remove WCS tags. These are now provided by the `gwcs package
<https://github.com/spacetelescope/gwcs>`_. [#593]

2.1.1 (2018-11-01)
------------------

Expand Down
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ environment:
PYTEST_VERSION: "3.7"
MINICONDA_VERSION: "latest"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd"
SETUP_CMD: "test"
RUN_CMD: "pytest"
NUMPY_VERSION: "stable"
ASTROPY_VERSION: "stable"
GWCS_GIT: "git+git://github.com/spacetelescope/gwcs.git#egg=gwcs"
GWCS_PIP: "gwcs"
CONDA_DEPENDENCIES: "semantic_version jsonschema pyyaml six lz4 pytest=3.6 pytest-astropy"
CONDA_DEPENDENCIES: "semantic_version jsonschema pyyaml six lz4 pytest-astropy"
PIP_DEPENDENCIES: "pytest-faulthandler importlib_resources"
PYTHON_ARCH: "64"

matrix:
# Make sure that installation does not fail
- PYTHON_VERSION: "3.6"
SETUP_CMD: "install"
RUN_CMD: "python setup.py install"
platform: x64

- PYTHON_VERSION: "3.5"
Expand Down Expand Up @@ -65,4 +65,4 @@ install:
build: false

test_script:
- "%CMD_IN_ENV% python setup.py %SETUP_CMD%"
- "%CMD_IN_ENV% %RUN_CMD%"
2 changes: 1 addition & 1 deletion asdf-standard
5 changes: 3 additions & 2 deletions asdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

__all__ = [
'AsdfFile', 'CustomType', 'AsdfExtension', 'Stream', 'open', 'test',
'commands', 'ExternalArrayReference'
'commands', 'IntegerType', 'ExternalArrayReference'
]

try:
Expand All @@ -34,10 +34,11 @@
raise ImportError("asdf requires numpy")

from .asdf import AsdfFile, open_asdf
from .asdftypes import CustomType
from .types import CustomType
from .extension import AsdfExtension
from .stream import Stream
from . import commands
from .tags.core import IntegerType
from .tags.core.external_reference import ExternalArrayReference

from jsonschema import ValidationError
Expand Down
15 changes: 8 additions & 7 deletions asdf/asdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, tree=None, uri=None, extensions=None, version=None,
extensions : list of AsdfExtension
A list of extensions to use when reading and writing ASDF files.
See `~asdf.asdftypes.AsdfExtension` for more information.
See `~asdf.types.AsdfExtension` for more information.
version : str, optional
The ASDF version to use when writing out. If not
Expand Down Expand Up @@ -411,13 +411,14 @@ def comments(self):
"""
return self._comments

def _validate(self, tree, custom=True):
def _validate(self, tree, custom=True, reading=False):
tagged_tree = yamlutil.custom_tree_to_tagged_tree(
tree, self)
schema.validate(tagged_tree, self)
schema.validate(tagged_tree, self, reading=reading)
# Perform secondary validation pass if requested
if custom and self._custom_schema:
schema.validate(tagged_tree, self, self._custom_schema)
schema.validate(tagged_tree, self, self._custom_schema,
reading=reading)

def validate(self):
"""
Expand Down Expand Up @@ -650,10 +651,10 @@ def _open_asdf(cls, self, fd, uri=None, mode='r',

tree = reference.find_references(tree, self)
if not do_not_fill_defaults:
schema.fill_defaults(tree, self)
schema.fill_defaults(tree, self, reading=True)

try:
self._validate(tree)
self._validate(tree, reading=True)
except ValidationError:
self.close()
raise
Expand Down Expand Up @@ -1275,7 +1276,7 @@ def open_asdf(fd, uri=None, mode=None, validate_checksums=False,
extensions : list of AsdfExtension
A list of extensions to use when reading and writing ASDF files.
See `~asdf.asdftypes.AsdfExtension` for more information.
See `~asdf.types.AsdfExtension` for more information.
do_not_fill_defaults : bool, optional
When `True`, do not fill in missing default values.
Expand Down
Loading

0 comments on commit 802995d

Please sign in to comment.