Skip to content

Commit fd6eeb1

Browse files
committed
TST: Update CI matrix, add Windows job
Delete Appveyor testing and its badge. Repo admin needs to tell Appveyor to skip testing if the YML is not found. No need to set DISPLAY for egg tests. Switch to flake8 and fix PEP 8 warnings. Do not use six bundled with Astropy. [skip appveyor]
1 parent 7a894ac commit fd6eeb1

File tree

14 files changed

+37
-85
lines changed

14 files changed

+37
-85
lines changed

.travis.yml

Lines changed: 15 additions & 19 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,7 +38,6 @@ 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
@@ -49,52 +46,51 @@ matrix:
4946
include:
5047

5148
- stage: Initial tests
52-
env: PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
49+
env: PYTHON_VERSION=3.6 SETUP_CMD='egg_info'
5350
- stage: Initial tests
5451
env: SETUP_CMD='egg_info'
5552

5653
# Run one of the docs build during the initial tests
5754
- os: linux
5855
stage: Initial tests
5956
env: SETUP_CMD='build_docs -w'
60-
CONDA_DEPENDENCIES='pytz matplotlib astroquery'
61-
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'
57+
CONDA_DEPENDENCIES='pytz matplotlib six'
58+
PIP_DEPENDENCIES='pytest-mpl pytest-astropy astroquery'
6259

6360
- os: linux
6461
env: PYTHON_VERSION=3.6
6562

63+
# This replaces Appveyor
64+
- os: windows
65+
env: CONDA_DEPENDENCIES='pytz matplotlib six'
66+
PIP_DEPENDENCIES='pyephem pytest-mpl pytest-astropy'
67+
6668
- os: linux
6769
stage: Initial tests
6870
env: SETUP_CMD='test --remote-data -V'
69-
CONDA_DEPENDENCIES='pytz matplotlib'
71+
CONDA_DEPENDENCIES='pytz matplotlib six'
7072
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'
7173

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-
7874
# Try developer version of Astropy
7975
- os: linux
80-
env: PYTHON_VERSION=3.6 ASTROPY_VERSION=dev
76+
env: ASTROPY_VERSION=dev
8177

8278
# Do a PEP8 test with pycodestyle
8379
- os: linux
84-
env: MAIN_CMD='pycodestyle astroplan --count --max-line-length=100' SETUP_CMD=''
80+
env: MAIN_CMD='flake8 astroplan --count --max-line-length=100' SETUP_CMD=''
8581

8682
allow_failures:
8783
# Allow them to fail now until the IERSs issues are fixed
8884
- env: SETUP_CMD='test --remote-data -V'
89-
CONDA_DEPENDENCIES='pytz matplotlib'
85+
CONDA_DEPENDENCIES='pytz matplotlib six'
9086
PIP_DEPENDENCIES='pytest-mpl pytest-astropy'
9187

9288
install:
9389
- git clone git://github.com/astropy/ci-helpers.git
9490
- source ci-helpers/travis/setup_conda.sh
9591

9692
# This is needed to make matplotlib plot testing work
97-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
93+
- if [[ $SETUP_CMD == test* && $TRAVIS_OS_NAME == 'linux' ]]; then
9894
export DISPLAY=:99.0;
9995
sh -e /etc/init.d/xvfb start;
10096
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)