Commit 7af0cb5a authored by Ole Streicher's avatar Ole Streicher

New upstream version 1.3.2

parent d1c6f519
1.3.2 (2018-02-22)
------------------
- Updates to allow this version of ASDF to be compatible with Astropy v3.0.
[#450]
- Remove tests that are no longer relevant due to latest updates to Astropy's
testing infrastructure. [#458]
1.3.1 (2017-11-02)
------------------
......
Metadata-Version: 1.2
Name: asdf
Version: 1.3.1
Version: 1.3.2
Summary: Python tools to handle ASDF files
Home-page: http://github.com/spacetelescope/asdf
Author: Erik Bray, Michael Droettboom
......
......@@ -3,34 +3,34 @@
from __future__ import absolute_import, division, unicode_literals, print_function
import os
# this contains imports plugins that configure py.test for asdf tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
from astropy import __version__ as astropy_version
from astropy.tests.pytest_plugins import *
import multiprocessing
import os
import shutil
import tempfile
import pytest
import six
from .extern.RangeHTTPServer import RangeHTTPRequestHandler
# This is to figure out the affiliated package version, rather than
# using Astropy's
from . import version
from .tests.httpserver import HTTPServer, RangeHTTPServer
packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = version.version
# Uncomment the following line to treat all DeprecationWarnings as
# exceptions
enable_deprecations_as_exceptions()
# Uncomment the following line to treat all DeprecationWarnings as exceptions
kwargs = {}
if astropy_version >= '3.0':
kwargs['modules_to_ignore_on_import'] = ['astropy.tests.disable_internet']
enable_deprecations_as_exceptions(**kwargs)
try:
PYTEST_HEADER_MODULES['Astropy'] = 'astropy'
......@@ -44,55 +44,6 @@ except (NameError, KeyError):
pass
def run_server(queue, tmpdir, handler_class): # pragma: no cover
"""
Runs an HTTP server serving files from given tmpdir in a separate
process. When it's ready, it sends a URL to the server over a
queue so the main process (the HTTP client) can start making
requests of it.
"""
class HTTPRequestHandler(handler_class):
def translate_path(self, path):
path = handler_class.translate_path(self, path)
path = os.path.join(
tmpdir,
os.path.relpath(path, os.getcwd()))
return path
server = six.moves.socketserver.TCPServer(
("127.0.0.1", 0), HTTPRequestHandler)
domain, port = server.server_address
url = "http://{0}:{1}/".format(domain, port)
queue.put(url)
server.serve_forever()
class HTTPServer(object):
handler_class = six.moves.SimpleHTTPServer.SimpleHTTPRequestHandler
def __init__(self):
self.tmpdir = tempfile.mkdtemp()
q = multiprocessing.Queue()
self.process = multiprocessing.Process(
target=run_server,
args=(q, self.tmpdir, self.handler_class))
self.process.start()
self.url = q.get()
def finalize(self):
self.process.terminate()
shutil.rmtree(self.tmpdir)
class RangeHTTPServer(HTTPServer):
handler_class = RangeHTTPRequestHandler
@pytest.fixture()
def httpserver(request):
"""
......
......@@ -30,7 +30,7 @@ except ImportError:
CartesianDifferential = None
from ..asdf import AsdfFile, get_asdf_library_info
from ..conftest import RangeHTTPServer
from .httpserver import RangeHTTPServer
from ..extension import _builtin_extension_list
from .. import util
from .. import versioning
......
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
import os
import shutil
import multiprocessing
import six
import tempfile
from ..extern.RangeHTTPServer import RangeHTTPRequestHandler
__all__ = ['HTTPServer', 'RangeHTTPServer']
def run_server(queue, tmpdir, handler_class): # pragma: no cover
"""
Runs an HTTP server serving files from given tmpdir in a separate
process. When it's ready, it sends a URL to the server over a
queue so the main process (the HTTP client) can start making
requests of it.
"""
class HTTPRequestHandler(handler_class):
def translate_path(self, path):
path = handler_class.translate_path(self, path)
path = os.path.join(
tmpdir,
os.path.relpath(path, os.getcwd()))
return path
server = six.moves.socketserver.TCPServer(
("127.0.0.1", 0), HTTPRequestHandler)
domain, port = server.server_address
url = "http://{0}:{1}/".format(domain, port)
queue.put(url)
server.serve_forever()
class HTTPServer(object):
handler_class = six.moves.SimpleHTTPServer.SimpleHTTPRequestHandler
def __init__(self):
self.tmpdir = tempfile.mkdtemp()
q = multiprocessing.Queue()
self.process = multiprocessing.Process(
target=run_server,
args=(q, self.tmpdir, self.handler_class))
self.process.start()
self.url = q.get()
def finalize(self):
self.process.terminate()
shutil.rmtree(self.tmpdir)
class RangeHTTPServer(HTTPServer):
handler_class = RangeHTTPRequestHandler
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
import pytest
astropy = pytest.importorskip('astropy')
from astropy.tests.helper import remote_data
from astropy.tests.disable_internet import INTERNET_OFF
_REMOTE_DATA = False
@remote_data('any')
def test_internet_on():
global _REMOTE_DATA
_REMOTE_DATA = True
assert INTERNET_OFF == False
def test_internet_off():
if not _REMOTE_DATA:
assert INTERNET_OFF == True
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2017-11-03 15:55:17
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2018-02-22 15:58:18
from __future__ import unicode_literals
import datetime
......@@ -153,7 +153,7 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
# This function is tested but it is only ever executed within a subprocess when
# creating a fake package, so it doesn't get picked up by coverage metrics.
def _get_repo_path(pathname, levels=None): # pragma: no cover
def _get_repo_path(pathname, levels=None): # pragma: no cover
"""
Given a file or directory name, determine the root of the git repository
this path is under. If given, this won't look any higher than ``levels``
......@@ -185,9 +185,10 @@ def _get_repo_path(pathname, levels=None): # pragma: no cover
return None
_packagename = "asdf"
_last_generated_version = "1.3.1"
_last_githash = "93d796bb44d3df8b6131d8560aeaca32471b8719"
_last_generated_version = "1.3.2"
_last_githash = "d7e1288916c7569445125a613511c3ece64aa0f4"
# Determine where the source code for this module
# lives. If __file__ is not a filesystem path then
......@@ -205,10 +206,10 @@ else:
major = 1
minor = 3
bugfix = 1
bugfix = 2
release = True
timestamp = datetime.datetime(2017, 11, 3, 15, 55, 17)
timestamp = datetime.datetime(2018, 2, 22, 15, 58, 18)
debug = False
try:
......
......@@ -36,9 +36,14 @@ matrix:
- os: linux
env: PYTHON_VERSION=3.5 SPHINX_VERSION='<1.4'
- os: linux
env: PYTHON_VERSION=3.5 SPHINX_VERSION='<1.5'
env: PYTHON_VERSION=3.5 SPHINX_VERSION='<1.5' SETUPTOOLS_VERSION=27
- os: linux
env: PYTHON_VERSION=3.6 SPHINX_VERSION='<1.6'
env: PYTHON_VERSION=3.6 SPHINX_VERSION='<1.6' SETUPTOOLS_VERSION=27
allow_failures:
- env: PYTHON_VERSION=3.6 SETUPTOOLS_VERSION=dev DEBUG=True
CONDA_DEPENDENCIES='sphinx cython numpy packaging six appdirs'
EVENT_TYPE='push pull_request cron'
install:
......
astropy-helpers Changelog
*************************
2.0.4 (2018-02-09)
------------------
- Support dotted package names as namespace packages in generate_version_py.
[#370]
- Fix compatibility with setuptools 36.x and above. [#372]
- Fix false negative in add_openmp_flags_if_available when measuring code
coverage with gcc. [#374]
2.0.3 (2018-01-20)
------------------
- Make sure that astropy-helpers 3.x.x is not downloaded on Python 2. [#363]
- The bundled version of sphinx-automodapi has been updated to v0.7. [#365]
- Add --auto-use and --no-auto-use command-line flags to match the
``auto_use`` configuration option, and add an alias
``--use-system-astropy-helpers`` for ``--no-auto-use``. [#366]
2.0.2 (2017-10-13)
------------------
......@@ -28,6 +52,7 @@ astropy-helpers Changelog
- Allow custom Sphinx doctest extension to recognize and process standard
doctest directives ``testsetup`` and ``doctest``. [#335]
2.0.1 (2017-07-28)
------------------
......
......@@ -20,8 +20,8 @@ following two sphinx extensions:
in Numpy format
* `sphinx-automodapi <https://github.com/astropy/sphinx-automodapi>`_, a Sphinx
developed as part of the Astropy project. This used to be developed directly
in ``astropy-helpers`` but is now a standalone package.
extension developed as part of the Astropy project. This used to be developed
directly in ``astropy-helpers`` but is now a standalone package.
Issues with these sub-modules should be reported in their respective repositories,
and we will regularly update the bundled versions to reflect the latest released
......
......@@ -19,9 +19,14 @@ that section, and options therein, determine the next step taken: If it
contains an option called ``auto_use`` with a value of ``True``, it will
automatically call the main function of this module called
`use_astropy_helpers` (see that function's docstring for full details).
Otherwise no further action is taken (however,
``ah_bootstrap.use_astropy_helpers`` may be called manually from within the
setup.py script).
Otherwise no further action is taken and by default the system-installed version
of astropy-helpers will be used (however, ``ah_bootstrap.use_astropy_helpers``
may be called manually from within the setup.py script).
This behavior can also be controlled using the ``--auto-use`` and
``--no-auto-use`` command-line flags. For clarity, an alias for
``--no-auto-use`` is ``--use-system-astropy-helpers``, and we recommend using
the latter if needed.
Additional options in the ``[ah_boostrap]`` section of setup.cfg have the same
names as the arguments to `use_astropy_helpers`, and can be used to configure
......@@ -147,6 +152,11 @@ from distutils.debug import DEBUG
DIST_NAME = 'astropy-helpers'
PACKAGE_NAME = 'astropy_helpers'
if PY3:
UPPER_VERSION_EXCLUSIVE = None
else:
UPPER_VERSION_EXCLUSIVE = '3'
# Defaults for other options
DOWNLOAD_IF_NEEDED = True
INDEX_URL = 'https://pypi.python.org/simple'
......@@ -287,6 +297,18 @@ class _Bootstrapper(object):
config['offline'] = True
argv.remove('--offline')
if '--auto-use' in argv:
config['auto_use'] = True
argv.remove('--auto-use')
if '--no-auto-use' in argv:
config['auto_use'] = False
argv.remove('--no-auto-use')
if '--use-system-astropy-helpers' in argv:
config['auto_use'] = False
argv.remove('--use-system-astropy-helpers')
return config
def run(self):
......@@ -501,16 +523,32 @@ class _Bootstrapper(object):
if version:
req = '{0}=={1}'.format(DIST_NAME, version)
else:
req = DIST_NAME
if UPPER_VERSION_EXCLUSIVE is None:
req = DIST_NAME
else:
req = '{0}<{1}'.format(DIST_NAME, UPPER_VERSION_EXCLUSIVE)
attrs = {'setup_requires': [req]}
# NOTE: we need to parse the config file (e.g. setup.cfg) to make sure
# it honours the options set in the [easy_install] section, and we need
# to explicitly fetch the requirement eggs as setup_requires does not
# get honored in recent versions of setuptools:
# https://github.com/pypa/setuptools/issues/1273
try:
if DEBUG:
_Distribution(attrs=attrs)
else:
with _silence():
_Distribution(attrs=attrs)
context = _verbose if DEBUG else _silence
with context():
dist = _Distribution(attrs=attrs)
try:
dist.parse_config_files(ignore_option_errors=True)
dist.fetch_build_eggs(req)
except TypeError:
# On older versions of setuptools, ignore_option_errors
# doesn't exist, and the above two lines are not needed
# so we can just continue
pass
# If the setup_requires succeeded it will have added the new dist to
# the main working_set
......@@ -846,6 +884,10 @@ class _DummyFile(object):
pass
@contextlib.contextmanager
def _verbose():
yield
@contextlib.contextmanager
def _silence():
"""A context manager that silences sys.stdout and sys.stderr."""
......
......@@ -13,7 +13,7 @@ environment:
# babel 2.0 is known to break on Windows:
# https://github.com/python-babel/babel/issues/174
CONDA_DEPENDENCIES: "numpy Cython sphinx pytest babel!=2.0"
CONDA_DEPENDENCIES: "numpy Cython sphinx pytest babel!=2.0 setuptools"
matrix:
- PYTHON_VERSION: "2.7"
......
Metadata-Version: 1.1
Name: astropy-helpers
Version: 2.0.1
Version: 2.0.4
Summary: Utilities for building and installing Astropy, Astropy affiliated packages, and their respective documentation.
Home-page: https://github.com/astropy/astropy-helpers
Author: The Astropy Developers
Author-email: astropy.team@gmail.com
License: BSD
Description-Content-Type: UNKNOWN
Description: astropy-helpers
===============
......@@ -28,8 +29,8 @@ Description: astropy-helpers
in Numpy format
* `sphinx-automodapi <https://github.com/astropy/sphinx-automodapi>`_, a Sphinx
developed as part of the Astropy project. This used to be developed directly
in ``astropy-helpers`` but is now a standalone package.
extension developed as part of the Astropy project. This used to be developed
directly in ``astropy-helpers`` but is now a standalone package.
Issues with these sub-modules should be reported in their respective repositories,
and we will regularly update the bundled versions to reflect the latest released
......
......@@ -9,6 +9,7 @@ setup.py
astropy_helpers/__init__.py
astropy_helpers/distutils_helpers.py
astropy_helpers/git_helpers.py
astropy_helpers/openmp_helpers.py
astropy_helpers/setup_helpers.py
astropy_helpers/test_helpers.py
astropy_helpers/utils.py
......@@ -46,8 +47,8 @@ astropy_helpers/extern/automodapi/templates/autosummary_core/module.rst
astropy_helpers/extern/numpydoc/__init__.py
astropy_helpers/extern/numpydoc/docscrape.py
astropy_helpers/extern/numpydoc/docscrape_sphinx.py
astropy_helpers/extern/numpydoc/linkcode.py
astropy_helpers/extern/numpydoc/numpydoc.py
astropy_helpers/extern/numpydoc/templates/numpydoc_docstring.rst
astropy_helpers/sphinx/__init__.py
astropy_helpers/sphinx/conf.py
astropy_helpers/sphinx/setup_package.py
......@@ -72,5 +73,6 @@ astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png
astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
licenses/LICENSE_ASTROSCRAPPY.rst
licenses/LICENSE_COPYBUTTON.rst
licenses/LICENSE_NUMPYDOC.rst
\ No newline at end of file
......@@ -87,13 +87,17 @@ import inspect
import os
import re
import io
from distutils.version import LooseVersion
from sphinx import __version__
from sphinx.ext.autosummary import Autosummary
from sphinx.ext.inheritance_diagram import InheritanceDiagram
from docutils.parsers.rst.directives import flag
from .utils import find_mod_objs, cleanup_whitespace
SPHINX_LT_17 = LooseVersion(__version__) < LooseVersion('1.7')
def _str_list_converter(argument):
"""
......@@ -262,7 +266,7 @@ def process_automodsumm_generation(app):
suffix = os.path.splitext(sfn)[1]
if len(lines) > 0:
generate_automodsumm_docs(
lines, sfn, builder=app.builder, warn=app.warn, info=app.info,
lines, sfn, app=app, builder=app.builder, warn=app.warn, info=app.info,
suffix=suffix, base_path=app.srcdir,
inherited_members=app.config.automodsumm_inherited_members)
......@@ -295,8 +299,8 @@ def automodsumm_to_autosummary_lines(fn, app):
app : sphinx.application.Application
The sphinx Application object
Return
------
Returns
-------
lines : list of str
Lines for all `automodsumm` entries with the entries replaced by
`autosummary` and the module's members added.
......@@ -397,7 +401,7 @@ def automodsumm_to_autosummary_lines(fn, app):
return newlines
def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst', warn=None,
info=None, base_path=None, builder=None,
template_dir=None,
inherited_members=False):
......@@ -493,7 +497,11 @@ def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
f = open(fn, 'w')
try:
doc = get_documenter(obj, parent)
if SPHINX_LT_17:
doc = get_documenter(obj, parent)
else:
doc = get_documenter(app, obj, parent)
if template_name is not None:
template = template_env.get_template(template_name)
......@@ -511,8 +519,10 @@ def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
items = []
for name in dir(obj):
try:
documenter = get_documenter(safe_getattr(obj, name),
obj)
if SPHINX_LT_17:
documenter = get_documenter(safe_getattr(obj, name), obj)
else:
documenter = get_documenter(app, safe_getattr(obj, name), obj)
except AttributeError:
continue
if typ is None or documenter.objtype == typ:
......@@ -541,8 +551,10 @@ def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
for name in names:
try:
documenter = get_documenter(safe_getattr(obj, name),
obj)
if SPHINX_LT_17:
documenter = get_documenter(safe_getattr(obj, name), obj)
else:
documenter = get_documenter(app, safe_getattr(obj, name), obj)
except AttributeError:
continue
if typ is None or documenter.objtype == typ:
......
......@@ -160,7 +160,7 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
# This function is tested but it is only ever executed within a subprocess when
# creating a fake package, so it doesn't get picked up by coverage metrics.
def _get_repo_path(pathname, levels=None): # pragma: no cover
def _get_repo_path(pathname, levels=None): # pragma: no cover
"""
Given a file or directory name, determine the root of the git repository
this path is under. If given, this won't look any higher than ``levels``
......
......@@ -73,7 +73,7 @@ def add_openmp_flags_if_available(extension):
# Compile, link, and run test program
ccompiler.compile(['test_openmp.c'], output_dir='objects', extra_postargs=[compile_flag])
ccompiler.link_executable(glob.glob(os.path.join('objects', '*')), 'test_openmp', extra_postargs=[link_flag])
ccompiler.link_executable(glob.glob(os.path.join('objects', '*' + ccompiler.obj_extension)), 'test_openmp', extra_postargs=[link_flag])
output = subprocess.check_output('./test_openmp').decode(sys.stdout.encoding or 'utf-8').splitlines()
if 'nthreads=' in output[0]:
......
......@@ -308,8 +308,8 @@ def extends_doc(extended_func):
function, and appends to it (along with a newline) the docstring of the
wrapper function.
Example
-------
Examples
--------
>>> def foo():
... '''Hello.'''
......@@ -345,7 +345,7 @@ def deprecated(since, message='', name='', alternative='', pending=False,
To mark an attribute as deprecated, use `deprecated_attribute`.
Parameters
------------
----------
since : str
The release at which this API became deprecated. This is
required.
......
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2017-08-31 10:04:54.962827
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2018-02-22 15:58:01
from __future__ import unicode_literals
import datetime
version = "2.0.1"
githash = "14ca346b0da3e92e65bdc398cc8f726cbd7be57d"
version = "2.0.4"
githash = "41a607235bdc335c9c125f828bdd35502a09aff9"
major = 2
minor = 0
bugfix = 1
bugfix = 4
release = True
timestamp = datetime.datetime(2017, 8, 31, 10, 4, 54, 962827)
timestamp = datetime.datetime(2018, 2, 22, 15, 58, 1)
debug = False
try:
......
......@@ -116,6 +116,7 @@ except ImportError:
_FROZEN_VERSION_PY_WITH_GIT_HEADER = """
{git_helpers}
_packagename = "{packagename}"
_last_generated_version = "{verstr}"
_last_githash = "{githash}"
......@@ -253,7 +254,8 @@ def generate_version_py(packagename, version, release=None, debug=None,
# Likewise, keep whatever the current value is, if it exists
debug = bool(current_debug)
version_py = os.path.join(srcdir, packagename, 'version.py')
package_srcdir = os.path.join(srcdir, *packagename.split('.'))
version_py = os.path.join(package_srcdir, 'version.py')
if (last_generated_version != version or current_release != release or
current_debug != debug):
......
......@@ -8,7 +8,7 @@ from astropy_helpers.setup_helpers import register_commands, get_package_info
from astropy_helpers.version_helpers import generate_version_py
NAME = 'astropy_helpers'
VERSION = '2.0.2'
VERSION = '2.0.4'
RELEASE = 'dev' not in VERSION
generate_version_py(NAME, VERSION, RELEASE, False, uses_git=not RELEASE)
......
[tox]
envlist = py26,py27,py32,py33,py34
[testenv]
deps =
pytest
numpy
Cython
Sphinx==1.2.3
# Note: Sphinx is required to run the sphinx.ext tests
commands =
py.test {posargs}
sitepackages = False
[testenv:py32]
deps =
pygments<=1.9
Jinja2<2.7
{[testenv]deps}
......@@ -20,11 +20,6 @@ from astropy_helpers.setup_helpers import (
from astropy_helpers.git_helpers import get_git_devstr
from astropy_helpers.version_helpers import generate_version_py
from astropy_helpers import test_helpers
def _null_validate(self):
pass
test_helpers.AstropyTest._validate_required_deps = _null_validate
# Get some values from the setup.cfg
try:
from ConfigParser import ConfigParser
......@@ -51,7 +46,7 @@ LONG_DESCRIPTION = package.__doc__
builtins._PACKAGE_NAME_ = 'asdf'
# VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
VERSION = '1.3.1'
VERSION = '1.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