Skip to content

Commit

Permalink
Updating travis matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
sosey committed Mar 29, 2020
1 parent e9510bf commit 0c78200
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 47 deletions.
44 changes: 21 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ addons:
env:
global:
# https://docs.travis-ci.com/user/environment-variables/
- NUMPY=1.14
- NUMPY=1.17
- ASTROPY=4.0
- PYTHON=3.7
- CONDA_DEPENDENCIES='scipy matplotlib ipython Cython setuptools_scm pip pytest'
- CONDA_DEPENDENCIES='scipy matplotlib pyqt ginga ipython Cython setuptools_scm pip pytest'

# PEP8 errors/warnings:
# E101 - mix of tabs and spaces
Expand All @@ -40,7 +40,7 @@ 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"

before_install:
# Install the latest version of Miniconda
Expand All @@ -49,30 +49,25 @@ before_install:
- 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
- git submodule update --init --recursive

install:
# You can add any CONDA channels you may need here. CONDA supports
# both the commands add and append. The only difference is that
# the add command places the channel at the front of the priority
# list, while append does the opposite.
- conda config --add channels conda-forge
- conda config --add channels astropy
- conda create --yes -n test python=$PYTHON
- conda create --yes -n test python=$PYTHON numpy=$NUMPY
- source activate test
- conda install -y numpy=$NUMPY astropy=$ASTROPY
- conda install -y astropy=$ASTROPY
- conda install -y $CONDA_DEPENDENCIES
# - sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
- 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
- pip install -e .

- python setup.py build_ext --inplace

jobs:

Expand All @@ -82,21 +77,24 @@ jobs:
include:
# Check for sphinx doc build warnings - we do this first because
- python: 3.7
script: python setup.py build_sphinx -w
env: numpy=1.17
script: python setup.py build_sphinx

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


# Do coverage tests
Expand Down
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@
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'))

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
2 changes: 2 additions & 0 deletions docs/rtd-pip-requirements
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
astropy
scipy
numpy
matplotlib
Cython
Expand All @@ -7,3 +8,4 @@ ipython
astropy-sphinx-theme
pytest-astropy
sphinx-astropy
sphinx-automodapi
10 changes: 5 additions & 5 deletions imexam/imexamine.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def do_option(self, x, y, key):
"""
self.log.debug(f"pressed: {key}, {self.imexam_option_funcs[key][0].__name__}")
# dont require input for saving the active figure
# dont require input for saving the active figure
if key == 's':
self.imexam_option_funcs[key][0]()
else:
Expand Down Expand Up @@ -542,7 +542,7 @@ def aper_phot(self, x, y, data=None,
If error is not None, then it should be given the
error array for the corresponding data image.
error is assumed to include all sources of error,
including the Poisson error of the sources
including the Poisson error of the sources
See the docs for photutils for more details.
The returned table will include a 'aperture_sum_err' column
in addition to 'aperture_sum'. 'aperture_sum_err'
Expand Down Expand Up @@ -917,8 +917,8 @@ def column_fit(self, x, y, data=None, form=None, genplot=True, fig=None):
return result

def com_center(self, x, y, data=None, delta=None, oversample=1.):
""" Return the center of mass of the object at x,y
""" Return the center of mass of the object at x,y
Parameters
----------
x: int
Expand Down Expand Up @@ -959,7 +959,7 @@ def com_center(self, x, y, data=None, delta=None, oversample=1.):
try:
xcenter, ycenter = centroid_com(chunk, oversample=oversample)

pstr = f"xc={(xcenter + xx - delta):.4f}\tyc={(ycenter + yy - delta):.4f}"
pstr = f"xc={(xcenter + xx - delta):.4f}\tyc={(ycenter + yy - delta):.4f}"
except AttributeError:
raise AttributeError("Problem with center of mass")
self.log.info(pstr)
Expand Down
8 changes: 4 additions & 4 deletions imexam/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

from . import __version__

try:
try:
import imexamxpa as xpa
_have_xpa = True
except ImportError:
_have_xpa = False
_have_xpa = True
except ImportError:
_have_xpa = False


# To guide any import *
Expand Down
5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ classifiers =
'Programming Language :: C'
'Programming Language :: Cython'
'Programming Language :: Python :: 3'
'Programming Language :: Python :: 3.6'
'Programming Language :: Python :: 3.7'
'Programming Language :: Python :: 3.8'
'Programming Language :: Python :: Implementation :: CPython'
'Topic :: Scientific/Engineering :: Astronomy'
'Topic :: Software Development :: Libraries :: Python Modules'
Expand All @@ -35,7 +32,7 @@ packages =
imexam
install_requires =
numpy>=1.14
scipy
scipy>=0.18
astropy>=3.0
matplotlib
zip_safe = false
Expand Down
19 changes: 10 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ def finalize_options(self):
BuildDoc.finalize_options(self)

def run(self):
build_cmd = self.reinitialize_command('build_ext')
build_cmd.inplace = 1
self.run_command('build_ext')
try:
import imexam
except ImportError as e:
build_cmd = self.reinitialize_command('build_ext')
build_cmd.inplace = 1
retcode = build_main(['-W', '--keep-going', '-b', 'html', './docs', './docs/_build/html'])
if retcode != 0:
sys.exit(retcode)
Expand Down Expand Up @@ -192,7 +194,8 @@ def finalize_options(self):

def run(self):
try:
check_call(["make", "clean"], cwd=XPALIB_DIR)
if os.access(XPALIB_DIR + "Makefile", os.F_OK):
check_call(["make", "clean"], cwd=XPALIB_DIR)
except CalledProcessError as e:
print(e)
exit(1)
Expand Down Expand Up @@ -240,9 +243,7 @@ def run(self):
if self.remake:
try:
check_call(["sh", "./configure","--prefix="+current_env], cwd=XPALIB_DIR)
check_call(["make", "-f", "Makefile", "clean"],
cwd=XPALIB_DIR)
check_call(["make", "-f", "Makefile", "install"], cwd=XPALIB_DIR)
check_call(["make", "install"], cwd=XPALIB_DIR)
except CalledProcessError as e:
print(e)
exit(1)
Expand All @@ -267,9 +268,9 @@ def build_extensions(self):

def run(self):
try:
check_call(["make", "-f", "Makefile", "clean"],cwd=XPALIB_DIR)
check_call(["sh", "./configure","--prefix="+current_env], cwd=XPALIB_DIR)
check_call(["make", "-f", "Makefile", "install"], cwd=XPALIB_DIR)
check_call(["make", "clean"],cwd=XPALIB_DIR)
check_call(["make", "install"], cwd=XPALIB_DIR)
except CalledProcessError as e:
print(e)
exit(1)
Expand Down

0 comments on commit 0c78200

Please sign in to comment.