Commit 90511f4d authored by Ole Streicher's avatar Ole Streicher

Initial upstream version 0.3.3

parents
Metadata-Version: 1.1
Name: ccdproc
Version: 0.3.3
Summary: Astropy affiliated package
Home-page: http://ccdproc.readthedocs.org/
Author: Steve Crawford and Matt Craig
Author-email: ccdproc@gmail.com
License: BSD
Description:
The ccdproc package is a collection of code that will be helpful in basic CCD
processing. These steps will allow reduction of basic CCD data as either a
stand-alone processing or as part of a pipeline.
Platform: UNKNOWN
Provides: ccdproc
ccdproc
=======
.. image:: https://travis-ci.org/astropy/ccdproc.png?branch=master
:target: https://travis-ci.org/astropy/ccdproc
.. image:: https://coveralls.io/repos/astropy/ccdproc/badge.png
:target: https://coveralls.io/r/astropy/ccdproc
Ccdproc is is an affiliated package for the AstroPy package for basic data
reductions of CCD images. The ccdproc package provides many of the
necessary tools for processing of ccd images built on a framework to provide
error propagation and bad pixel tracking throughout the reduction process.
Ccdproc can currently be installed via pip or from the source code. For
installation instructions, see the `online documentation`_ or docs/install.rst
in this source distribution.
This package is a work in progress...feel free to help out by picking an issue
and working on it!
Documentation is at `ccdproc.readthedocs.org
<http://ccdproc.readthedocs.org/en/latest/>`_
.. _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
This diff is collapsed.
[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\(.*\):
# We set the language to c because python isn't supported on the MacOS X nodes
# on Travis. However, the language ends up being irrelevant anyway, since we
# install Python ourselves using conda.
language: c
os:
- osx
- linux
env:
matrix:
- PYTHON_VERSION=2.6
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.3
- PYTHON_VERSION=3.4
global:
- SETUPTOOLS_VERSION=stable
matrix:
include:
- os: linux
env: PYTHON_VERSION=2.7 SETUPTOOLS_VERSION=dev
before_install:
# Use utf8 encoding. Should be default, but this is insurance against
# future changes
- export PYTHONIOENCODING=UTF8
# Install conda
- source continuous-integration/travis/install_conda_$TRAVIS_OS_NAME.sh
# Install graphviz
- source continuous-integration/travis/install_graphviz_$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:
# 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"
script:
- py.test --cov astropy_helpers astropy_helpers
after_success:
- coveralls
This diff is collapsed.
Contributing to astropy-helpers
===============================
The guidelines for contributing to ``astropy-helpers`` are generally the same
as the [contributing guidelines for the astropy core
package](http://github.com/astropy/astropy/blob/master/CONTRIBUTING.md).
Basically, report relevant issues in the ``astropy-helpers`` issue tracker, and
we welcome pull requests that broadly follow the [Astropy coding
guidelines](http://docs.astropy.org/en/latest/development/codeguide.html).
The key subtlety lies in understanding the relationship between ``astropy`` and
``astropy-helpers``. This package contains the build, installation, and
documentation tools used by astropy. It also includes support for the
``setup.py test`` command, though Astropy is still required for this to
function (it does not currently include the full Astropy test runner). So
issues or improvements to that functionality should be addressed in this
package. Any other aspect of the [astropy core
package](http://github.com/astropy/astropy) (or any other package that uses
``astropy-helpers``) should be addressed in the github repository for that
package.
Copyright (c) 2014, Astropy Developers
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of the Astropy Team nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include README.rst
include CHANGES.rst
include LICENSE.rst
include ez_setup.py
include ah_bootstrap.py
exclude *.pyc *.o
prune build
prune astropy_helpers/tests
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
This diff is collapsed.
# AppVeyor.com is a Continuous Integration service to build and run tests under
# Windows
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"
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.
matrix:
- PYTHON_VERSION: "2.6"
- PYTHON_VERSION: "2.7"
- PYTHON_VERSION: "3.4"
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%"
- "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"
# Install graphviz
- cinst graphviz.portable
# Not a .NET project, we build SunPy in the install step instead
build: false
test_script:
- "%CMD_IN_ENV% py.test"
Metadata-Version: 1.1
Name: astropy-helpers
Version: 0.4.dev94
Summary: UNKNOWN
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
Platform: UNKNOWN
LICENSE.rst
MANIFEST.in
README.rst
ah_bootstrap.py
ez_setup.py
setup.cfg
setup.py
astropy_helpers/__init__.py
astropy_helpers/git_helpers.py
astropy_helpers/setup_helpers.py
astropy_helpers/test_helpers.py
astropy_helpers/utils.py
astropy_helpers/version.py
astropy_helpers/version_helpers.py
astropy_helpers.egg-info/PKG-INFO
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/compat/__init__.py
astropy_helpers/compat/subprocess.py
astropy_helpers/compat/_subprocess_py2/__init__.py
astropy_helpers/sphinx/__init__.py
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/automodapi.py
astropy_helpers/sphinx/ext/automodsumm.py
astropy_helpers/sphinx/ext/changelog_links.py
astropy_helpers/sphinx/ext/comment_eater.py
astropy_helpers/sphinx/ext/compiler_unparse.py
astropy_helpers/sphinx/ext/docscrape.py
astropy_helpers/sphinx/ext/docscrape_sphinx.py
astropy_helpers/sphinx/ext/doctest.py
astropy_helpers/sphinx/ext/edit_on_github.py
astropy_helpers/sphinx/ext/numpydoc.py
astropy_helpers/sphinx/ext/phantom_import.py
astropy_helpers/sphinx/ext/smart_resolver.py
astropy_helpers/sphinx/ext/tocdepthfix.py
astropy_helpers/sphinx/ext/traitsdoc.py
astropy_helpers/sphinx/ext/utils.py
astropy_helpers/sphinx/ext/viewcode.py
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_automodapi.py
astropy_helpers/sphinx/ext/tests/test_automodsumm.py
astropy_helpers/sphinx/ext/tests/test_utils.py
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_20.png
astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico
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
try:
from .version import version as __version__
from .version import githash as __githash__
except ImportError:
__version__ = ''
__githash__ = ''
# If we've made it as far as importing astropy_helpers, we don't need
# ah_bootstrap in sys.modules anymore. Getting rid of it is actually necessary
# if the package we're installing has a setup_requires of another package that
# uses astropy_helpers (and possibly a different version at that)
# See https://github.com/astropy/astropy/issues/3541
import sys
if 'ah_bootstrap' in sys.modules:
del sys.modules['ah_bootstrap']
# Note, this is repeated from ah_bootstrap.py, but is here too in case this
# astropy-helpers was upgraded to from an older version that did not have this
# check in its ah_bootstrap.
# matplotlib can cause problems if it is imported from within a call of
# run_setup(), because in some circumstances it will try to write to the user's
# home directory, resulting in a SandboxViolation. See
# https://github.com/matplotlib/matplotlib/pull/4165
# Making sure matplotlib, if it is available, is imported early in the setup
# process can mitigate this (note importing matplotlib.pyplot has the same
# issue)
try:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot
except:
# Ignore if this fails for *any* reason*
pass
import errno
import os
import shutil
from distutils.core import Extension
from distutils.ccompiler import get_default_compiler
from setuptools.command.build_ext import build_ext as SetuptoolsBuildExt
from ..utils import get_numpy_include_path, invalidate_caches
from ..version_helpers import get_pkg_version_module
def should_build_with_cython(package, release=None):
"""Returns the previously used Cython version (or 'unknown' if not
previously built) if Cython should be used to build extension modules from
pyx files. If the ``release`` parameter is not specified an attempt is
made to determine the release flag from `astropy.version`.
"""
from ..setup_helpers import _module_state
try:
version_module = __import__(package + '.cython_version',
fromlist=['release', 'cython_version'])
except ImportError:
version_module = None
if release is None and version_module is not None:
try:
release = version_module.release
except AttributeError:
pass
try:
cython_version = version_module.cython_version
except AttributeError:
cython_version = 'unknown'
# Only build with Cython if, of course, Cython is installed, we're in a
# development version (i.e. not release) or the Cython-generated source
# files haven't been created yet (cython_version == 'unknown'). The latter
# case can happen even when release is True if checking out a release tag
# from the repository
if (_module_state['have_cython'] and
(not release or cython_version == 'unknown')):
return cython_version
else:
return False
# TODO: I think this can be reworked without having to create the class
# programmatically.
def generate_build_ext_command(packagename, release):
"""
Creates a custom 'build_ext' command that allows for manipulating some of
the C extension options at build time. We use a function to build the
class since the base class for build_ext may be different depending on
certain build-time parameters (for example, we may use Cython's build_ext
instead of the default version in distutils).
Uses the default distutils.command.build_ext by default.
"""
if should_build_with_cython(packagename, release):
from Cython.Distutils import build_ext as basecls
else:
basecls = SetuptoolsBuildExt
class build_ext(basecls, object):
uses_cython = should_build_with_cython(packagename, release)
package_name = packagename
user_options = basecls.user_options[:]
boolean_options = basecls.boolean_options[:]
force_rebuild = False
def finalize_options(self):
# Add a copy of the _compiler.so module as well, but only if there
# are in fact C modules to compile (otherwise there's no reason to
# include a record of the compiler used)
# Note, self.extensions may not be set yet, but
# self.distribution.ext_modules is where any extension modules
# passed to setup() can be found
extensions = self.distribution.ext_modules
if extensions:
src_path = os.path.relpath(
os.path.join(os.path.dirname(__file__), 'src'))
shutil.copy2(os.path.join(src_path, 'compiler.c'),
os.path.join(self.package_name, '_compiler.c'))
ext = Extension(self.package_name + '._compiler',
[os.path.join(self.package_name, '_compiler.c')])
extensions.insert(0, ext)
basecls.finalize_options(self)
# Generate
if self.uses_cython:
try:
from Cython import __version__ as cython_version
except ImportError:
# This shouldn't happen if we made it this far
cython_version = None
if (cython_version is not None and
cython_version != self.uses_cython):
self.force_rebuild = True
# Update the used cython version
self.uses_cython = cython_version
# Regardless of the value of the '--force' option, force a rebuild
# if the debug flag changed from the last build
if self.force_rebuild:
self.force = True
def run(self):
# For extensions that require 'numpy' in their include dirs,
# replace 'numpy' with the actual paths
np_include = get_numpy_include_path()
for extension in self.extensions:
if 'numpy' in extension.include_dirs:
idx = extension.include_dirs.index('numpy')
extension.include_dirs.insert(idx, np_include)
extension.include_dirs.remove('numpy')
self._check_cython_sources(extension)
basecls.run(self)
# Update cython_version.py if building with Cython
try:
cython_version = get_pkg_version_module(
packagename, fromlist=['cython_version'])[0]
except (AttributeError, ImportError):
cython_version = 'unknown'
if self.uses_cython and self.uses_cython != cython_version:
package_dir = os.path.relpath(packagename)
cython_py = os.path.join(package_dir, 'cython_version.py')
with open(cython_py, 'w') as f:
f.write('# Generated file; do not modify\n')
f.write('cython_version = {0!r}\n'.format(self.uses_cython))
if os.path.isdir(self.build_lib):
# The build/lib directory may not exist if the build_py
# command was not previously run, which may sometimes be
# the case
self.copy_file(cython_py,
os.path.join(self.build_lib, cython_py),
preserve_mode=False)
invalidate_caches()
def _check_cython_sources(self, extension):
"""
Where relevant, make sure that the .c files associated with .pyx
modules are present (if building without Cython installed).
"""
# Determine the compiler we'll be using
if self.compiler is None:
compiler = get_default_compiler()
else:
compiler = self.compiler
# Replace .pyx with C-equivalents, unless c files are missing
for jdx, src in enumerate(extension.sources):
base, ext = os.path.splitext(src)
pyxfn = base + '.pyx'
cfn = base + '.c'
cppfn = base + '.cpp'
if not os.path.isfile(pyxfn):
continue
if self.uses_cython:
extension.sources[jdx] = pyxfn
else:
if os.path.isfile(cfn):
extension.sources[jdx] = cfn
elif os.path.isfile(cppfn):
extension.sources[jdx] = cppfn
else:
msg = (
'Could not find C/C++ file {0}.(c/cpp) for Cython '
'file {1} when building extension {2}. Cython '
'must be installed to build from a git '
'checkout.'.format(base, pyxfn, extension.name))
raise IOError(errno.ENOENT, msg, cfn)