Skip to content

Commit

Permalink
Merge 6132509 into 09e9270
Browse files Browse the repository at this point in the history
  • Loading branch information
sosey committed Mar 29, 2020
2 parents 09e9270 + 6132509 commit e8a620f
Show file tree
Hide file tree
Showing 33 changed files with 1,303 additions and 16,544 deletions.
181 changes: 65 additions & 116 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,27 @@
language: c

# Cache can be cleared from the travis settings menu, see docs currently at
# https://docs.travis-ci.com/user/caching#Clearing-Caches
cache:
- ccache
language: python


os:
- linux
os: linux
services: xvfb

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

# Cache can be cleared from the travis settings menu, see docs currently at
# https://docs.travis-ci.com/user/caching#Clearing-Caches
cache:
- ccache

# 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

env:
global:
# SET DEFAULTS TO AVOID REPEATING IN MOST CASES
- SETUP_XVFB=True
- PYTHON_VERSION=3.6
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- CONDA_DEPENDENCIES='Cython matplotlib scipy ipython'
- PIP_DEPENDENCIES='photutils pytest-astropy pytest-cov'
- MAIN_CMD='python setup.py'
- SETUP_CMD='test'
- CONDA_CHANNELS='astropy-ci-extras astropy'
- SETUP_XVFB=True
- EVENT_TYPE='push pull_request'
# https://docs.travis-ci.com/user/environment-variables/
- CONDA_DEPENDENCIES='scipy matplotlib pyqt ginga ipython Cython setuptools_scm pip pytest'

# PEP8 errors/warnings:
# E101 - mix of tabs and spaces
Expand All @@ -51,122 +37,85 @@ env:
# E722 - do not use bare except
# E901 - SyntaxError or IndentationError
# E902 - IOError
- FLAKE8_OPT="--select=E101,W191,W291,W292,W293,W391,E111,E112,E113,E502,E722,E901,E902"
- FLAKE8_OPT="--select=E101,W191,W291,W292,W293,E111,E112,E113,E502,E722,E901,E902"
jobs:
NUMPY=1.15
NUMPY=1.16
NUMPY=1.17
NUMPY=1.18
ASTROPY=4.0
ASTROPY=3.2.3

before_install:
# Install the latest version of Miniconda
- uname -a
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda3.sh
- chmod +x miniconda3.sh
- ./miniconda3.sh -b
- export PATH=/home/travis/miniconda3/bin:$PATH
- conda config --add channels conda-forge
- conda config --add channels astropy
- python --version
# travis clones submodules by default
# - git submodule update --init --recursive

matrix:
# make sure that egg_info works without dependencies
- PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.6 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.7 SETUP_CMD='egg_info'
install:
- conda create --yes -n test python=$PYTHON numpy=$NUMPY
- source activate test
- conda install -y astropy=$ASTROPY
- conda install -y $CONDA_DEPENDENCIES
- pip install pytest-pep8
- pip install pytest-cov
- pip install coveralls
- pip install sphinx-automodapi
- pip install photutils
- pip install flake8
- pip install sphinx-astropy
- pip install graphviz
- python setup.py build_ext --inplace

script: python setup.py test

matrix:
jobs:

# Don't wait for allowed failures
fast_finish: true

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


- os: linux
# Check for sphinx doc build warnings - we do this first because
- python: 3.5
env: SETUP_CMD='build_sphinx -w' CONDA_DEPENDENCIES='Cython ipython scipy matplotlib ginga'

# Try Astropy development and LTS versions
- python: 3.5
env: ASTROPY_VERSION=lts
- python: 3.5
env: ASTROPY_VERSION=development
- python: 3.6
env: ASTROPY_VERSION=development
- python: 3.7
env: ASTROPY_VERSION=development

# Try with optional dependencies disabled
- python: 3.5
env: PIP_DEPENDENCIES=''
- python: 3.6
env: PIP_DEPENDENCIES=''
- python: 3.7
env: PIP_DEPENDENCIES=''
- name: "Test documentation build"
env: NUMPY=1.17 PYTHON=3.7
script: python setup.py build_sphinx

# Try older numpy versions
- python: 3.6
env: NUMPY_VERSION=1.14
env: NUMPY=1.15 ASTROPY=3.2.3
- python: 3.6
env: NUMPY_VERSION=1.15
env: NUMPY=1.16 ASTROPY=4.0
- python: 3.6
env: NUMPY_VERSION=1.16
- python: 3.7
env: NUMPY_VERSION=1.14
env: NUMPY=1.17 ASTROPY=4.0
- python: 3.7
env: NUMPY_VERSION=1.15
env: NUMPY=1.18 ASTROPY=4.0
- python: 3.7
env: NUMPY_VERSION=1.16
env: NUMPY=1.17 ASTROPY=4.0
- python: 3.8
env: NUMPY=1.17 ASTROPY=4.0
- python: 3.8
env: NUMPY=1.18 ASTROPY=4.0


# Do coverage tests
- python: 3.5
env: SETUP_CMD='test --cov'
- name: "Test coverage status"
python: 3.7
env: ASTROPY=4.0 NUMPY=1.17
script: py.test --cov


# Do a pep8 test
- python: 3.5
env: MAIN_CMD="flake8 imexam --count $FLAKE8_OPT" SETUP_CMD=''

allow_failures:
- python: 3.7
env: NUMPY_VERSION=prerelease
- python: 3.8
env: NUMPY_VERSION=prerelease


before_install:
- uname -a
- python --version
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ( sudo Xvfb :99 -ac -screen 0 1024x768x8; sleep 3; echo ok )& 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_DEPDENDENCIES 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.


install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
- pip install pytest-pep8
- pip install pytest
- pip install pytest-cov
- pip install coveralls

# 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:
# - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ( xvfb-run -a $MAIN_CMD $SETUP_CMD ) fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ( $MAIN_CMD $SETUP_CMD ) fi
- name: "Test pep8 requirements"
env: PYTHON=3.7 ASTROPY=4.0 NUMPY=1.17
script: flake8 imexam --count $FLAKE8_OPT


after_success:
- if [[ $SETUP_CMD == 'test --coverage' ]]; then coveralls --rcfile='imexam/tests/coveragerc'; fi
- coveralls --rcfile='imexam/tests/coveragerc'
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
version 0.8.2a (unreleased)
---------------------------
- cleanup of travis tests and general package reorg
- renamed xpa extension for compatibility and updated to version 2.1.19
- added option for center of mass to aperature photometry centering
- update aper_phot to return tuple of photometry information without plotting
- updated example jupyter notebooks to be compatible with current functionality
- changed the ext_build process a little and added a flag to skip remaking the c code
- remove leftover iraf variable names
- removed support for the grab function under Darwin
- add deleted import of xpa back to utils (#192)
- adapt for change to photutils API for aperture areas (#193)
- fix ginga display of HDUList
- add check for ds9 in alias as well as well as path
Expand Down
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ environment:
NUMPY_VERSION: "stable"
ASTROPY_VERSION: "development"

- PYTHON_VERSION: "3.8"
NUMPY_VERSION: "stable"
ASTROPY_VERSION: "development"


matrix:
fast_finish: true
Expand All @@ -49,7 +53,7 @@ install:
- cmd: set OLDPATH=
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: set PYTHONUNBUFFERED=1
- cmd: conda install scipy matplotlib numpy astropy ipython sphinx pytest
- cmd: conda install scipy matplotlib numpy astropy ipython sphinx pytest pytest-cov
- cmd: git submodule update --init --recursive
- cmd: conda info -a

Expand Down
2 changes: 1 addition & 1 deletion cextern/xpa
Submodule xpa updated 19 files
+14 −49 Makefile.in
+19 −9 client.c
+6 −0 conf.h.in
+430 −463 config.guess
+329 −115 config.sub
+2 −5 configure
+1 −5 configure.ac
+1 −1 ctest.c
+37 −3 dns.c
+3 −3 doc/pod/xpamb.pod
+3 −3 doc/xpamb.html
+3 −1 find.c
+24 −15 man/man1/xpamb.1
+43 −2 tcp.c
+3 −0 word.c
+3 −1 xalloc.c
+6 −3 xlaunch.c
+12 −4 xpa.c
+4 −1 xpap.h
32 changes: 32 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Uncomment the following lines to display the version number of the
# package rather than the version number of Astropy in the top line when
# running the tests.

import os

import pytest
from _pytest.doctest import DoctestItem


@pytest.fixture(autouse=True)
def _docdir(request):
"""
Make sure that doctests run in a temporary directory so that any files that
are created as part of the test get removed automatically.
"""

# Trigger ONLY for the doctests.
if isinstance(request.node, DoctestItem):

# Get the fixture dynamically by its name.
tmpdir = request.getfixturevalue('tmpdir')

# Chdir only for the duration of the test.
olddir = os.getcwd()
tmpdir.chdir()
yield
os.chdir(olddir)

else:
# For normal tests, we have to yield, since this is a yield-fixture.
yield
12 changes: 10 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,24 @@
import sphinx
import sphinx.environment
from docutils.utils import get_source_line
from pkg_resources import get_distribution
# from pkg_resources import get_distribution
from distutils.version import LooseVersion

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'))

try:
import imexam
release = imexam.__version__
except ImportError:
from pkg_resources import get_distribution
release = get_distribution(setup_cfg['package_name']).version

release = get_distribution('imexam').version
# for example take major/minor
version = '.'.join(release.split('.')[:4])

Expand Down
8 changes: 4 additions & 4 deletions docs/imexam/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Software Dependencies
* XPA: https://github.com/ericmandel/xpa
* Ginga (image display - optional )

astropy >= 1.0
astropy >= 3.0

python >= 2.7
python >= 3.5

numpy >= 1.7.0
numpy >= 1.12.0

photutils > 0.2
photutils
This must be installed to enable the photometry options for imexam() but
it is not required

Expand Down

0 comments on commit e8a620f

Please sign in to comment.