Commit 4576441c authored by Ole Streicher's avatar Ole Streicher

New upstream version 2.0.1

parent f33f2869
2.0.1 (2018-05-08)
------------------
- Allow test suite to run even when package is not installed. [#502]
2.0.0 (2018-04-19)
------------------
......
Metadata-Version: 1.2
Name: asdf
Version: 2.0.0
Version: 2.0.1
Summary: Python tools to handle ASDF files
Home-page: http://github.com/spacetelescope/asdf
Author: Erik Bray, Dan D'Avella, Michael Droettboom
......@@ -15,7 +15,7 @@ Description: ASDF - Advanced Scientific Data Format
.. figure:: docs/_static/stsci_logo.png
:alt: STScI Logo
.. _begin-summary-text
.. _begin-summary-text:
The **A**\ dvanced **S**\ cientific **D**\ ata **F**\ ormat (ASDF) is a
next-generation interchange format for scientific data. This package
......@@ -35,7 +35,7 @@ Description: ASDF - Advanced Scientific Data Format
serialized automatically
* ASDF can be extended to serialize custom data types
.. _end-summary-text
.. _end-summary-text:
ASDF is under active development `on github
<https://github.com/spacetelescope/asdf>`__. More information on contributing
......@@ -50,7 +50,7 @@ Description: ASDF - Advanced Scientific Data Format
Creating a file
~~~~~~~~~~~~~~~
.. _begin-create-file-text
.. _begin-create-file-text:
We're going to store several `numpy` arrays and other data to an ASDF file. We
do this by creating a "tree", which is simply a `dict`, and we provide it as
......@@ -133,12 +133,12 @@ Description: ASDF - Advanced Scientific Data Format
Available compression algorithms are ``'zlib'``, ``'bzp2'``, and
``'lz4'``.
.. _end-create-file-text
.. _end-create-file-text:
Reading a file
~~~~~~~~~~~~~~
.. _begin-read-file-text
.. _begin-read-file-text:
To read an existing ASDF file, we simply use the top-level `open` function of
the `asdf` package:
......@@ -156,7 +156,7 @@ Description: ASDF - Advanced Scientific Data Format
with asdf.open('example.asdf') as af:
...
To access the data stored in the file, use the top-level :attr:`AsdfFile.tree`
To access the data stored in the file, use the top-level `AsdfFile.tree`
attribute:
.. code:: python
......@@ -213,7 +213,7 @@ Description: ASDF - Advanced Scientific Data Format
af = asdf.open('example.asdf', copy_arrays=True)
.. _end-read-file-text
.. _end-read-file-text:
For more information and for advanced usage examples, see the
`documentation <#documentation>`__.
......@@ -230,7 +230,7 @@ Description: ASDF - Advanced Scientific Data Format
Installation
------------
.. _begin-pip-install-text
.. _begin-pip-install-text:
Stable releases of the ASDF Python package are registered `at
PyPi <https://pypi.python.org/pypi/asdf>`__. The latest stable version
......@@ -240,7 +240,7 @@ Description: ASDF - Advanced Scientific Data Format
$ pip install asdf
.. _begin-source-install-text
.. _begin-source-install-text:
The latest development version of ASDF is available from the ``master`` branch
`on github <https://github.com/spacetelescope/asdf>`__. To clone the project:
......@@ -271,12 +271,12 @@ Description: ASDF - Advanced Scientific Data Format
submodules <https://git-scm.com/docs/git-submodule>`__ for more
information.
.. _end-source-install-text
.. _end-source-install-text:
Testing
-------
.. _begin-testing-text
.. _begin-testing-text:
To run the unit tests from a source checkout of the repository:
......@@ -295,7 +295,7 @@ Description: ASDF - Advanced Scientific Data Format
Please note that the `astropy <https://github.com/astropy/astropy>`__
package must be installed to run the tests.
.. _end-testing-text
.. _end-testing-text:
Documentation
-------------
......@@ -331,6 +331,5 @@ Description: ASDF - Advanced Scientific Data Format
:target: http://www.stsci.edu
.. |astropy| image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: http://www.astropy.org/
Platform: UNKNOWN
Requires-Python: >=3.3
......@@ -148,7 +148,7 @@ The `open` function also works as a context handler:
with asdf.open('example.asdf') as af:
...
To access the data stored in the file, use the top-level :attr:`AsdfFile.tree`
To access the data stored in the file, use the top-level `AsdfFile.tree`
attribute:
.. code:: python
......
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import os
import abc
import warnings
from pkg_resources import iter_entry_points
......@@ -11,6 +11,7 @@ import importlib
from . import asdftypes
from . import resolver
from .version import version as asdf_version
from .util import get_class_name
from .exceptions import AsdfDeprecationWarning
......@@ -18,6 +19,9 @@ from .exceptions import AsdfDeprecationWarning
__all__ = ['AsdfExtension', 'AsdfExtensionList']
ASDF_TEST_BUILD_ENV = 'ASDF_TEST_BUILD'
@six.add_metaclass(abc.ABCMeta)
class AsdfExtension(object):
"""
......@@ -186,7 +190,6 @@ class _DefaultExtensions:
self._package_metadata = {}
def _load_installed_extensions(self, group='asdf_extensions'):
self._extensions = []
for entry_point in iter_entry_points(group=group):
ext = entry_point.load()
if not issubclass(ext, AsdfExtension):
......@@ -204,6 +207,15 @@ class _DefaultExtensions:
def extensions(self):
# This helps avoid a circular dependency with external packages
if not self._extensions:
# If this environment variable is defined, load the default
# extension. This allows the package to be tested without being
# installed (e.g. for builds on Debian).
if os.environ.get(ASDF_TEST_BUILD_ENV):
# Fake the extension metadata
name = get_class_name(BuiltinExtension, instance=False)
self._package_metadata[name] = ('asdf', asdf_version)
self._extensions.append(BuiltinExtension())
self._load_installed_extensions()
return self._extensions
......
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2018-04-19 18:28:43
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2018-05-08 14:49:44
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.0.0"
_last_githash = "f82537454fe0f3f1a4926bfd81c50741dd43c3f5"
_last_generated_version = "2.0.1"
_last_githash = "e82a4aadeced38a1c7fa518896bf99cd8d9d7628"
# 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 = 0
bugfix = 0
bugfix = 1
release = True
timestamp = datetime.datetime(2018, 4, 19, 18, 28, 43)
timestamp = datetime.datetime(2018, 5, 8, 14, 49, 44)
debug = False
try:
......
......@@ -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.0.0'
VERSION = '2.0.1'
# Indicates if this version is a release version
RELEASE = 'dev' not in VERSION
......
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import sys
import subprocess as sp
......@@ -84,4 +85,12 @@ def read_metadata(config_filename):
def read_readme(readme_filename):
with open(readme_filename) as ff:
return ff.read()
lines = ff.read().splitlines()
# Fix hyperlink targets so that the README displays properly on pypi
label_re = re.compile(r'^\.\.\s+_(\w|-)+$')
for i, line in enumerate(lines):
if label_re.match(line):
lines[i] = line + ':'
return '\n'.join(lines)
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