Skip to content

Commit

Permalink
Merge 18711c8 into fde468b
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccully committed Mar 16, 2018
2 parents fde468b + 18711c8 commit d169de0
Show file tree
Hide file tree
Showing 27 changed files with 281 additions and 196 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ docs/_build
# Pycharm editor project files
.idea

# Floobits project files
.floo
.flooignore

# Packages/installer info
*.egg
*.egg-info
Expand All @@ -51,6 +55,9 @@ distribute-*.tar.gz
.tox
.*.sw[op]
*~
.project
.pydevproject
.settings

# Mac OSX
.DS_Store
12 changes: 12 additions & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: packagename

channels:
- astropy

dependencies:
- astropy
- Cython
- matplotlib
- numpy
# - pip:
# - dependency_from_pip
120 changes: 65 additions & 55 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
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

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

# The apt packages below are needed for sphinx builds, which can no longer
# be installed with sudo apt-get.
addons:
apt:
packages:
- graphviz
- texlive-latex-extra
- dvipng

python:
- 2.7
- 3.4
- 3.5
os:
- linux

# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false
Expand All @@ -38,77 +27,99 @@ env:
# The following versions are the 'default' for tests, unless
# overridden underneath. They are defined here in order to save having
# to repeat them for all configurations.

- PYTHON_VERSION=3.6
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- MAIN_CMD='python setup.py'
- SETUP_CMD='test'
- PIP_DEPENDENCIES=''
- 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 scipy'


# 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='astopy-ci-extras astropy'
- CONDA_CHANNELS='astropy-ci-extras astropy'

# 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'
- PYTHON_VERSION=2.7 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.4 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.6 SETUP_CMD='egg_info'

matrix:

# Don't wait for allowed failures
fast_finish: true

include:
# Try MacOS X
- os: osx
env: SETUP_CMD='test'

# Do a coverage test in Python 2.
- python: 2.7
# Do a coverage test.
- os: linux
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'
- os: linux
env: SETUP_CMD='build_docs -w'

# Try Astropy development version
- python: 3.5
# Now try Astropy dev with the latest Python and LTS with Python 2.7 and 3.x.
- os: linux
env: ASTROPY_VERSION=development
- python: 2.7
env: ASTROPY_VERSION=lts
- python: 3.5
EVENT_TYPE='pull_request push cron'
- os: linux
env: PYTHON_VERSION=2.7 ASTROPY_VERSION=lts
- os: linux
env: ASTROPY_VERSION=lts

# Python 3.3 doesn't have numpy 1.10 in conda, but 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: 3.3
env: SETUP_CMD='egg_info'
- python: 3.3
env: SETUP_CMD='test' NUMPY_VERSION=1.9

# Try older numpy versions
- python: 2.7
env: NUMPY_VERSION=1.10
- python: 2.7
env: NUMPY_VERSION=1.9
- python: 2.7
env: NUMPY_VERSION=1.8
- python: 2.7
env: NUMPY_VERSION=1.7
# 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=2.7 NUMPY_VERSION=1.9
- os: linux
env: PYTHON_VERSION=3.4 NUMPY_VERSION=1.10
- os: linux
env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.11
- os: linux
env: NUMPY_VERSION=1.12

# Try numpy pre-release
- python: 3.5
- os: linux
env: NUMPY_VERSION=prerelease
EVENT_TYPE='pull_request push cron'

# Do a PEP8 test with pycodestyle
- os: linux
env: MAIN_CMD='pycodestyle packagename --count' SETUP_CMD=''

allow_failures:
# Do a PEP8 test with pycodestyle
# (allow to fail unless your code completely compliant)
- os: linux
env: MAIN_CMD='pycodestyle astroscrappy --count' SETUP_CMD=''

install:

Expand All @@ -123,7 +134,7 @@ install:
# 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
- 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
Expand All @@ -136,10 +147,9 @@ install:
# 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='astroscrappy/tests/coveragerc'; fi
6 changes: 4 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ include CHANGES.rst
include ez_setup.py
include ah_bootstrap.py
include setup.cfg
include astroscrappy/tests/coveragerc

recursive-include astroscrappy *.pyx *.c *.pxd

global-include *.pyx *.c *.pxd *.h
recursive-include docs *
recursive-include licenses *
recursive-include cextern *
Expand All @@ -28,7 +30,7 @@ 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 *.py *.pyx *.c *.h *.rst
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 *
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ scipy.
.. image:: https://coveralls.io/repos/astropy/astroscrappy/badge.png
:target: https://coveralls.io/r/astropy/astroscrappy
:alt: Travis Status

License
-------

This project is Copyright (c) Astropy Developers and licensed under the terms of the BSD 3-Clause license. See the licenses folder for more information.
5 changes: 5 additions & 0 deletions TEMPLATE_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ be copied over manually if desired.
1.1.3 (unreleased)
------------------

- Updated the setup.cfg to include the version number. [#129]

- Removed Python 2.6 tests from travis.yml file as astropy 1.2 no longer supports Python 2.6 [#183]

- Updated ``setup.cfg`` and ``setup.py`` so that the install requirements
are defined in ``setup.cfg``. [#208]

1.1.2 (2016-07-02)
------------------

Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ environment:
# 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: "astopy-ci-extras astropy"
# CONDA_CHANNELS: "astropy-ci-extras astropy"

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.
# We test Python 2.7 and 3.6 because 2.7 is the supported Python 2
# release of Astropy and Python 3.6 is the latest Python 3 release.

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

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

platform:
-x64

install:
- "git clone git://github.com/astropy/ci-helpers.git"
- "git clone --depth 1 git://github.com/astropy/ci-helpers.git"
- "powershell ci-helpers/appveyor/install-miniconda.ps1"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "activate test"
Expand Down
23 changes: 14 additions & 9 deletions astroscrappy/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
except ImportError:
__githash__ = ''


# set up the test command
def _get_test_runner():
import os
from astropy.tests.helper import TestRunner
return TestRunner(os.path.dirname(__file__))


def test(package=None, test_path=None, args=None, plugins=None,
verbose=False, pastebin=None, remote_data=False, pep8=False,
pdb=False, coverage=False, open_files=False, **kwargs):
Expand Down Expand Up @@ -110,10 +112,13 @@ def test(package=None, test_path=None, args=None, plugins=None,
remote_data=remote_data, pep8=pep8, pdb=pdb,
coverage=coverage, open_files=open_files, **kwargs)

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

# add these here so we only need to cleanup the namespace at the end
config_dir = None
Expand All @@ -123,16 +128,16 @@ def test(package=None, test_path=None, args=None, plugins=None,
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
config.configuration.update_default_config(
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 "
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(config.configuration.ConfigurationDefaultMissingWarning(wmsg))
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except:
except Exception:
raise orig_error
Loading

0 comments on commit d169de0

Please sign in to comment.