Skip to content

Commit abd068a

Browse files
authored
Merge pull request #421 from pllim/patch-1
Update CI to get Travis working
2 parents 7a894ac + 1839be9 commit abd068a

14 files changed

Lines changed: 37 additions & 86 deletions

.travis.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ addons:
2222
env:
2323
global:
2424
# Set defaults to avoid repeating in most cases
25-
- PYTHON_VERSION=3.6
25+
- PYTHON_VERSION=3.7
2626
- NUMPY_VERSION=stable
2727
- ASTROPY_VERSION=stable
2828
- MAIN_CMD='python setup.py'
29-
- CONDA_DEPENDENCIES='pytz'
29+
- CONDA_DEPENDENCIES='pytz qt pyqt six'
3030
- PIP_DEPENDENCIES='pytest-astropy'
3131
- SETUP_CMD='test -V'
32-
- CONDA_CHANNELS='astropy'
33-
3432

3533
stages:
3634
# Do the initial tests and don't proceed if they fail
@@ -40,61 +38,58 @@ stages:
4038
- name: Cron and master-only tests
4139
if: type IN (push, cron)
4240

43-
4441
matrix:
4542

4643
# Don't wait for allowed failures
4744
fast_finish: true
4845

4946
include:
5047

51-
- stage: Initial tests
52-
env: PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
5348
- stage: Initial tests
5449
env: SETUP_CMD='egg_info'
5550

5651
# Run one of the docs build during the initial tests
5752
- os: linux
5853
stage: Initial tests
5954
env: SETUP_CMD='build_docs -w'
60-
CONDA_DEPENDENCIES='pytz matplotlib astroquery'
61-
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'
55+
CONDA_DEPENDENCIES='pytz matplotlib six'
56+
PIP_DEPENDENCIES='pytest-mpl pytest-astropy astroquery'
6257

6358
- os: linux
6459
env: PYTHON_VERSION=3.6
6560

61+
# This replaces Appveyor
62+
- os: windows
63+
env: CONDA_DEPENDENCIES='pytz matplotlib six'
64+
PIP_DEPENDENCIES='pyephem pytest-mpl pytest-astropy'
65+
6666
- os: linux
6767
stage: Initial tests
6868
env: SETUP_CMD='test --remote-data -V'
69-
CONDA_DEPENDENCIES='pytz matplotlib'
69+
CONDA_DEPENDENCIES='pytz matplotlib six'
7070
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'
7171

72-
# Try pre-release version of Numpy. This only runs if a pre-release
73-
# is available on pypi.
74-
- os: linux
75-
stage: Cron and master-only tests
76-
env: NUMPY_VERSION=prerelease
77-
7872
# Try developer version of Astropy
7973
- os: linux
80-
env: PYTHON_VERSION=3.6 ASTROPY_VERSION=dev
74+
env: ASTROPY_VERSION=dev
8175

8276
# Do a PEP8 test with pycodestyle
8377
- os: linux
84-
env: MAIN_CMD='pycodestyle astroplan --count --max-line-length=100' SETUP_CMD=''
78+
stage: Initial tests
79+
env: MAIN_CMD='flake8 astroplan --count --max-line-length=100' SETUP_CMD=''
8580

8681
allow_failures:
8782
# Allow them to fail now until the IERSs issues are fixed
8883
- env: SETUP_CMD='test --remote-data -V'
89-
CONDA_DEPENDENCIES='pytz matplotlib'
84+
CONDA_DEPENDENCIES='pytz matplotlib six'
9085
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'
9186

9287
install:
9388
- git clone git://github.com/astropy/ci-helpers.git
9489
- source ci-helpers/travis/setup_conda.sh
9590

9691
# This is needed to make matplotlib plot testing work
97-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
92+
- if [[ $SETUP_CMD == test* && $TRAVIS_OS_NAME == 'linux' ]]; then
9893
export DISPLAY=:99.0;
9994
sh -e /etc/init.d/xvfb start;
10095
export QT_API=pyqt;

README.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ Status shields
2727
:target: https://travis-ci.org/astropy/astroplan
2828
:alt: Travis Status
2929

30-
.. image:: https://ci.appveyor.com/api/projects/status/pff1o3vx446pav83/branch/master?svg=true
31-
:target: https://ci.appveyor.com/project/Astropy/astroplan/branch/master
32-
:alt: Appveyor Status
33-
3430
.. image:: https://img.shields.io/coveralls/astropy/astroplan.svg
3531
:target: https://coveralls.io/r/astropy/astroplan
3632
:alt: Code Coverage

appveyor.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

astroplan/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# We do this to pick up the test header report even when using LTS astropy
1818
try:
19-
from astropy.tests.pytest_plugins import pytest_report_header
19+
from astropy.tests.pytest_plugins import pytest_report_header # noqa
2020
except ImportError:
2121
pass
2222

astroplan/observer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
from __future__ import (absolute_import, division, print_function,
33
unicode_literals)
4+
from six import string_types
45

56
# Standard library
67
import datetime
@@ -9,7 +10,6 @@
910
# Third-party
1011
from astropy.coordinates import (EarthLocation, SkyCoord, AltAz, get_sun,
1112
get_moon, Angle, Longitude)
12-
from astropy.extern.six import string_types
1313
import astropy.units as u
1414
from astropy.time import Time
1515
import numpy as np
@@ -18,7 +18,7 @@
1818
# Package
1919
from .exceptions import TargetNeverUpWarning, TargetAlwaysUpWarning
2020
from .moon import moon_illumination, moon_phase_angle
21-
from .target import get_skycoord, SpecialObjectFlag, SunFlag, MoonFlag
21+
from .target import get_skycoord, SunFlag, MoonFlag
2222

2323

2424
__all__ = ["Observer", "MAGIC_TIME"]

astroplan/plots/tests/test_sky.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
try:
7-
import matplotlib
7+
import matplotlib # noqa
88
HAS_MATPLOTLIB = True
99
except ImportError:
1010
HAS_MATPLOTLIB = False

astroplan/scheduling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
from astropy.table import Table
1717

1818
from .utils import time_grid_from_range, stride_array
19-
from .constraints import AltitudeConstraint, AirmassConstraint
19+
from .constraints import AltitudeConstraint
2020
from .target import get_skycoord
2121

22-
__all__ = ['ObservingBlock', 'TransitionBlock', 'Schedule', 'Slot', 'Scheduler',
23-
'SequentialScheduler', 'PriorityScheduler', 'Transitioner', 'Scorer']
22+
__all__ = ['ObservingBlock', 'TransitionBlock', 'Schedule', 'Slot',
23+
'Scheduler', 'SequentialScheduler', 'PriorityScheduler',
24+
'Transitioner', 'Scorer']
2425

2526

2627
class ObservingBlock(object):
@@ -569,7 +570,7 @@ def _make_schedule(self, blocks):
569570
objects with populated ``start_time`` and ``end_time`` or ``duration`` attributes.
570571
"""
571572
raise NotImplementedError
572-
return schedule
573+
# return schedule
573574

574575
@classmethod
575576
@u.quantity_input(duration=u.second)
@@ -997,7 +998,6 @@ def __call__(self, oldblock, newblock, start_time, observer):
997998
from .constraints import _get_altaz
998999
from .target import get_skycoord
9991000
if oldblock.target != newblock.target:
1000-
from .target import get_skycoord
10011001
targets = get_skycoord([oldblock.target, newblock.target])
10021002
aaz = _get_altaz(start_time, observer, targets)['altaz']
10031003
sep = aaz[0].separation(aaz[1])

astroplan/target.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
# Third-party
99
import astropy.units as u
10-
from astropy.coordinates import (SkyCoord, ICRS, UnitSphericalRepresentation,
11-
SphericalRepresentation)
10+
from astropy.coordinates import SkyCoord, ICRS, UnitSphericalRepresentation
1211

1312
__all__ = ["Target", "FixedTarget", "NonFixedTarget"]
1413

astroplan/tests/test_constraints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def test_at_night_basic():
5555

5656
def test_observability_table():
5757
subaru = Observer.at_site("Subaru")
58-
time_ranges = [Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06']), # 1 day
59-
Time(['2007-08-09 10:11:12', '2007-08-09 11:11:12'])] # 1 hr
58+
# time_ranges = [Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06']), # 1 day
59+
# Time(['2007-08-09 10:11:12', '2007-08-09 11:11:12'])] # 1 hr
6060
targets = [vega, rigel, polaris]
6161

6262
time_range = Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06'])

astroplan/tests/test_observer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_parallactic_angle():
270270

271271

272272
def print_pyephem_parallactic_angle():
273-
lat = 19.826218*u.deg
273+
# lat = 19.826218*u.deg
274274
lon = -155.471999*u.deg
275275
time = Time('2015-01-01 00:00:00')
276276
LST = time.sidereal_time('mean', longitude=lon)
@@ -779,7 +779,6 @@ def test_solar_transit_convenience_methods():
779779
pressure = 0 * u.bar
780780
location = EarthLocation.from_geodetic(lon, lat, elevation)
781781
time = Time('2000-01-01 12:00:00')
782-
from astropy.coordinates import get_sun
783782
obs = Observer(location=location, pressure=pressure)
784783

785784
# Compute next/previous noon/midnight using generic calc_transit methods
@@ -1234,7 +1233,7 @@ def test_tonight():
12341233

12351234
post_civil_sunset = Time('2016-08-08 05:00:00')
12361235
during_twilight = obs.tonight(time=post_civil_sunset, horizon=horizon)
1237-
during_twilight_wo_horizon = obs.tonight(time=post_civil_sunset)
1236+
during_twilight_wo_horizon = obs.tonight(time=post_civil_sunset) # noqa
12381237

12391238
# Get correct astro sunset if checking after civil sunset
12401239
assert (abs(astro_sunset.datetime - during_twilight[0].datetime) <
@@ -1279,7 +1278,7 @@ def test_moon_rise_set():
12791278
lat = '42:00:00'
12801279
lon = '-70:00:00'
12811280
elevation = 0.0 * u.m
1282-
pressure = 0 * u.bar
1281+
# pressure = 0 * u.bar
12831282
location = EarthLocation.from_geodetic(lon, lat, elevation)
12841283

12851284
obs = Observer(location=location)

0 commit comments

Comments
 (0)