Skip to content

Commit

Permalink
Merge pull request #1925 from bsipocz/ci_switch_to_actions
Browse files Browse the repository at this point in the history
Switch CI to actions
  • Loading branch information
bsipocz authored Jan 12, 2021
2 parents 006768e + 7cbac80 commit 9915fac
Show file tree
Hide file tree
Showing 17 changed files with 248 additions and 316 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
pull_request:
schedule:
# run every Monday at 5am UTC
- cron: '0 5 * * 1'

env:
TOXARGS: '-v'

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:

- name: Code style checks
os: ubuntu-latest
python: 3.x
toxenv: codestyle

- name: docs build
os: ubuntu-latest
python: 3.8
toxenv: build_docs

- name: oldest dependencies
os: ubuntu-latest
python: 3.6
toxenv: py36-test-oldestdeps

- name: astropy dev with all dependencies with coverage
os: ubuntu-latest
python: 3.9
toxenv: py39-test-alldeps-devastropy-cov

- name: Python 3.7 with all optional dependencies (MacOS X)
os: macos-latest
python: 3.7
toxenv: py37-test-alldeps

- name: Python 3.8 with mandatory dependencies (Windows)
os: windows-latest
python: 3.8
toxenv: py38-test

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: python -m pip install --upgrade tox codecov
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }}
- name: Upload coverage to codecov
if: ${{ contains(matrix.toxenv,'-cov') }}
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml


egg_info:
name: egg_info with Python 3.7
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Run egg_info
run: python setup.py egg_info
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ distribute-*.tar.gz
.*.sw[op]
*~
.svn
.tmp

# Mac OSX
.DS_Store
Expand Down
170 changes: 0 additions & 170 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ include astroquery/CITATION
include astroquery/splatalogue/data/*

include ah_bootstrap.py
include setup.py
include setup.cfg
include pyproject.toml

recursive-include astroquery *.py
recursive-include docs *
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Installation and Requirements
-----------------------------

Astroquery works with Python 3.6 or later.
As an `astropy`_ affiliate, astroquery requires `astropy`_ version 3.1 or later.
As an `astropy`_ affiliate, astroquery requires `astropy`_ version 3.1.2 or later.

astroquery uses the `requests <http://docs.python-requests.org/en/latest/>`_
module to communicate with the internet. `BeautifulSoup
Expand Down
12 changes: 12 additions & 0 deletions astroquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ def _get_bibtex():


__citation__ = __bibtex__ = _get_bibtex()


try:
from .version import version as __version__
except ImportError:
# TODO: Issue a warning using the logging framework
__version__ = ''
try:
from .version import githash as __githash__
except ImportError:
# TODO: Issue a warning using the logging framework
__githash__ = ''
3 changes: 2 additions & 1 deletion astroquery/alma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ def _get_dataarchive_url(self):
response.raise_for_status()
# Jan 2017: we have to force https because the archive doesn't
# tell us it needs https.
self.dataarchive_url = response.url.replace("/asax/","").replace("/aq/","").replace("http://", "https://")
self.dataarchive_url = response.url.replace(
"/asax/", "").replace("/aq/", "").replace("http://", "https://")
else:
self.dataarchive_url = self.archive_url
elif self.dataarchive_url in ('http://almascience.org',
Expand Down
1 change: 1 addition & 0 deletions astroquery/mast/cutouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def _parse_cutout_size(size):

return {"x": x, "y": y, "units": units}


class TesscutClass(MastQueryWithLogin):
"""
MAST TESS FFI cutout query class.
Expand Down
2 changes: 1 addition & 1 deletion astroquery/tests/setup_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

def get_package_data():
return {
_ASTROPY_PACKAGE_NAME_ + '.tests': ['coveragerc']}
'astroquery.tests': ['coveragerc']}
13 changes: 11 additions & 2 deletions astroquery/vo_conesearch/validator/tests/test_inpect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
import os

# ASTROPY
from astropy.utils.data import _find_pkg_data_path, get_pkg_data_filename
import astropy
from astropy.utils.data import get_pkg_data_filename
from astropy.utils.introspection import minversion

ASTROPY_LT_4_3 = not minversion(astropy, '4.3')

if ASTROPY_LT_4_3:
from astropy.utils.data import _find_pkg_data_path as get_pkg_data_path
else:
from astropy.utils.data import get_pkg_data_path

# LOCAL
from .. import inspect
Expand All @@ -18,7 +27,7 @@ class TestConeSearchResults:
"""Inspection of ``TestConeSearchValidation`` results."""
def setup_class(self):
self.datadir = 'data'
test_vos_path = _find_pkg_data_path(self.datadir) + os.sep
test_vos_path = get_pkg_data_path(self.datadir) + os.sep

# Convert to a proper file:// URL--on *NIXen this is not necessary but
# Windows paths will blow up if we don't do this.
Expand Down
14 changes: 5 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,9 @@

# Load all of the global Astropy configuration
from astropy_helpers.sphinx.conf import *
from six.moves import urllib
import urllib

# Get configuration information from setup.cfg
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
from configparser import ConfigParser
conf = ConfigParser()

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
Expand Down Expand Up @@ -85,7 +81,7 @@
# -- Project information ------------------------------------------------------

# This does not *have* to match the package name, but typically does
project = setup_cfg['package_name']
project = setup_cfg['name']
author = setup_cfg['author']
copyright = '{0}, {1}'.format(
datetime.datetime.now().year, setup_cfg['author'])
Expand All @@ -94,8 +90,8 @@
# |version| and |release|, also used in various other places throughout the
# built documents.

__import__(setup_cfg['package_name'])
package = sys.modules[setup_cfg['package_name']]
__import__(project)
package = sys.modules[project]

# The short X.Y version.
version = package.__version__.split('-', 1)[0]
Expand Down
Loading

0 comments on commit 9915fac

Please sign in to comment.