Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "myRadex"]
path = myRadex
url = https://github.com/keflavich/myRadex.git
[submodule "astropy-helpers"]
path = astropy-helpers
url = ./astropy-helpers
243 changes: 146 additions & 97 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,117 +1,166 @@
language: python
# 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:
- linux

# 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

addons:
apt:
packages:
- graphviz


stage: Comprehensive tests

stages:
# Do the style check and a single test job, don't proceed if it fails
- name: Initial tests
# Test docs, astropy dev, and without optional dependencies
- name: Comprehensive tests
# These will only run when cron is opted in
- name: Cron tests
if: type = cron


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
- PYTHON_VERSION=3.7
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- CONDA_INSTALL='conda install -c astropy-ci-extras --yes'
- PIP_INSTALL='pip install'
- MAIN_CMD='python setup.py'
- SETUP_CMD='test'
- EVENT_TYPE='pull_request push'


# 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'
- CONDA_DEPENDENCIES_DOC='Cython sphinx-astropy'

# List other runtime dependencies for the package that are available as
# pip packages here.
- PIP_DEPENDENCIES=''

# Conda packages for affiliated packages are hosted in channel
# "astropy" while builds for astropy LTS with recent numpy versions
# are in astropy-ci-extras. If your package uses either of these,
# add the channels to CONDA_CHANNELS along with any other channels
# you want to use.
- CONDA_CHANNELS='astropy'

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

# If you want to ignore certain flake8 errors, you can list them
# in FLAKE8_OPT, for example:
# - FLAKE8_OPT='--ignore=E501'
- FLAKE8_OPT=''

matrix:

# Don't wait for allowed failures
fast_finish: true

include:
# Make sure that egg_info works without dependencies
- stage: Initial tests
env: PYTHON_VERSION=3.7 SETUP_CMD='egg_info'

# 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 SETUP_CMD='test --coverage'
# Try MacOS X, usually enough only to run from cron as hardly there are
# issues that are not picked up by a linux worker
- os: osx
stage: Cron tests
env: SETUP_CMD='test' EVENT_TYPE='cron'

# Do a coverage test.
- os: linux
stage: Initial tests
env: SETUP_CMD='test --coverage'

# Check for sphinx doc build warnings - we do this first because it
# may run for a long time
#- python: 2.7
# env: SETUP_CMD='build_sphinx -w'

# Try Astropy development version
- python: 3.7
env: ASTROPY_VERSION=development SETUP_CMD='test'
#- python: 3.3
# env: ASTROPY_VERSION=development SETUP_CMD='test'

# Try all python versions with the latest numpy
- python: 3.7
env: SETUP_CMD='test'
#- python: 3.3
# env: SETUP_CMD='test'
#- python: 3.4
# env: SETUP_CMD='test'

# Try older python versions
- python: 2.7
env: SETUP_CMD='test'

before_install:

# Use utf8 encoding. Should be default, but this is insurance against
# future changes
- export PYTHONIOENCODING=UTF8

# http://conda.pydata.org/docs/travis.html#the-travis-yml-file
- wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a

# DOCUMENTATION DEPENDENCIES
- if [[ $SETUP_CMD == build_sphinx* ]]; then sudo apt-get install graphviz texlive-latex-extra dvipng; fi
- os: linux
env: SETUP_CMD='build_docs -w'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_DOC

# Now try Astropy dev with the latest Python and LTS with and 3.x.
- os: linux
env: ASTROPY_VERSION=development
EVENT_TYPE='pull_request push cron'
- os: linux
env: PYTHON_VERSION=3.6 ASTROPY_VERSION=lts NUMPY_VERSION=1.13

# Add a job that runs from cron only and tests against astropy dev and
# numpy dev to give a change for early discovery of issues and feedback
# for both developer teams.
- os: linux
stage: Cron tests
env: ASTROPY_VERSION=development NUMPY_VERSION=development
EVENT_TYPE='cron'

# Try all python versions and Numpy versions. Since we can assume that
# the Numpy developers have taken care of testing Numpy with different
# versions of Python, we can vary Python and Numpy versions at the same
# time.

- os: linux
env: PYTHON_VERSION=3.6 NUMPY_VERSION=1.14
- os: linux
env: NUMPY_VERSION=1.15

# Do a PEP8 test with flake8
- os: linux
stage: Initial tests
env: MAIN_CMD='flake8 packagename --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''

allow_failures:
# Do a PEP8 test with flake8
# (do allow to fail unless your code completely compliant)
# - os: linux
# stage: Initial tests
# env: MAIN_CMD='flake8 packagename --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''

install:
# Fortran needed for radex building
- sudo apt-get update -qq
- sudo apt-get install -qq python-numpy cython libatlas-dev liblapack-dev gfortran
- sudo apt-get install -qq python-scipy
- sudo apt-get install -qq cython

# 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 requests ; fi
- if [[ ($SETUP_CMD != egg_info) && ($TRAVIS_PYTHON_VERSION == 2.7) ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION keyring ; fi
- if [[ ($SETUP_CMD != egg_info) && ($TRAVIS_PYTHON_VERSION != 2.7) ]]; then $PIP_INSTALL keyring ; fi
- if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION cython requests ; fi
# - if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL ...; fi

- if [[ $SETUP_CMD != egg_info ]] ; then $PIP_INSTALL git+http://github.com/astropy/astroquery.git#egg=astroquery; fi
- if [[ $SETUP_CMD != egg_info ]] ; then $PIP_INSTALL git+http://github.com/astropy/specutils.git#egg=specutils; 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=1.2.2 matplotlib; fi

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

- if [[ $SETUP_CMD != egg_info ]]; then python setup.py build_radex_exe; fi
- if [[ $SETUP_CMD != egg_info ]]; then python setup.py install_radex; fi
- if [[ $SETUP_CMD != egg_info ]]; then CFLAGS='-fPIC' python setup.py install_myradex; fi
- if [[ $SETUP_CMD != egg_info ]]; then python setup.py install; 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 --depth 1 git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.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
- $MAIN_CMD $SETUP_CMD

after_success:
# If coveralls.io is set up for this package, uncomment the line
# below and replace "packagename" with the name of your package.
# If coveralls.io is set up for this package, uncomment the line below.
# The coveragerc file may be customized as needed for your package.
- if [[ $SETUP_CMD == 'test --coverage' ]]; then coveralls --rcfile='astroquery/tests/coveragerc'; fi
# - if [[ $SETUP_CMD == *coverage* ]]; then coveralls --rcfile='packagename/tests/coveragerc'; fi
1 change: 1 addition & 0 deletions astropy-helpers
Submodule astropy-helpers added at 20deae
2 changes: 1 addition & 1 deletion pyradex/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .version import __version__
from ._astropy_init import *

from .core import pyradex,write_input,parse_outfile,call_radex,Radex

Expand Down
56 changes: 56 additions & 0 deletions pyradex/_astropy_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

__all__ = ['__version__', '__githash__']

# this indicates whether or not we are in the package's setup.py
try:
_ASTROPY_SETUP_
except NameError:
import builtins
builtins._ASTROPY_SETUP_ = False

try:
from .version import version as __version__
except ImportError:
__version__ = ''
try:
from .version import githash as __githash__
except ImportError:
__githash__ = ''


if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
test.__test__ = False
__all__ += ['test']

# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0] +
" Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error
1 change: 0 additions & 1 deletion pyradex/version.py

This file was deleted.

Loading