Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Update the astropy_template files
Browse files Browse the repository at this point in the history
  • Loading branch information
montefra committed Sep 26, 2016
1 parent 0c22796 commit 695d527
Show file tree
Hide file tree
Showing 11 changed files with 469 additions and 290 deletions.
57 changes: 55 additions & 2 deletions .gitignore
@@ -1,6 +1,59 @@
*.pyc
*.[oa]
# Compiled files
*.py[cod]
*.a
*.o
*.so
__pycache__

# Ignore .c files by default to avoid including generated code. If you want to
# add a non-generated .c extension, use `git add -f filename.c`.
*.c

# Other generated files
*/version.py
*/cython_version.py
htmlcov
.coverage
MANIFEST
.ipynb_checkpoints

# Sphinx
docs/api
docs/_build

# Eclipse editor project files
.project
.pydevproject
.settings

# Pycharm editor project files
.idea

# Packages/installer info
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
distribute-*.tar.gz

# Other
.cache
.tox
.*.sw[op]
*~

# Mac OSX
.DS_Store

*~

*.so
*.bak
foo*
Expand Down
129 changes: 68 additions & 61 deletions .travis.yml
@@ -1,17 +1,14 @@
language: python

python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
# This is just for "egg_info". All other builds are explicitly given in the matrix

# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false

# The apt packages below are needed for sphinx builds. A full list of packages
# The apt packages below are needed for sphinx builds. A full list of packages
# that can be included can be found here:
#
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
Expand All @@ -25,15 +22,29 @@ addons:

env:
global:

# The following versions are the 'default' for tests, unless
# overidden underneath. They are defined here in order to save having
# overridden underneath. They are defined here in order to save having
# to repeat them for all configurations.
- NUMPY_VERSION=1.9
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- CONDA_INSTALL='conda install -c astropy-ci-extras --yes'
- PIP_INSTALL='pip install'
- SETUP_CMD='test'
- PIP_DEPENDENCIES=''

# For this package-template, we include examples of Cython modules,
# so Cython is required for testing. If your package does not include
# Cython code, you can set CONDA_DEPENDENCIES=''
- CONDA_DEPENDENCIES='Cython'

# If there are matplotlib or other GUI tests, uncomment the following
# line to use the X virtual framebuffer.
# - SETUP_XVFB=True

matrix:
# Make sure that egg_info works without dependencies
- SETUP_CMD='egg_info'
# Try all python versions with the latest numpy
- SETUP_CMD='test'

matrix:
include:
Expand All @@ -49,69 +60,65 @@ matrix:

# Try Astropy development version
- python: 2.7
env: ASTROPY_VERSION=development SETUP_CMD='test'
- python: 3.4
env: ASTROPY_VERSION=development SETUP_CMD='test'

# Try all python versions with the latest numpy
- python: 2.6
env: SETUP_CMD='test'
env: ASTROPY_VERSION=development
- python: 3.5
env: ASTROPY_VERSION=development
- python: 2.7
env: SETUP_CMD='test'
env: ASTROPY_VERSION=lts
- python: 3.5
env: ASTROPY_VERSION=lts

# Python 2.6 and 3.3 doesn't have numpy 1.10 in conda, they can be put
# back into the main matrix once the numpy build is available in the
# astropy-ci-extras channel (or in the one provided in the
# CONDA_CHANNELS environmental variable).
- python: 2.6
env: SETUP_CMD='egg_info'
- python: 2.6
env: SETUP_CMD='test' NUMPY_VERSION=1.9
- python: 3.3
env: SETUP_CMD='egg_info'
- python: 3.3
env: SETUP_CMD='test'
- python: 3.4
env: SETUP_CMD='test'
env: SETUP_CMD='test' NUMPY_VERSION=1.9

# Try older numpy versions
- python: 2.7
env: NUMPY_VERSION=1.8 SETUP_CMD='test'
env: NUMPY_VERSION=1.10
- python: 2.7
env: NUMPY_VERSION=1.7 SETUP_CMD='test'
env: NUMPY_VERSION=1.9
- python: 2.7
env: NUMPY_VERSION=1.6 SETUP_CMD='test'

before_install:
env: NUMPY_VERSION=1.8
- python: 2.7
env: NUMPY_VERSION=1.7

# 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
# Try numpy pre-release
- python: 3.5
env: NUMPY_VERSION=prerelease

install:

# 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 jinja2; 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 ... ; 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
# We now use the ci-helpers package to set up our testing environment.
# This is done by using Miniconda and then using conda and pip to install
# dependencies. Which dependencies are installed using conda and pip is
# determined by the CONDA_DEPENDENCIES and PIP_DEPENDENCIES variables,
# which should be space-delimited lists of package names. See the README
# in https://github.com/astropy/ci-helpers for information about the full
# list of environment variables that can be used to customize your
# environment. In some cases, ci-helpers may not offer enough flexibility
# in how to install a package, in which case you can have additional
# commands in the install: section below.

- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh

# As described above, using ci-helpers, you should be able to set up an
# environment with dependencies installed using conda and pip, but in some
# cases this may not provide enough flexibility in how to install a
# specific dependency (and it will not be able to install non-Python
# dependencies). Therefore, you can also include commands below (as
# well as at the start of the install section or in the before_install
# section if they are needed before setting up conda) to install any
# other dependencies.

script:
- python setup.py $SETUP_CMD
Expand All @@ -120,4 +127,4 @@ after_success:
# If coveralls.io is set up for this package, uncomment the line
# below and replace "packagename" with the name of your package.
# The coveragerc file may be customized as needed for your package.
# - if [[ $SETUP_CMD == 'test --coverage' ]]; then coveralls --rcfile='pyds9/tests/coveragerc'; fi
# - if [[ $SETUP_CMD == 'test --coverage' ]]; then coveralls --rcfile='packagename/tests/coveragerc'; fi
24 changes: 21 additions & 3 deletions MANIFEST.in
Expand Up @@ -17,8 +17,26 @@ prune build
prune docs/_build
prune docs/api

recursive-include astropy_helpers *
exclude astropy_helpers/.git
exclude astropy_helpers/.gitignore

# the next few stanzas are for astropy_helpers. It's derived from the
# astropy_helpers/MANIFEST.in, but requires additional includes for the actual
# package directory and egg-info.

include astropy_helpers/README.rst
include astropy_helpers/CHANGES.rst
include astropy_helpers/LICENSE.rst
recursive-include astropy_helpers/licenses *

include astropy_helpers/ez_setup.py
include astropy_helpers/ah_bootstrap.py

recursive-include astropy_helpers/astropy_helpers *.py *.pyx *.c *.h
recursive-include astropy_helpers/astropy_helpers.egg-info *
# include the sphinx stuff with "*" because there are css/html/rst/etc.
recursive-include astropy_helpers/astropy_helpers/sphinx *

prune astropy_helpers/build
prune astropy_helpers/astropy_helpers/tests


global-exclude *.pyc *.o
2 changes: 1 addition & 1 deletion ah_bootstrap.py
Expand Up @@ -409,7 +409,7 @@ def get_local_file_dist(self):
def get_index_dist(self):
if not self.download:
log.warn('Downloading {0!r} disabled.'.format(DIST_NAME))
return False
return None

log.warn(
"Downloading {0!r}; run setup.py with the --offline option to "
Expand Down
44 changes: 44 additions & 0 deletions appveyor.yml
@@ -0,0 +1,44 @@
# AppVeyor.com is a Continuous Integration service to build and run tests under
# Windows

environment:

global:
PYTHON: "C:\\conda"
MINICONDA_VERSION: "latest"
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.
# For this package-template, we include examples of Cython modules,
# so Cython is required for testing. If your package does not include
# Cython code, you can set CONDA_DEPENDENCIES=''
CONDA_DEPENDENCIES: "Cython"

matrix:

# We test Python 2.7 and 3.5 because 2.7 is the supported Python 2
# release of Astropy and Python 3.5 is the latest Python 3 release.

- PYTHON_VERSION: "2.7"
ASTROPY_VERSION: "stable"
NUMPY_VERSION: "stable"

- PYTHON_VERSION: "3.5"
ASTROPY_VERSION: "stable"
NUMPY_VERSION: "stable"

platform:
-x64

install:
- "git clone git://github.com/astropy/ci-helpers.git"
- "powershell ci-helpers/appveyor/install-miniconda.ps1"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "activate test"

# Not a .NET project, we build the package in the install step instead
build: false

test_script:
- "%CMD_IN_ENV% python setup.py test"
1 change: 1 addition & 0 deletions docs/Makefile
Expand Up @@ -39,6 +39,7 @@ help:
clean:
-rm -rf $(BUILDDIR)
-rm -rf api
-rm -rf generated

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
8 changes: 6 additions & 2 deletions docs/conf.py
Expand Up @@ -43,8 +43,12 @@
from astropy_helpers.sphinx.conf import *

# Get configuration information from setup.cfg
from distutils import config
conf = config.ConfigParser()
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
conf = ConfigParser()

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))

Expand Down
3 changes: 3 additions & 0 deletions docs/rtd-pip-requirements
@@ -1,2 +1,5 @@
numpy
matplotlib
Cython
astropy-helpers
astropy

0 comments on commit 695d527

Please sign in to comment.