Skip to content

Commit

Permalink
Merge f0a54eb into 280cb1a
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcraig committed Jun 13, 2014
2 parents 280cb1a + f0a54eb commit b924637
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 77 deletions.
150 changes: 82 additions & 68 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,92 +5,106 @@ python:
- 2.7
- 3.2
- 3.3

- 3.4
# This is just for "egg_info". All other builds are explicitly given in the matrix
env:
global:
- WHEELHOUSE_HUB=http://physics.mnstate.edu/craig/wheelhouse
- PIP_WHEEL_STRICT_NUMPY="pip install --use-wheel --no-index"
- SETUP_CMD='test'
- ASTROPY_VERSION=development
- PIP_WHEEL_FLEX_NUMPY="pip install --use-wheel --find-links=http://wheels.astropy.org --find-links=http://wheels2.astropy.org"
# All tests explicitly added to the matrix in the include section use
# the latest stable numpy.
- LATEST_NUMPY_STABLE=1.8.0

# Try all python versions with all supported numpy,
# latest stable scipy and astropy.
# The following versions are the 'default' for tests, unless
# overidden underneath. They are defined here in order to save having
# to repeat them for all configurations.
- NUMPY_VERSION=1.8
- ASTROPY_VERSION=development # UNTIL 0.4 IS OUT
- CONDA_INSTALL='conda install -c astropy-ci-extras --yes'
- PIP_INSTALL='pip install'
matrix:
- NUMPY_VERSION=1.5.1
- NUMPY_VERSION=1.6.2
- NUMPY_VERSION=1.7.1
- NUMPY_VERSION=1.8.0
- SETUP_CMD='egg_info'

matrix:
# some version of numpy do not work on some versions of python
exclude:
- python: 3.2
env: NUMPY_VERSION=1.5.1
- python: 3.2
env: NUMPY_VERSION=1.7.1
- python: 3.2
env: NUMPY_VERSION=1.8.0
- python: 3.3
env: NUMPY_VERSION=1.5.1
- python: 3.3
env: NUMPY_VERSION=1.6.2

include:
# one documentation build
- python: 2.7
# Removed option "-w" to
# prevent warnings from being elevated to errors.
env: NUMPY_VERSION=$LATEST_NUMPY_STABLE SETUP_CMD='build_sphinx -n'

# Try latest development version of astropy with latest python 2.7 and
# 3.x releases
# Do a coverage test in Python 2. This requires the latest
# development version of Astropy, which fixes some issues with
# coverage testing in affiliated packages.
- python: 2.7
env: ASTROPY_VERSION=development NUMPY_VERSION=$LATEST_NUMPY_STABLE SETUP_CMD='test'
- python: 3.3
env: ASTROPY_VERSION=development NUMPY_VERSION=$LATEST_NUMPY_STABLE SETUP_CMD='test'
env: ASTROPY_VERSION=development SETUP_CMD='test --coverage'

# get test coverage from a python 2.7 build
# for now need the development version of astropy
# Check for sphinx doc build warnings - we do this first because it
# may run for a long time
- python: 2.7
env: ASTROPY_VERSION=development NUMPY_VERSION=$LATEST_NUMPY_STABLE SETUP_CMD='test --coverage'
env: SETUP_CMD='build_sphinx -n' # CHANGE BACK TO -w AFTER 0.4

before_install:
- pip install setuptools
- pip install --upgrade pip
- pip install wheel
- if [[ $SETUP_CMD == build_sphinx* ]]; then sudo apt-get update; sudo apt-get install graphviz; fi
# Try Astropy development version
- python: 2.7
env: ASTROPY_VERSION=development SETUP_CMD='test'
- python: 3.3
env: ASTROPY_VERSION=development SETUP_CMD='test'

install:
- export PYTHONIOENCODING=UTF8 # just in case
# Try all python versions with the latest numpy
- python: 2.6
env: SETUP_CMD='test'
- python: 2.7
env: SETUP_CMD='test'
- python: 3.2
env: SETUP_CMD='test'
- python: 3.3
env: SETUP_CMD='test'
- python: 3.4
env: SETUP_CMD='test'

# numpy version-specific wheelhouse
- export WHEELHOUSE_SPOKE=$WHEELHOUSE_HUB/numpy-$NUMPY_VERSION
# Try older numpy versions
- python: 3.2
env: NUMPY_VERSION=1.6 SETUP_CMD='test'
- python: 2.7
env: NUMPY_VERSION=1.7 SETUP_CMD='test'
- python: 2.7
env: NUMPY_VERSION=1.6 SETUP_CMD='test'
- python: 2.7
env: NUMPY_VERSION=1.5 SETUP_CMD='test'

# all tests need numpy and scipy
# Install from wheels, no building from source, force reinstall to make
# sure we get our wheels.
- $PIP_WHEEL_STRICT_NUMPY --find-links=$WHEELHOUSE_SPOKE --upgrade --force-reinstall numpy==$NUMPY_VERSION scipy
before_install:

# tests with astropy stable use wheels
- if [[ $ASTROPY_VERSION == stable ]]; then $PIP_WHEEL_STRICT_NUMPY --find-links=$WHEELHOUSE_SPOKE astropy; fi
# Use utf8 encoding. Should be default, but this is insurance against
# future changes
- export PYTHONIOENCODING=UTF8
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda

# Build development astropy from source -- requires cython. Cython does not
# depend on numpy so we don't care where we get the wheel from.
- if [[ $ASTROPY_VERSION == development ]]; then $PIP_WHEEL_FLEX_NUMPY cython; fi
- if [[ $ASTROPY_VERSION == development ]]; then git clone http://github.com/astropy/astropy.git astropy; cd astropy; git submodule update --init; python setup.py install; cd ..; fi
# DOCUMENTATION DEPENDENCIES
- if [[ $SETUP_CMD == build_sphinx* ]]; then sudo apt-get install graphviz texlive-latex-extra dvipng; fi

# Documentation build has a couple of additional requirements.
- if [[ $SETUP_CMD == build_sphinx* ]]; then $PIP_WHEEL_FLEX_NUMPY sphinx>=1.2; fi
- if [[ $SETUP_CMD == build_sphinx* ]]; then $PIP_WHEEL_FLEX_NUMPY matplotlib; fi
install:

# coverage needs the coverage package...
- if [[ $SETUP_CMD == 'test --coverage' ]]; then pip install coverage; fi
# Uncomment line below if coveralls.io is set up for this package
- if [[ $SETUP_CMD == 'test --coverage' ]]; then pip install coveralls; fi
# CONDA
- conda create --yes -n test -c astropy-ci-extras python=$TRAVIS_PYTHON_VERSION
- source activate test

# CORE DEPENDENCIES
- if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION pytest pip Cython; fi
- if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL pytest-xdist; fi

# ASTROPY
- if [[ $SETUP_CMD != egg_info ]] && [[ $ASTROPY_VERSION == development ]]; then $PIP_INSTALL git+http://github.com/astropy/astropy.git#egg=astropy; fi
- if [[ $SETUP_CMD != egg_info ]] && [[ $ASTROPY_VERSION == stable ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION astropy; fi

# OPTIONAL DEPENDENCIES
# Here you can add any dependencies your package may have. You can use
# conda for packages available through conda, or pip for any other
# packages. You should leave the `numpy=$NUMPY_VERSION` in the `conda`
# install since this ensures Numpy does not get automatically upgraded.
- if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION scipy ; fi
# - if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL ...; fi

# DOCUMENTATION DEPENDENCIES
# build_sphinx needs sphinx and matplotlib (for plot_directive). Note that
# this matplotlib will *not* work with py 3.x, but our sphinx build is
# currently 2.7, so that's fine
- if [[ $SETUP_CMD == build_sphinx* ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION Sphinx matplotlib; fi

# COVERAGE DEPENDENCIES
- if [[ $SETUP_CMD == 'test --coverage' ]]; then $PIP_INSTALL coverage coveralls; fi

script:
- python setup.py $SETUP_CMD
Expand Down
8 changes: 7 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ include README.rst
include ccdproc/tests/coveragerc

include ez_setup.py
include setuptools_bootstrap.py
include ah_bootstrap.py
include setup.cfg

recursive-include ccdproc *.pyx *.c

recursive-include docs *
Expand All @@ -13,3 +15,7 @@ recursive-include scripts *
exclude *.pyc *.o
prune docs/_build
prune build

recursive-include astropy_helpers *
exclude astropy_helpers/.git
exclude astropy_helpers/.gitignore
24 changes: 16 additions & 8 deletions ccdproc/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def test(package=None, test_path=None, args=None, plugins=None,
coverage=coverage, open_files=open_files, **kwargs)

if not _ASTROPY_SETUP_:

import os
from warnings import warn
from astropy import config
Expand All @@ -121,10 +120,19 @@ def test(package=None, test_path=None, args=None, plugins=None,

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
try:
config.configuration.update_default_config(__package__, config_dir)
except config.configuration.ConfigurationDefaultMissingError as e:
wmsg = (e.args[0] + " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(config.configuration.ConfigurationDefaultMissingWarning(wmsg))
del e
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
config.configuration.update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
config.configuration.update_default_config(
__package__, config_dir)
except config.configuration.ConfigurationDefaultMissingError as e:
wmsg = (e.args[0] + " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(config.configuration.ConfigurationDefaultMissingWarning(wmsg))
del e
except:
raise orig_error
5 changes: 5 additions & 0 deletions ccdproc/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
# no matter how it is invoked within the source tree.

from astropy.tests.pytest_plugins import *

from .tests.pytest_fixtures import *

## Uncomment the following line to treat all DeprecationWarnings as
## exceptions
# enable_deprecations_as_exceptions()
9 changes: 9 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
import os
import sys

try:
import astropy_helpers
except ImportError:
# Building from inside the docs/ directory?
if os.path.basename(os.getcwd()) == 'docs':
a_h_path = os.path.abspath(os.path.join('..', 'astropy_helpers'))
if os.path.isdir(a_h_path):
sys.path.insert(1, a_h_path)

# Load all of the global Astropy configuration
from astropy_helpers.sphinx.conf import *

Expand Down

0 comments on commit b924637

Please sign in to comment.