Commit 93869ccb authored by Ole Streicher's avatar Ole Streicher

New upstream version 1.0.1

parent 90511f4d
Metadata-Version: 1.1
Name: ccdproc
Version: 0.3.3
Version: 1.0.1
Summary: Astropy affiliated package
Home-page: http://ccdproc.readthedocs.org/
Author: Steve Crawford and Matt Craig
......
......@@ -22,8 +22,14 @@ and working on it!
Documentation is at `ccdproc.readthedocs.org
<http://ccdproc.readthedocs.org/en/latest/>`_
If you have found ccdproc useful to your research, please considering adding a
citation to `Crawford, S. M., Craig, M. W., & ccdproc collaborators, 2015, Astrophysics Source Code Library, 1510.007 <http://adsabs.harvard.edu/abs/2015ascl.soft10007C>`_
Thanks to Kyle Barbary (`@kbarbary`_) for designing the `ccdproc` logo.
.. _Astropy: http://www.astropy.org/
.. _git: http://git-scm.com/
.. _github: http://github.com
.. _Cython: http://cython.org/
.. _online documentation: http://ccdproc.readthedocs.org/en/latest/ccdproc/install.html
.. _@kbarbary: https://github.com/kbarbary
[run]
source =
astropy_helpers
ah_bootstrap
omit = astropy_helpers/tests*
[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about packages we have installed
except ImportError
# Don't complain if tests don't hit assertions
raise AssertionError
raise NotImplementedError
# Don't complain about script hooks
def main\(.*\):
......@@ -13,36 +13,32 @@ env:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.3
- PYTHON_VERSION=3.4
- PYTHON_VERSION=3.5
global:
- SETUPTOOLS_VERSION=stable
- SETUPTOOLS_VERSION=stable
- CONDA_DEPENDENCIES="pytest sphinx cython numpy"
- PIP_DEPENDENCIES="coveralls pytest-cov"
matrix:
include:
- os: linux
env: PYTHON_VERSION=2.7 SETUPTOOLS_VERSION=dev
CONDA_DEPENDENCIES="pytest sphinx cython numpy mercurial mock"
before_install:
# Use utf8 encoding. Should be default, but this is insurance against
# future changes
- export PYTHONIOENCODING=UTF8
- if [[ $TRAVIS_OS_NAME == linux ]]; then sudo apt-get update; sudo apt-get install graphviz; fi
- if [[ $TRAVIS_OS_NAME == osx ]]; then brew update; brew install graphviz; fi
# Install conda
- source continuous-integration/travis/install_conda_$TRAVIS_OS_NAME.sh
install:
# Install graphviz
- source continuous-integration/travis/install_graphviz_$TRAVIS_OS_NAME.sh
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh
install:
- conda create --yes -n test python=$PYTHON_VERSION
- source activate test
- conda install --yes pip "pytest<2.6" sphinx cython numpy
- pip install coveralls pytest-cov
# We cannot install the developer version of setuptools using pip because
# pip tries to remove the previous version of setuptools before the
# installation is complete, which causes issues. Instead, we just install
# setuptools manually.
- if [[ $SETUPTOOLS_VERSION == dev ]]; then conda install --yes mercurial mock; fi
- if [[ $SETUPTOOLS_VERSION == dev ]]; then hg clone https://bitbucket.org/pypa/setuptools; cd setuptools; python setup.py install; cd ..; fi
before_script:
......@@ -51,7 +47,8 @@ before_script:
- git config --global user.email "author@example.com"
script:
- py.test --cov astropy_helpers astropy_helpers
# Use full path for coveragerc; see issue #193
- py.test --cov astropy_helpers --cov-config $(pwd)/astropy_helpers/tests/coveragerc astropy_helpers
after_success:
- coveralls
astropy-helpers Changelog
=========================
1.1.1 (2015-12-23)
------------------
- Fixed crash in build with ``AttributeError: cython_create_listing`` with
older versions of setuptools. [#209]
1.1 (2015-12-10)
----------------
- The original ``AstropyTest`` class in ``astropy_helpers``, which implements
the ``setup.py test`` command, is deprecated in favor of moving the
implementation of that command closer to the actual Astropy test runner in
``astropy.tests``. Now a dummy ``test`` command is provided solely for
informing users that they need ``astropy`` installed to run the tests
(however, the previous, now deprecated implementation is still provided and
continues to work with older versions of Astropy). See the related issue for
more details. [#184]
- Added a useful new utility function to ``astropy_helpers.utils`` called
``find_data_files``. This is similar to the ``find_packages`` function in
setuptools in that it can be used to search a package for data files
(matching a pattern) that can be passed to the ``package_data`` argument for
``setup()``. See the docstring to ``astropy_helpers.utils.find_data_files``
for more details. [#42]
- The ``astropy_helpers`` module now sets the global ``_ASTROPY_SETUP_``
flag upon import (from within a ``setup.py``) script, so it's not necessary
to have this in the ``setup.py`` script explicitly. If in doubt though,
there's no harm in setting it twice. Putting it in ``astropy_helpers``
just ensures that any other imports that occur during build will have this
flag set. [#191]
- It is now possible to use Cython as a ``setup_requires`` build requirement,
and still build Cython extensions even if Cython wasn't available at the
beginning of the build processes (that is, is automatically downloaded via
setuptools' processing of ``setup_requires``). [#185]
- Moves the ``adjust_compiler`` check into the ``build_ext`` command itself,
so it's only used when actually building extension modules. This also
deprecates the stand-alone ``adjust_compiler`` function. [#76]
- When running the ``build_sphinx`` / ``build_docs`` command with the ``-w``
option, the output from Sphinx is streamed as it runs instead of silently
buffering until the doc build is complete. [#197]
1.0.6 (2015-12-04)
------------------
- Fixed bug where running ``./setup.py build_sphinx`` could return successfully
even when the build was not successful (and should have returned a non-zero
error code). [#199]
1.0.5 (2015-10-02)
------------------
......@@ -11,13 +66,6 @@ astropy-helpers Changelog
1.0.4 (2015-10-02)
------------------
- Fixed a crash in ``ah_bootstrap.py`` when astropy-helpers can't be downloaded
due to use off the ``--offline`` option, and a local copy is not available.
- 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]
- Fixed issue with the sphinx documentation css where the line numbers for code
blocks were not aligned with the code. [#179]
......@@ -32,6 +80,10 @@ astropy-helpers Changelog
- Quieted warnings about deprecated Numpy API in Cython extensions, when
building Cython extensions against Numpy >= 1.7. [#183]
- 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]
1.0.3 (2015-07-22)
------------------
......@@ -105,7 +157,6 @@ astropy-helpers Changelog
to a crash when installing packages that import matplotlib at build time.
[#144]
1.0 (2015-02-17)
----------------
......
......@@ -6,10 +6,11 @@ environment:
global:
PYTHON: "C:\\conda"
MINICONDA_VERSION: "3.5.5"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\continuous-integration\\appveyor\\windows_sdk.cmd"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd"
PYTHON_ARCH: "64" # needs to be set for CMD_IN_ENV to succeed. If a mix
# of 32 bit and 64 bit builds are needed, move this
# to the matrix section.
CONDA_DEPENDENCIES: "numpy Cython sphinx pytest"
matrix:
- PYTHON_VERSION: "2.6"
......@@ -20,23 +21,13 @@ platform:
-x64
install:
# Install miniconda using a powershell script.
- "powershell continuous-integration/appveyor/install-miniconda.ps1"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Install the build and runtime dependencies of the project.
- "conda update --yes conda"
# Create a conda environment
- "conda create -q --yes -n test python=%PYTHON_VERSION%"
# Set up ci-helpers
- "git clone git://github.com/astropy/ci-helpers.git"
- "powershell ci-helpers/appveyor/install-miniconda.ps1"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "activate test"
# Check that we have the expected version of Python
- "python --version"
# Install specified version of numpy and dependencies
- "conda install -q --yes numpy Cython sphinx pytest"
# Some of the tests use git commands that require a user to be configured
- git config --global user.name "A U Thor"
- git config --global user.email "author@example.com"
......
Metadata-Version: 1.1
Name: astropy-helpers
Version: 0.4.dev94
Summary: UNKNOWN
Version: 1.1.1
Summary: Utilities for building and installing Astropy, Astropy affiliated packages, and their respective documentation.
Home-page: http://astropy.org
Author: The Astropy Developers
Author-email: astropy.team@gmail.com
License: BSD
Download-URL: http://pypi.python.org/packages/source/a/astropy-helpers/astropy-0.4.dev94.tar.gz
Description: UNKNOWN
Download-URL: http://pypi.python.org/packages/source/a/astropy-helpers/astropy-helpers-1.1.1.tar.gz
Description: astropy-helpers
===============
This project provides a Python package, ``astropy_helpers``, which includes
many build, installation, and documentation-related tools used by the Astropy
project, but packaged separately for use by other projects that wish to
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>`_.
``astropy_helpers`` includes a special "bootstrap" module called
``ah_bootstrap.py`` which is intended to be used by a project's setup.py in
order to ensure that the ``astropy_helpers`` package is available for
build/installation. This is similar to the ``ez_setup.py`` module that is
shipped with some projects to bootstrap `setuptools
<https://bitbucket.org/pypa/setuptools>`_.
As described in APE4, the version numbers for ``astropy_helpers`` follow the
corresponding major/minor version of the `astropy core package
<http://www.astropy.org/>`_, but with an independent sequence of micro (bugfix)
version numbers. Hence, the initial release is 0.4, in parallel with Astropy
v0.4, which will be the first version of Astropy to use ``astropy-helpers``.
For examples of how to implement ``astropy-helpers`` in a project,
see the ``setup.py`` and ``setup.cfg`` files of the
`Affiliated package template <https://github.com/astropy/package-template>`_.
.. image:: https://travis-ci.org/astropy/astropy-helpers.png
:target: https://travis-ci.org/astropy/astropy-helpers
.. image:: https://coveralls.io/repos/astropy/astropy-helpers/badge.png
:target: https://coveralls.io/r/astropy/astropy-helpers
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Framework :: Setuptools Plugin
Classifier: Framework :: Sphinx :: Extension
Classifier: Framework :: Sphinx :: Theme
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Archiving :: Packaging
CHANGES.rst
LICENSE.rst
MANIFEST.in
README.rst
......@@ -6,6 +7,7 @@ ez_setup.py
setup.cfg
setup.py
astropy_helpers/__init__.py
astropy_helpers/distutils_helpers.py
astropy_helpers/git_helpers.py
astropy_helpers/setup_helpers.py
astropy_helpers/test_helpers.py
......@@ -17,6 +19,18 @@ astropy_helpers.egg-info/SOURCES.txt
astropy_helpers.egg-info/dependency_links.txt
astropy_helpers.egg-info/not-zip-safe
astropy_helpers.egg-info/top_level.txt
astropy_helpers/commands/__init__.py
astropy_helpers/commands/_dummy.py
astropy_helpers/commands/_test_compat.py
astropy_helpers/commands/build_ext.py
astropy_helpers/commands/build_py.py
astropy_helpers/commands/build_sphinx.py
astropy_helpers/commands/install.py
astropy_helpers/commands/install_lib.py
astropy_helpers/commands/register.py
astropy_helpers/commands/setup_package.py
astropy_helpers/commands/test.py
astropy_helpers/commands/src/compiler.c
astropy_helpers/compat/__init__.py
astropy_helpers/compat/subprocess.py
astropy_helpers/compat/_subprocess_py2/__init__.py
......@@ -25,6 +39,7 @@ astropy_helpers/sphinx/conf.py
astropy_helpers/sphinx/setup_package.py
astropy_helpers/sphinx/ext/__init__.py
astropy_helpers/sphinx/ext/astropyautosummary.py
astropy_helpers/sphinx/ext/autodoc_enhancements.py
astropy_helpers/sphinx/ext/automodapi.py
astropy_helpers/sphinx/ext/automodsumm.py
astropy_helpers/sphinx/ext/changelog_links.py
......@@ -45,19 +60,22 @@ astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst
astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst
astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst
astropy_helpers/sphinx/ext/tests/__init__.py
astropy_helpers/sphinx/ext/tests/test_autodoc_enhancements.py
astropy_helpers/sphinx/ext/tests/test_automodapi.py
astropy_helpers/sphinx/ext/tests/test_automodsumm.py
astropy_helpers/sphinx/ext/tests/test_docscrape.py
astropy_helpers/sphinx/ext/tests/test_utils.py
astropy_helpers/sphinx/local/python3links.inv
astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout.svg
astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png
astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico
astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.svg
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/sidebar.js
astropy_helpers/src/__init__.py
astropy_helpers/src/compiler.c
astropy_helpers/src/setup_package.py
\ No newline at end of file
astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
\ No newline at end of file
......@@ -33,3 +33,20 @@ try:
except:
# Ignore if this fails for *any* reason*
pass
import os
# Ensure that all module-level code in astropy or other packages know that
# we're in setup mode:
if ('__main__' in sys.modules and
hasattr(sys.modules['__main__'], '__file__')):
filename = os.path.basename(sys.modules['__main__'].__file__)
if filename.rstrip('co') == 'setup.py':
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
builtins._ASTROPY_SETUP_ = True
del filename
"""
Provides a base class for a 'dummy' setup.py command that has no functionality
(probably due to a missing requirement). This dummy command can raise an
exception when it is run, explaining to the user what dependencies must be met
to use this command.
The reason this is at all tricky is that we want the command to be able to
provide this message even when the user passes arguments to the command. If we
don't know ahead of time what arguments the command can take, this is
difficult, because distutils does not allow unknown arguments to be passed to a
setup.py command. This hacks around that restriction to provide a useful error
message even when a user passes arguments to the dummy implementation of a
command.
Use this like:
try:
from some_dependency import SetupCommand
except ImportError:
from ._dummy import _DummyCommand
class SetupCommand(_DummyCommand):
description = \
'Implementation of SetupCommand from some_dependency; '
'some_dependency must be installed to run this command'
# This is the message that will be raised when a user tries to
# run this command--define it as a class attribute.
error_msg = \
"The 'setup_command' command requires the some_dependency "
"package to be installed and importable."
"""
import sys
from setuptools import Command
from distutils.errors import DistutilsArgError
from textwrap import dedent
class _DummyCommandMeta(type):
"""
Causes an exception to be raised on accessing attributes of a command class
so that if ``./setup.py command_name`` is run with additional command-line
options we can provide a useful error message instead of the default that
tells users the options are unrecognized.
"""
def __init__(cls, name, bases, members):
if bases == (Command, object):
# This is the _DummyCommand base class, presumably
return
if not hasattr(cls, 'description'):
raise TypeError(
"_DummyCommand subclass must have a 'description' "
"attribute.")
if not hasattr(cls, 'error_msg'):
raise TypeError(
"_DummyCommand subclass must have an 'error_msg' "
"attribute.")
def __getattribute__(cls, attr):
if attr in ('description', 'error_msg'):
# Allow cls.description to work so that `./setup.py
# --help-commands` still works
return super(_DummyCommandMeta, cls).__getattribute__(attr)
raise DistutilsArgError(cls.error_msg)
if sys.version_info[0] < 3:
exec(dedent("""
class _DummyCommand(Command, object):
__metaclass__ = _DummyCommandMeta
"""))
else:
exec(dedent("""
class _DummyCommand(Command, object, metaclass=_DummyCommandMeta):
pass
"""))
This diff is collapsed.
from __future__ import print_function
import inspect
import os
import pkgutil
......@@ -170,20 +172,22 @@ class AstropyBuildSphinx(SphinxBuildDoc):
# prevents a continuous updating at the terminal, but there's no
# apparent way around this.
if self.warnings_returncode:
proc = subprocess.Popen([sys.executable],
proc = subprocess.Popen([sys.executable, '-c', subproccode],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdo, stde = proc.communicate(subproccode.encode('utf-8'))
print(stdo)
stdolines = stdo.splitlines()
with proc.stdout:
for line in iter(proc.stdout.readline, b''):
line = line.strip(b'\n')
print(line.decode('utf-8'))
if 'build succeeded.' in str(line):
retcode = 0
else:
retcode = 1
if b'build succeeded.' in stdolines:
retcode = 0
else:
retcode = 1
# Poll to set proc.retcode
proc.wait()
if retcode != 0:
if os.environ.get('TRAVIS', None) == 'true':
......@@ -215,6 +219,7 @@ class AstropyBuildSphinx(SphinxBuildDoc):
else:
log.warn('Sphinx Documentation subprocess failed with return '
'code ' + str(proc.returncode))
retcode = proc.returncode
if retcode is not None:
# this is potentially dangerous in that there might be something
......
"""
Different implementations of the ``./setup.py test`` command depending on
what's locally available.
If Astropy v1.1.0.dev or later is available it should be possible to import
AstropyTest from ``astropy.tests.command``. If ``astropy`` can be imported
but not ``astropy.tests.command`` (i.e. an older version of Astropy), we can
use the backwards-compat implementation of the command.
If Astropy can't be imported at all then there is a skeleton implementation
that allows users to at least discover the ``./setup.py test`` command and
learn that they need Astropy to run it.
"""
# Previously these except statements caught only ImportErrors, but there are
# some other obscure exceptional conditions that can occur when importing
# astropy.tests (at least on older versions) that can cause these imports to
# fail
try:
import astropy
try:
from astropy.tests.command import AstropyTest
except Exception:
from ._test_compat import AstropyTest
except Exception:
# No astropy at all--provide the dummy implementation
from ._dummy import _DummyCommand
class AstropyTest(_DummyCommand):
command_name = 'test'
description = 'Run the tests for this package'
error_msg = (
"The 'test' command requires the astropy package to be "
"installed and importable.")
......@@ -9,14 +9,14 @@ from __future__ import absolute_import, print_function
import collections
import os
import re
import shlex
import shutil
import subprocess
import sys
import textwrap
import traceback
import warnings
from distutils import log, ccompiler, sysconfig
from distutils import log
from distutils.dist import Distribution
from distutils.errors import DistutilsOptionError, DistutilsModuleError
from distutils.core import Extension
......@@ -27,38 +27,27 @@ from setuptools import find_packages as _find_packages
from .distutils_helpers import *
from .version_helpers import get_pkg_version_module
from .test_helpers import AstropyTest
from .utils import (silence, walk_skip_hidden, import_file, extends_doc,
resolve_name)
resolve_name, AstropyDeprecationWarning)
from .commands.build_ext import generate_build_ext_command
from .commands.build_py import AstropyBuildPy
from .commands.install import AstropyInstall
from .commands.install_lib import AstropyInstallLib
from .commands.register import AstropyRegister
from .commands.test import AstropyTest
# This import is not used in this module, but it is included for backwards
# compat with version 0.4, which included this function in the public API
# for this module
# These imports are not used in this module, but are included for backwards
# compat with older versions of this module
from .utils import get_numpy_include_path, write_if_different
from .commands.build_ext import should_build_with_cython
from .commands.build_ext import should_build_with_cython, get_compiler_version
_module_state = {
'adjusted_compiler': False,
'registered_commands': None,
'have_cython': False,
'have_sphinx': False,
'package_cache': None,
'compiler_version_cache': {}
}
try:
import Cython
_module_state['have_cython'] = True
except ImportError:
pass
try:
import sphinx
_module_state['have_sphinx'] = True
......@@ -106,139 +95,11 @@ def adjust_compiler(package):