Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch CI to actions #1925

Merged
merged 14 commits into from
Jan 12, 2021
Next Next commit
Adding new tox.ini file and basic CI skeleton
bsipocz committed Jan 12, 2021
commit 565490f758e56de8218eb792b2b51069bb6f31b7
67 changes: 67 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI Tests

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

env:
TOXARGS: '-v'

jobs:
tests:
name: ${{ matrix.os }}, ${{ matrix.tox_env }}
runs-on: ${{ matrix.os }}
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
strategy:
fail-fast: true
matrix:
include:

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

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

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

- name: astropy dev with all dependencies with coverage
os: ubuntu-latest
py: 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


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
56 changes: 56 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[tox]
envlist =
py{36,37,38,39}-test{,-alldeps,-oldestdeps}{,-devastropy}{,-cov}
codestyle
build_docs
requires =
setuptools >= 30.3.0
pip >= 19.3.1
tox-pypi-filter >= 0.12
isolated_build = true


[testenv]

# The following option combined with the use of the tox-pypi-filter above allows
# project-wide pinning of dependencies, e.g. if new versions of pytest do not
# work correctly with pytest-astropy plugins. Most of the time the pinnings file
# should be empty.
pypi_filter = https://raw.githubusercontent.com/astropy/ci-helpers/master/pip_pinnings.txt
changedir =

description = run tests

deps =
devastropy: git+https://github.com/astropy/astropy.git#egg=astropy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why the job with devastropy is also building pyregion from source.

 ERROR: Failed building wheel for pyregion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah!!! It is a Python 3.9 job. Perhaps pyregion doesn't have wheel for it.

Copy link
Member Author

@bsipocz bsipocz Jan 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I asked about it in the regions channel. Actually I would prefer to not have it installed than using py3.8 here. Do you know a trick of how to remove a dependency from the all list?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know a trick of how to remove a dependency from the all list?

Unfortunately, I don't. The only options I know of are either refactoring the listing in setup.cfg or manually state your dependencies in tox.ini.


# TODO: Add more versions to oldestdeps
oldestdeps: astropy==3.1

extras =
test
alldeps: all

commands =
pip freeze
!cov: pytest astroquery docs
cov: pytest astroquery docs --cov astroquery
cov: codecov

[testenv:codestyle]
changedir =
skip_install = true
description = check code style
deps = pycodestyle
commands = pycodestyle astroquery --count


[testenv:build_docs]
changedir =
description = Building the narrative and API docs
extras = docs
requires =
sphinx < 3.4
commands =
pip freeze
python setup.py build_sphinx -W