Commit 4c9eb834 authored by Ole Streicher's avatar Ole Streicher

New upstream version 0.7

parent 76e01201
This diff is collapsed.
Metadata-Version: 1.1
Name: gammapy
Version: 0.6
Version: 0.7
Summary: A Python package for gamma-ray astronomy
Home-page: https://github.com/gammapy/gammapy
Author: The Gammapy developers
Author-email: gammapy@googlegroups.com
License: BSD
Description-Content-Type: UNKNOWN
Description:
* Code: https://github.com/gammapy/gammapy
* Docs: http://docs.gammapy.org/
......@@ -29,7 +30,6 @@ Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
......
......@@ -3,9 +3,9 @@ Gammapy
A Python Package for Gamma-ray Astronomy.
* Webpage: http://gammapy.org
* Code: https://github.com/gammapy/gammapy
* Docs: http://docs.gammapy.org/
* Tutorials: https://nbviewer.jupyter.org/github/gammapy/gammapy-extra/blob/master/index.ipynb
* Documentation: http://docs.gammapy.org/
* License: BSD-3
.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
......@@ -19,7 +19,11 @@ Status shields
* .. image:: http://img.shields.io/travis/gammapy/gammapy.svg?branch=master
:target: https://travis-ci.org/gammapy/gammapy
:alt: Test Status
:alt: Test Status Travis-CI
* .. image:: https://ci.appveyor.com/api/projects/status/duo8wgufg35b7cga?svg=true
:target: https://ci.appveyor.com/project/cdeil/gammapy/branch/master
:alt: Test Status Appveyor
* .. image:: https://img.shields.io/coveralls/gammapy/gammapy.svg
:target: https://coveralls.io/r/gammapy/gammapy
......@@ -29,18 +33,10 @@ Status shields
:target: https://landscape.io/github/gammapy/gammapy/master
:alt: Code Health
* .. image:: http://img.shields.io/badge/benchmarks-asv-green.svg?style=flat
:target: http://gammapy.github.io/gammapy-benchmarks/
:alt: Benchmarks
* .. image:: https://readthedocs.org/projects/gammapy/badge/?version=latest
:target: http://docs.gammapy.org/en/latest/
:alt: Documentation Status
* .. image:: http://img.shields.io/pypi/l/gammapy.svg
:target: https://pypi.python.org/pypi/gammapy/
:alt: License
* .. image:: http://img.shields.io/pypi/v/gammapy.svg?text=version
:target: https://pypi.python.org/pypi/gammapy/
:alt: Latest release
......@@ -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
......@@ -91,13 +96,24 @@ except:
use_setuptools()
# typing as a dependency for 1.6.1+ Sphinx causes issues when imported after
# initializing submodule with ah_boostrap.py
# See discussion and references in
# https://github.com/astropy/astropy-helpers/issues/302
try:
import typing # noqa
except ImportError:
pass
# Note: The following import is required as a workaround to
# https://github.com/astropy/astropy-helpers/issues/89; if we don't import this
# module now, it will get cleaned up after `run_setup` is called, but that will
# later cause the TemporaryDirectory class defined in it to stop working when
# used later on by setuptools
try:
import setuptools.py31compat
import setuptools.py31compat # noqa
except ImportError:
pass
......@@ -126,7 +142,6 @@ import pkg_resources
from setuptools import Distribution
from setuptools.package_index import PackageIndex
from setuptools.sandbox import run_setup
from distutils import log
from distutils.debug import DEBUG
......@@ -136,6 +151,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'
......@@ -276,6 +296,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):
......@@ -453,9 +485,10 @@ class _Bootstrapper(object):
# setup.py exists we can generate it
setup_py = os.path.join(path, 'setup.py')
if os.path.isfile(setup_py):
with _silence():
run_setup(os.path.join(path, 'setup.py'),
['egg_info'])
# We use subprocess instead of run_setup from setuptools to
# avoid segmentation faults - see the following for more details:
# https://github.com/cython/cython/issues/2104
sp.check_output([sys.executable, 'setup.py', 'egg_info'], cwd=path)
for dist in pkg_resources.find_distributions(path, True):
# There should be only one...
......@@ -490,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
......@@ -702,7 +751,7 @@ class _Bootstrapper(object):
if self.offline:
cmd.append('--no-fetch')
elif status == 'U':
raise _AHBoostrapSystemExit(
raise _AHBootstrapSystemExit(
'Error: Submodule {0} contains unresolved merge conflicts. '
'Please complete or abandon any changes in the submodule so that '
'it is in a usable state, then try again.'.format(submodule))
......@@ -763,7 +812,7 @@ def run_cmd(cmd):
msg = 'Command not found: `{0}`'.format(' '.join(cmd))
raise _CommandNotFound(msg, cmd)
else:
raise _AHBoostrapSystemExit(
raise _AHBootstrapSystemExit(
'An unexpected error occurred when running the '
'`{0}` command:\n{1}'.format(' '.join(cmd), str(e)))
......@@ -835,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."""
......@@ -878,46 +931,6 @@ class _AHBootstrapSystemExit(SystemExit):
super(_AHBootstrapSystemExit, self).__init__(msg, *args[1:])
if sys.version_info[:2] < (2, 7):
# In Python 2.6 the distutils log does not log warnings, errors, etc. to
# stderr so we have to wrap it to ensure consistency at least in this
# module
import distutils
class log(object):
def __getattr__(self, attr):
return getattr(distutils.log, attr)
def warn(self, msg, *args):
self._log_to_stderr(distutils.log.WARN, msg, *args)
def error(self, msg):
self._log_to_stderr(distutils.log.ERROR, msg, *args)
def fatal(self, msg):
self._log_to_stderr(distutils.log.FATAL, msg, *args)
def log(self, level, msg, *args):
if level in (distutils.log.WARN, distutils.log.ERROR,
distutils.log.FATAL):
self._log_to_stderr(level, msg, *args)
else:
distutils.log.log(level, msg, *args)
def _log_to_stderr(self, level, msg, *args):
# This is the only truly 'public' way to get the current threshold
# of the log
current_threshold = distutils.log.set_threshold(distutils.log.WARN)
distutils.log.set_threshold(current_threshold)
if level >= current_threshold:
if args:
msg = msg % args
sys.stderr.write('%s\n' % msg)
sys.stderr.flush()
log = log()
BOOTSTRAPPER = _Bootstrapper.main()
......
......@@ -10,48 +10,49 @@ os:
# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false
# The apt packages below are needed for sphinx builds, which can no longer
# be installed with sudo apt-get.
addons:
apt:
packages:
- graphviz
env:
matrix:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.3
- PYTHON_VERSION=3.4
- PYTHON_VERSION=2.7 EVENT_TYPE='push pull_request cron'
- PYTHON_VERSION=3.4 SETUPTOOLS_VERSION=20
- PYTHON_VERSION=3.5
- PYTHON_VERSION=3.6 EVENT_TYPE='push pull_request cron'
- PYTHON_VERSION=3.6 SETUPTOOLS_VERSION=dev DEBUG=True
CONDA_DEPENDENCIES='sphinx cython numpy six pytest-cov'
EVENT_TYPE='push pull_request cron'
global:
- CONDA_DEPENDENCIES="setuptools pytest sphinx cython numpy"
- CONDA_DEPENDENCIES="setuptools sphinx cython numpy"
- PIP_DEPENDENCIES="coveralls pytest-cov"
- EVENT_TYPE='push pull_request'
matrix:
include:
- os: linux
env: PYTHON_VERSION=2.7 SETUPTOOLS_VERSION=20
- os: linux
env: PYTHON_VERSION=2.7 SETUPTOOLS_VERSION=dev DEBUG=True
CONDA_DEPENDENCIES='pytest sphinx cython numpy'
allow_failures:
- os: linux
env: PYTHON_VERSION=2.7 SETUPTOOLS_VERSION=dev DEBUG=True
CONDA_DEPENDENCIES='pytest sphinx cython numpy'
before_install:
- if [[ $TRAVIS_OS_NAME == osx ]]; then brew update; brew install graphviz; fi
include:
- os: linux
env: PYTHON_VERSION=3.6 SPHINX_VERSION='>1.6'
- os: linux
env: PYTHON_VERSION=3.6 PIP_DEPENDENCIES='git+https://github.com/sphinx-doc/sphinx.git#egg=sphinx coveralls pytest-cov'
CONDA_DEPENDENCIES="setuptools cython numpy"
- os: linux
env: PYTHON_VERSION=3.5 SPHINX_VERSION='<1.4'
- os: linux
env: PYTHON_VERSION=3.5 SPHINX_VERSION='<1.5' SETUPTOOLS_VERSION=27
- os: linux
env: PYTHON_VERSION=3.6 SPHINX_VERSION='<1.6' SETUPTOOLS_VERSION=27
# Uncomment the following if there are issues in setuptools that we
# can't work around quickly - otherwise leave uncommented so that
# we notice when things go wrong.
#
# allow_failures:
# - env: PYTHON_VERSION=3.6 SETUPTOOLS_VERSION=dev DEBUG=True
# CONDA_DEPENDENCIES='sphinx cython numpy six pytest-cov'
# EVENT_TYPE='push pull_request cron'
install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh
- source ci-helpers/travis/setup_conda.sh
# We cannot install the developer version of setuptools using pip because
# pip tries to remove the previous version of setuptools before the
......@@ -68,5 +69,11 @@ script:
# Use full path for coveragerc; see issue #193
- py.test --cov astropy_helpers --cov-config $(pwd)/astropy_helpers/tests/coveragerc astropy_helpers
# In conftest.py we produce a .coverage.subprocess that contains coverage
# statistics for sub-processes, so we combine it with the main one here.
- mv .coverage .coverage.main
- coverage combine .coverage.main .coverage.subprocess
- coverage report
after_success:
- coveralls
- coveralls --rcfile=astropy_helpers/tests/coveragerc
astropy-helpers Changelog
=========================
*************************
2.0.6 (2018-02-24)
------------------
- Avoid deprecation warning due to ``exclude=`` keyword in ``setup.py``. [#379]
2.0.5 (2018-02-22)
------------------
- Fix segmentation faults that occurred when the astropy-helpers submodule
was first initialized in packages that also contained Cython code. [#375]
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)
------------------
- Added new helper function add_openmp_flags_if_available that can add
OpenMP compilation flags to a C/Cython extension if needed. [#346]
- Update numpydoc to v0.7. [#343]
- The function ``get_git_devstr`` now returns ``'0'`` instead of ``None`` when
no git repository is present. This allows generation of development version
strings that are in a format that ``setuptools`` expects (e.g. "1.1.3.dev0"
instead of "1.1.3.dev"). [#330]
- It is now possible to override generated timestamps to make builds
reproducible by setting the ``SOURCE_DATE_EPOCH`` environment variable [#341]
- Mark Sphinx extensions as parallel-safe. [#344]
- Switch to using mathjax instead of imgmath for local builds. [#342]
- Deprecate ``exclude`` parameter of various functions in setup_helpers since
it could not work as intended. Add new function ``add_exclude_packages`` to
provide intended behavior. [#331]
- Allow custom Sphinx doctest extension to recognize and process standard
doctest directives ``testsetup`` and ``doctest``. [#335]
2.0.1 (2017-07-28)
------------------
- Fix compatibility with Sphinx <1.5. [#326]
2.0 (2017-07-06)
----------------
- Add support for package that lies in a subdirectory. [#249]
- Removing ``compat.subprocess``. [#298]
- Python 3.3 is no longer supported. [#300]
- The 'automodapi' Sphinx extension (and associated dependencies) has now
been moved to a standalone package which can be found at
https://github.com/astropy/sphinx-automodapi - this is now bundled in
astropy-helpers under astropy_helpers.extern.automodapi for
convenience. Version shipped with astropy-helpers is v0.6.
[#278, #303, #309, #323]
- The ``numpydoc`` Sphinx extension has now been moved to
``astropy_helpers.extern``. [#278]
- Fix ``build_docs`` error catching, so it doesn't hide Sphinx errors. [#292]
- Fix compatibility with Sphinx 1.6. [#318]
- Updating ez_setup.py to the last version before it's removal. [#321]
1.3.1 (2017-03-18)
------------------
......@@ -57,7 +154,7 @@ astropy-helpers Changelog
------------------
- Fixed crash in build with ``AttributeError: cython_create_listing`` with
older versions of setuptools. [#209]
older versions of setuptools. [#209, #210]
1.1 (2015-12-10)
......@@ -123,7 +220,7 @@ astropy-helpers Changelog
------------------
- Fixed issue with the sphinx documentation css where the line numbers for code
blocks were not aligned with the code. [#179]
blocks were not aligned with the code. [#179, #180]
- Fixed crash that could occur when trying to build Cython extension modules
when Cython isn't installed. Normally this still results in a failed build,
......@@ -134,11 +231,11 @@ astropy-helpers Changelog
found. [#182]
- Quieted warnings about deprecated Numpy API in Cython extensions, when
building Cython extensions against Numpy >= 1.7. [#183]
building Cython extensions against Numpy >= 1.7. [#183, #186]
- Improved support for py.test >= 2.7--running the ``./setup.py test`` command
now copies all doc pages into the temporary test directory as well, so that
all test files have a "common root directory". [#189]
all test files have a "common root directory". [#189, #190]
1.0.3 (2015-07-22)
......@@ -274,15 +371,15 @@ astropy-helpers Changelog
- Fixed an issue on Python 3 where importing a package using astropy-helper's
generated version.py module would crash when the current working directory
is an empty git repository. [#114]
is an empty git repository. [#114, #137]
- Fixed an issue where the "revision count" appended to .dev versions by
the generated version.py did not accurately reflect the revision count for
the package it belongs to, and could be invalid if the current working
directory is an unrelated git repository. [#107]
directory is an unrelated git repository. [#107, #137]
- Likewise, fixed a confusing warning message that could occur in the same
circumstances as the above issue. [#121]
circumstances as the above issue. [#121, #137]
0.4.4 (2014-12-31)
......
......@@ -11,6 +11,21 @@ leverage this work. The motivation behind this package and details of its
implementation are in the accepted
`Astropy Proposal for Enhancement (APE) 4 <https://github.com/astropy/astropy-APEs/blob/master/APE4.rst>`_.
The ``astropy_helpers.extern`` sub-module includes modules developed elsewhere
that are bundled here for convenience. At the moment, this consists of the
following two sphinx extensions:
* `numpydoc <https://github.com/numpy/numpydoc>`_, a Sphinx extension
developed as part of the Numpy project. This is used to parse docstrings