From 8b1a5d72c84324d6022d8f7001b0969a20f268dd Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Thu, 20 Feb 2020 17:54:39 -0700 Subject: [PATCH 01/34] add github actions workflow configuration to the template and add a question whether to use it --- QUESTIONS.rst | 11 +-- cookiecutter.json | 1 + docs/options.rst | 1 + hooks/post_gen_project.py | 3 + rendered.yml | 1 + .../.github/workflows/tox-tests.yml | 87 +++++++++++++++++++ 6 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 {{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml diff --git a/QUESTIONS.rst b/QUESTIONS.rst index 5e5ec331..f344d6a4 100644 --- a/QUESTIONS.rst +++ b/QUESTIONS.rst @@ -17,8 +17,9 @@ a description of each of the prompts. 10. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. 11. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. 12. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service. -13. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. -14. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. -15. ``required_dependencies``: Comma-separated list of required dependencies -16. ``optional_dependencies``: Comma-separated list of optional dependencies -17. ``minimum_python_version``: Version string of minimum supported Python version +13. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. +14. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. +15. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. +16. ``required_dependencies``: Comma-separated list of required dependencies +17. ``optional_dependencies``: Comma-separated list of optional dependencies +18. ``minimum_python_version``: Version string of minimum supported Python version diff --git a/cookiecutter.json b/cookiecutter.json index 56b594b8..f5fe3ffd 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -11,6 +11,7 @@ "edit_on_github_extension": "False", "github_project": "astropy/astropy", "use_travis_ci": "y", + "use_gh_actions": "y", "use_read_the_docs": "y", "sphinx_theme": "astropy-bootstrap", "_parent_project": "astropy", diff --git a/docs/options.rst b/docs/options.rst index 98edb0aa..335496e3 100644 --- a/docs/options.rst +++ b/docs/options.rst @@ -19,6 +19,7 @@ a description of each of the prompts: #. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. #. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. #. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service. +#. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. #. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. #. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. #. ``required_dependencies``: Comma-separated list of required dependencies diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ee59f10b..d2b877a5 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -43,6 +43,9 @@ def process_licence(licence_name): if '{{ cookiecutter.use_travis_ci }}' != 'y': remove_file('.travis.yml') + if '{{ cookiecutter.use_gh_actions }}' != 'y': + remove_dir('.github') + if '{{ cookiecutter.use_read_the_docs }}' != 'y': remove_file('.rtd-environment.yml') remove_file('readthedocs.yml') diff --git a/rendered.yml b/rendered.yml index 9213f459..c13cf7db 100644 --- a/rendered.yml +++ b/rendered.yml @@ -12,6 +12,7 @@ default_context: edit_on_github_extension: "False" github_project: "astropy/astropy" use_travis_ci: "y" + use_gh_actions: "y" use_read_the_docs: "y" sphinx_theme: "astropy-bootstrap" minimum_python_version: "3.6" diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml new file mode 100644 index 00000000..d60954d7 --- /dev/null +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -0,0 +1,87 @@ +# GitHub Actions workflow for testing and continuous integration. +# +# This file performs testing using tox and tox.ini to define and configure the test environments. + +name: Python Tests + +on: [push, pull_request] + +jobs: + + # Set up matrix to run tox tests across lists of os, python version, and tox environment + matrix_tests: + runs-on: ${{ matrix.os }} + if: "!contains(github.event.head_commit.message, '[ci skip]')" # github actions doesn't yet support this natively so add here + strategy: + matrix: + # Github actions supports ubuntu, windows, and macos virtual environments: + # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners + # + # Only run on ubuntu by default, but can add other os's to the test matrix here. + # E. g.: os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest] + + # Test python 3.6, 3.7, and 3.8 by default + python-ver: [6, 7, 8] + + # Specify which tox environments to test in this list + tox-env: [cov, alldeps, devdeps, oldestdeps, astropylts] + steps: + - uses: actions/checkout@v1 + - name: Set up python 3.${{ matrix.python-ver }} with tox environment ${{ matrix.tox-env }} on ${{ matrix.os }} + uses: actions/setup-python@v1 + with: + python-version: 3.${{ matrix.python-ver }} + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + python -m pip install numpy tox + - name: Test with tox + run: | + tox -e py3${{ matrix.python-ver }}-test-${{ matrix.tox-env }} + # + # # This is an example of how to upload coverage to codecov + # - name: Upload coverage to codecov + # if: matrix.tox-env == 'cov' && matrix.python-ver == '8' + # uses: codecov/codecov-action@v1 + # with: + # token: ${{ secrets.CODECOV }} + # file: ./coverage.xml + # fail_ci_if_error: true + + # Test building of docs and check the links + doc_test: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: + - uses: actions/checkout@v1 + - name: Set up Python to build docs with sphinx + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: Build and check docs using tox + run: | + tox -e build_docs + tox -e linkcheck + + # Perform codestyle check + codestyle: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: + - uses: actions/checkout@v1 + - name: Python codestyle check + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: Check codestyle using tox + run: | + tox -e codestyle From 7b3f717b29f7e35a3516ab97a70bb84a31199a79 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Thu, 20 Feb 2020 18:03:18 -0700 Subject: [PATCH 02/34] flesh out comments in workflow config file --- .../.github/workflows/tox-tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml index d60954d7..81562404 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -21,10 +21,11 @@ jobs: # E. g.: os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] - # Test python 3.6, 3.7, and 3.8 by default + # Test python 3.6, 3.7, and 3.8 by default. python-ver: [6, 7, 8] - # Specify which tox environments to test in this list + # Specify which tox environments to test in this list. They will get built into a form of, e.g., py38-test-astropylts for + # python-ver of '8' and tox-env of 'astropylts'. tox-env: [cov, alldeps, devdeps, oldestdeps, astropylts] steps: - uses: actions/checkout@v1 From 95bce3705733792ba4b962765af7d840819f5b0f Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Thu, 20 Feb 2020 18:11:50 -0700 Subject: [PATCH 03/34] fix to only use var from tox-env since tox is smart enough to figure out the rest from there based on the default version of python that's available --- .../.github/workflows/tox-tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml index 81562404..e6b07064 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -18,14 +18,13 @@ jobs: # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # # Only run on ubuntu by default, but can add other os's to the test matrix here. - # E. g.: os: [ubuntu-latest, macos-latest, windows-latest] + # For example -- os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] # Test python 3.6, 3.7, and 3.8 by default. python-ver: [6, 7, 8] - # Specify which tox environments to test in this list. They will get built into a form of, e.g., py38-test-astropylts for - # python-ver of '8' and tox-env of 'astropylts'. + # Specify which tox environments to test in this list. tox-env: [cov, alldeps, devdeps, oldestdeps, astropylts] steps: - uses: actions/checkout@v1 @@ -39,7 +38,7 @@ jobs: python -m pip install numpy tox - name: Test with tox run: | - tox -e py3${{ matrix.python-ver }}-test-${{ matrix.tox-env }} + tox -e ${{ matrix.tox-env }} # # # This is an example of how to upload coverage to codecov # - name: Upload coverage to codecov From 9d3c29dd3bdeb21b3489a6ce233935d90c8ac0ac Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Thu, 20 Feb 2020 18:26:15 -0700 Subject: [PATCH 04/34] don't install numpy in actions, let tox handle it. need to specify the py3x- part of the tox env name. --- .../.github/workflows/tox-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml index e6b07064..5aca932c 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -35,10 +35,10 @@ jobs: - name: Install base dependencies run: | python -m pip install --upgrade pip - python -m pip install numpy tox + python -m pip install tox - name: Test with tox run: | - tox -e ${{ matrix.tox-env }} + tox -e py3${{ matrix.python-ver }}-${{ matrix.tox-env }} # # # This is an example of how to upload coverage to codecov # - name: Upload coverage to codecov From 070f212866ef14a8d310e80a16f06bb1cbbbbb2e Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Thu, 20 Feb 2020 18:29:36 -0700 Subject: [PATCH 05/34] remove oldestdeps from env list. update step name. --- .../.github/workflows/tox-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml index 5aca932c..2f9b0652 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -25,10 +25,10 @@ jobs: python-ver: [6, 7, 8] # Specify which tox environments to test in this list. - tox-env: [cov, alldeps, devdeps, oldestdeps, astropylts] + tox-env: [cov, alldeps, devdeps, astropylts] steps: - uses: actions/checkout@v1 - - name: Set up python 3.${{ matrix.python-ver }} with tox environment ${{ matrix.tox-env }} on ${{ matrix.os }} + - name: Set up python 3.${{ matrix.python-ver }} with tox environment py3${{ matrix.python-ver }}-${{ matrix.tox-env }} on ${{ matrix.os }} uses: actions/setup-python@v1 with: python-version: 3.${{ matrix.python-ver }} From 16d329bdff1f70d0204ae3f87f4167f49d01c861 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Fri, 21 Feb 2020 12:19:03 -0700 Subject: [PATCH 06/34] add note to template_changes; tell cookiecutter to not render anything in .github --- TEMPLATE_CHANGES.md | 3 +++ cookiecutter.json | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TEMPLATE_CHANGES.md b/TEMPLATE_CHANGES.md index b46cec66..4bbdb160 100644 --- a/TEMPLATE_CHANGES.md +++ b/TEMPLATE_CHANGES.md @@ -18,6 +18,9 @@ be copied over manually if desired. - Refactored the template to follow the recommendations in APE 17: https://github.com/astropy/astropy-APEs/blob/master/APE17.rst [#438] +- Add option to use Github Actions for CI. + + 2.1 (unreleased) ---------------- diff --git a/cookiecutter.json b/cookiecutter.json index f5fe3ffd..4ea98696 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -17,5 +17,8 @@ "_parent_project": "astropy", "required_dependencies": "astropy", "optional_dependencies": "", - "minimum_python_version": ["3.6", "3.7", "3.8"] + "minimum_python_version": ["3.6", "3.7", "3.8"], + "_copy_without_render": [ + ".github" + ] } From 7e8bf288f753ac57d32bd099e57bed8e2fa3b69b Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 8 Jun 2020 13:56:30 -0700 Subject: [PATCH 07/34] add coverage command to tox.ini to create xml output appropriate for codecov upload --- {{ cookiecutter.package_name }}/tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 7ff04353..2cd5cc0c 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -43,6 +43,7 @@ description = # The following provides some specific pinnings for key packages deps = + cov: coverage numpy116: numpy==1.16.* numpy117: numpy==1.17.* numpy118: numpy==1.18.* @@ -63,6 +64,7 @@ commands = pip freeze !cov: pytest --pyargs {{ cookiecutter.module_name }} {toxinidir}/docs {posargs} cov: pytest --pyargs {{ cookiecutter.module_name }} {toxinidir}/docs --cov {{ cookiecutter.module_name }} --cov-config={toxinidir}/setup.cfg {posargs} + cov: coverage xml -o {toxinidir}/coverage.xml [testenv:build_docs] changedir = docs From 6e44fb1d851ed5faa872e3779ac9244fb8c82242 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 8 Jun 2020 14:18:48 -0700 Subject: [PATCH 08/34] remove python36 from actions matrix; update actions to use v2 for checkout and setup-python --- .../.github/workflows/tox-tests.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml index 2f9b0652..3ecf603e 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -21,15 +21,15 @@ jobs: # For example -- os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] - # Test python 3.6, 3.7, and 3.8 by default. - python-ver: [6, 7, 8] + # Test python 3.7 and 3.8 by default. + python-ver: [7, 8] # Specify which tox environments to test in this list. tox-env: [cov, alldeps, devdeps, astropylts] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up python 3.${{ matrix.python-ver }} with tox environment py3${{ matrix.python-ver }}-${{ matrix.tox-env }} on ${{ matrix.os }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.${{ matrix.python-ver }} - name: Install base dependencies @@ -54,11 +54,11 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python to build docs with sphinx - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.x' - name: Install base dependencies run: | python -m pip install --upgrade pip @@ -73,11 +73,11 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Python codestyle check - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.x' - name: Install base dependencies run: | python -m pip install --upgrade pip From 334e1776d63b631575a4a8633265255c26f92ea9 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 8 Jun 2020 17:30:48 -0700 Subject: [PATCH 09/34] remove redundant step in actions doc_test --- {{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml index 3ecf603e..610fa1b6 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -65,7 +65,6 @@ jobs: python -m pip install tox - name: Build and check docs using tox run: | - tox -e build_docs tox -e linkcheck # Perform codestyle check From 18fbe1505064c2412b96e3fec9fca40f18e2d255 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 9 Jun 2020 10:51:56 -0700 Subject: [PATCH 10/34] add build_docs back as a separate step in the actions workflow --- .../.github/workflows/tox-tests.yml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml index 610fa1b6..441f02e6 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml @@ -49,7 +49,25 @@ jobs: # file: ./coverage.xml # fail_ci_if_error: true - # Test building of docs and check the links + # Test building of documents + doc_build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: + - uses: actions/checkout@v2 + - name: Set up Python to build docs with sphinx + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: Testing building of docs using tox + run: | + tox -e build_docs + + # Test links in documents doc_test: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" @@ -63,7 +81,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install tox - - name: Build and check docs using tox + - name: Check links in docs using tox run: | tox -e linkcheck From 90c6fd0ec4c6b65b24dcc44daa262e1b09226767 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 13:33:10 -0700 Subject: [PATCH 11/34] remove travis config --- TEMPLATE_CHANGES.md | 3 - {{ cookiecutter.package_name }}/.travis.yml | 183 -------------------- 2 files changed, 186 deletions(-) delete mode 100644 {{ cookiecutter.package_name }}/.travis.yml diff --git a/TEMPLATE_CHANGES.md b/TEMPLATE_CHANGES.md index c49877be..193372c8 100644 --- a/TEMPLATE_CHANGES.md +++ b/TEMPLATE_CHANGES.md @@ -18,12 +18,9 @@ be copied over manually if desired. - Refactored the template to follow the recommendations in APE 17: https://github.com/astropy/astropy-APEs/blob/master/APE17.rst [#438] -<<<<<<< HEAD - Add option to use Github Actions for CI. -======= - Added cron job for RST link checking [#482] ->>>>>>> cookiecutter 2.1 (unreleased) ---------------- diff --git a/{{ cookiecutter.package_name }}/.travis.yml b/{{ cookiecutter.package_name }}/.travis.yml deleted file mode 100644 index bb604d84..00000000 --- a/{{ cookiecutter.package_name }}/.travis.yml +++ /dev/null @@ -1,183 +0,0 @@ -language: python - -# We need a full clone to make sure setuptools_scm works properly -git: - depth: false - -os: - - linux - -# The apt packages below are needed for sphinx builds. A full list of packages -# that can be included can be found here: -# -# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise - -addons: - apt: - packages: - - graphviz - - -stages: - # Do the style check and a single test job, don't proceed if it fails - - name: Initial tests - # Test docs, astropy dev, and without optional dependencies - - name: Comprehensive tests - # These will only run when cron is opted in - - name: Cron tests - if: type = cron - - -env: - global: - - # The following versions are the 'default' for tests, unless - # overridden underneath. They are defined here in order to save having - # to repeat them for all configurations. - - # The following three variables are for tox. TOXENV is a standard - # variable that tox uses to determine the environment to run, - # TOXARGS are arguments passed to tox, and TOXPOSARGS are arguments - # that tox passes through to the {posargs} indicator in tox.ini. - # The latter can be used for example to pass arguments to pytest. - - TOXENV='test' - - TOXARGS='-v' - - TOXPOSARGS='' - - # The following is needed to avoid issues if e.g. Matplotlib tries - # to open a GUI window. - - SETUP_XVFB=True - -matrix: - - # Don't wait for allowed failures - fast_finish: true - - include: - - # Try MacOS X, usually enough only to run from cron as hardly there are - # issues that are not picked up by a linux worker. We set language to - # 'c' since 'python' doesn't work on non-Linux platforms. - - os: osx - language: c - name: Python 3.7 with required dependencies - stage: Cron tests - env: PYTHON_VERSION=3.7 TOXENV=py37-test - - # Do a regular build on Linux with Python 3.8, with cov - # For Linux we use language: python to avoid using conda. - - os: linux - python: 3.8 - name: Python 3.8 with required dependencies and measure coverage - stage: Initial tests - env: TOXENV=py38-test-cov - - # Check for sphinx doc build warnings - - os: linux - python: 3.8 - name: Documentation build - stage: Comprehensive tests - env: TOXENV=build_docs - - # Now try Astropy dev with the latest Python - - os: linux - python: 3.8 - name: Python 3.8 with developer version of astropy - stage: Comprehensive tests - env: TOXENV=py38-test-devdeps - - # And with an older Python, Astropy LTS, and the oldest supported Numpy - - os: linux - python: 3.6 - name: Python 3.6 astropy LTS and Numpy 1.16 - stage: Comprehensive tests - env: TOXENV=py36-test-astropylts-numpy116 - - # Add a job that runs from cron only and tests against astropy dev and - # numpy dev to give a change for early discovery of issues and feedback - # for both developer teams. - - os: linux - python: 3.8 - name: Python 3.8 latest developer version of key dependencies - stage: Cron tests - env: TOXENV=py38-test-devdeps - - # Try on Windows. - - os: windows - language: c - name: Python 3.8 with required dependencies - stage: Comprehensive tests - env: PYTHON_VERSION=3.8 TOXENV=py38-test - - # Try other python versions and Numpy versions. Since we can assume that - # the Numpy developers have taken care of testing Numpy with different - # versions of Python, we can vary Python and Numpy versions at the same - # time. - - - os: linux - python: 3.7 - name: Python 3.7 with astropy 3.0 and Numpy 1.17 - stage: Comprehensive tests - env: TOXENV=py37-test-astropy30-numpy117 - - # Do a code style check - - os: linux - python: 3.8 - name: Code style checks - stage: Initial tests - env: TOXENV=codestyle - - # Run documentation link check in a cron job. - - language: python - python: 3.8 - name: Documentation link check - stage: Cron tests - env: TOXENV=linkcheck - addons: - apt: - packages: - - graphviz - - allow_failures: - # Do a PEP8 test with flake8 - # (do allow to fail unless your code completely compliant) - # - os: linux - # python: 3.8 - # name: Code style checks - # stage: Initial tests - # env: TOXENV=codestyle - - -before_install: - # Create a coverage.xml for use by coveralls or codecov - - if [[ $TOXENV == *-cov ]]; then - export TOXPOSARGS=$TOXPOSARGS" --cov-report=xml:"$TRAVIS_BUILD_DIR"/coverage.xml"; - fi - -install: - - # We now use the ci-helpers package to set up our Python environment - # on Windows and MacOS X but we don't set up any other dependencies, - # instead using tox to do this. See https://github.com/astropy/ci-helpers - # for more information about ci-helpers. - - - if [[ $TRAVIS_OS_NAME != linux ]]; then - git clone --depth 1 git://github.com/astropy/ci-helpers.git; - source ci-helpers/travis/setup_python.sh; - fi - -script: - - pip install tox - - tox $TOXARGS -- $TOXPOSARGS - -after_success: - # if either coveralls or codecov is used, uncomment the if and fi statements - # and the appropriate two lines inside the if statement - # - if [[ $TOXENV == *-cov ]]; then - # # If coveralls.io is set up for this package, uncomment the two lines below. - # pip install coveralls; - # coveralls; - # # If codecov is set up for this package, uncomment the two lines below - # pip install codecov; - # codecov; - # fi From e104a31ed07bd4877f0b19f0c964f3743cf5c6ff Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 13:41:42 -0700 Subject: [PATCH 12/34] edit TEMPLATE_CHANGES to more clearly reflect move to Actions for all CI in lieu of Travis and Appveyor --- TEMPLATE_CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TEMPLATE_CHANGES.md b/TEMPLATE_CHANGES.md index 193372c8..e2c72141 100644 --- a/TEMPLATE_CHANGES.md +++ b/TEMPLATE_CHANGES.md @@ -13,12 +13,12 @@ be copied over manually if desired. - Moved as much as possible of the setup.py configuration to setup.cfg, and now require setuptools>=30.3. [#375] -- Removed Appveyor CI option. Use ``os: windows`` in Travis CI. [#420] +- Removed Appveyor CI option. Use ``os: windows-latest`` in Github Actions. [#420] - Refactored the template to follow the recommendations in APE 17: https://github.com/astropy/astropy-APEs/blob/master/APE17.rst [#438] -- Add option to use Github Actions for CI. +- Switch to using Github Actions for CI; remove Travis config. - Added cron job for RST link checking [#482] From 64f7fdbed2758e34d97a9de4c7d8a94c0bb6d9c0 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 13:52:27 -0700 Subject: [PATCH 13/34] renameactions ci workflow to be more generalized --- .../.github/workflows/{tox-tests.yml => ci_tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{ cookiecutter.package_name }}/.github/workflows/{tox-tests.yml => ci_tests.yml} (100%) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml similarity index 100% rename from {{ cookiecutter.package_name }}/.github/workflows/tox-tests.yml rename to {{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml From 17c03c0a07dfb728779729cf7a0a983c26e9032a Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 16:11:32 -0700 Subject: [PATCH 14/34] add scheduled weekly test to check documentation links --- .../.github/workflows/ci_cron_weekly.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 {{ cookiecutter.package_name }}/.github/workflows/ci_cron_weekly.yml diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci_cron_weekly.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_cron_weekly.yml new file mode 100644 index 00000000..d2f5d06c --- /dev/null +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci_cron_weekly.yml @@ -0,0 +1,27 @@ +# GitHub Actions workflow that runs on a cron schedule. + +name: Cron Scheduled CI Tests + +on: + schedule: + # run at 6am UTC on Mondays + - cron: '0 6 * * 1' + +jobs: + # Testing links in documents is a good example of something to run on a schedule + # to catch links that stop working for some reason. + doc_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python to build docs with sphinx + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: Check links in docs using tox + run: | + tox -e linkcheck From f8c89718e3c164756c43a28bf127522164037a92 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 16:11:56 -0700 Subject: [PATCH 15/34] refactor core ci workflow to more closely match what is now used in astropy --- .../.github/workflows/ci_tests.yml | 137 +++++++----------- 1 file changed, 56 insertions(+), 81 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml index 441f02e6..c80e0232 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml @@ -2,103 +2,78 @@ # # This file performs testing using tox and tox.ini to define and configure the test environments. -name: Python Tests +name: CI Tests on: [push, pull_request] jobs: - - # Set up matrix to run tox tests across lists of os, python version, and tox environment - matrix_tests: + # Github Actions supports ubuntu, windows, and macos virtual environments: + # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners + ci_tests: + name: ${{ matrix.name }} runs-on: ${{ matrix.os }} - if: "!contains(github.event.head_commit.message, '[ci skip]')" # github actions doesn't yet support this natively so add here strategy: matrix: - # Github actions supports ubuntu, windows, and macos virtual environments: - # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners - # - # Only run on ubuntu by default, but can add other os's to the test matrix here. - # For example -- os: [ubuntu-latest, macos-latest, windows-latest] - os: [ubuntu-latest] + include: + - name: Code style checks + os: ubuntu-latest + python: 3.x + toxenv: codestyle - # Test python 3.7 and 3.8 by default. - python-ver: [7, 8] + - name: Python 3.7 with minimal dependencies + os: ubuntu-latest + python: 3.7 + toxenv: py37-test - # Specify which tox environments to test in this list. - tox-env: [cov, alldeps, devdeps, astropylts] - steps: - - uses: actions/checkout@v2 - - name: Set up python 3.${{ matrix.python-ver }} with tox environment py3${{ matrix.python-ver }}-${{ matrix.tox-env }} on ${{ matrix.os }} - uses: actions/setup-python@v2 - with: - python-version: 3.${{ matrix.python-ver }} - - name: Install base dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox - - name: Test with tox - run: | - tox -e py3${{ matrix.python-ver }}-${{ matrix.tox-env }} - # - # # This is an example of how to upload coverage to codecov - # - name: Upload coverage to codecov - # if: matrix.tox-env == 'cov' && matrix.python-ver == '8' - # uses: codecov/codecov-action@v1 - # with: - # token: ${{ secrets.CODECOV }} - # file: ./coverage.xml - # fail_ci_if_error: true + - name: Python 3.8 with all optional dependencies and coverage checking + os: ubuntu-latest + python: 3.8 + toxenv: py38-test-alldeps-cov - # Test building of documents - doc_build: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - steps: - - uses: actions/checkout@v2 - - name: Set up Python to build docs with sphinx - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install base dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox - - name: Testing building of docs using tox - run: | - tox -e build_docs + - name: OS X - Python 3.8 with all optional dependencies + os: macos-latest + python: 3.8 + toxenv: py38-test-alldeps - # Test links in documents - doc_test: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - steps: - - uses: actions/checkout@v2 - - name: Set up Python to build docs with sphinx - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install base dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox - - name: Check links in docs using tox - run: | - tox -e linkcheck + - name: Windows - Python 3.8 with all optional dependencies + os: windows-latest + python: 3.8 + toxenv: py38-test-alldeps + + # - name: Python 3.7 with oldest supported version of all dependencies + # os: ubuntu-16.04 + # python: 3.7 + # toxenv: py37-test-oldestdeps + + # - name: Python 3.8 with latest dev versions of key dependencies + # os: ubuntu-latest + # python: 3.8 + # toxenv: py38-test-devdeps + + # - name: Test building of Sphinx docs + # os: ubuntu-latest + # python: 3.x + # toxenv: build_docs - # Perform codestyle check - codestyle: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - - uses: actions/checkout@v2 - - name: Python codestyle check + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up python ${{ matrix.python }} on ${{ matrix.os }} uses: actions/setup-python@v2 with: - python-version: '3.x' + python-version: ${{ matrix.python }} - name: Install base dependencies run: | python -m pip install --upgrade pip - python -m pip install tox - - name: Check codestyle using tox + python -m pip install tox codecov + - name: Test with tox run: | - tox -e codestyle + tox -e ${{ matrix.toxenv }} + # This is an example of how to upload coverage to codecov + - name: Upload coverage to codecov + if: "endsWith(matrix.toxenv, '-cov')" + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml From e7d866b01c49f6afb81491c3158b6f0080d88b33 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 16:51:08 -0700 Subject: [PATCH 16/34] remove more references to travis; add .vscode to .gitignore --- .gitignore | 3 ++ .travis-deploy.sh | 24 ----------- .travis.yml | 46 ---------------------- QUESTIONS.rst | 13 +++--- hooks/post_gen_project.py | 3 -- rendered.yml | 1 - {{ cookiecutter.package_name }}/.gitignore | 2 +- 7 files changed, 10 insertions(+), 82 deletions(-) delete mode 100644 .travis-deploy.sh delete mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index 869b1442..fe662b05 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ docs/_build # Pycharm editor project files .idea +# VS Code editor project files +.vscode/ + # Floobits project files .floo .flooignore diff --git a/.travis-deploy.sh b/.travis-deploy.sh deleted file mode 100644 index 152b432a..00000000 --- a/.travis-deploy.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -evax - -if [[ "${TRAVIS_PULL_REQUEST}" = "false" && "$TRAVIS_OS_NAME" = "linux" && $TASK = 'render' ]]; then - openssl aes-256-cbc -K $encrypted_c554857c6215_key -iv $encrypted_c554857c6215_iv -in github_deploy_key.enc -out ~/.ssh/publish-key -d - chmod u=rw,og= ~/.ssh/publish-key - echo "Host github.com" >> ~/.ssh/config - echo " IdentityFile ~/.ssh/publish-key" >> ~/.ssh/config - - base_dir=$(pwd) - - cd ../test/ - git clone git@github.com:astropy/package-template rendered - cd rendered - git --version - git config --global user.name "Travis CI" - git config --global user.email "travis@travis.ci" - git remote update - git checkout master - rsync -avz --delete --exclude .git/ ../packagename/ ./ - git add -A - git commit --allow-empty -m "Update rendered version to ""$TRAVIS_COMMIT" - git push origin master -fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 299bcccd..00000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: python - -os: - - linux - -python: 3.8 - -env: - global: - - # The following versions are the 'default' for tests, unless - # overridden underneath. They are defined here in order to save having - # to repeat them for all configurations. - - FOLDERNAME='packagename' - - TASK='test' - - EXTRA_CONTEXT='' - - FLAGS='' - - matrix: - # Extra context is a way to override options that the user normally - # specifies during the questions phase of the cookiecutter setup. The keys - # being overridden here must exist in the cookiecutter.json - # See https://cookiecutter.readthedocs.io/en/0.9.1/advanced_usage.html#injecting-extra-context - - EXTRA_CONTEXT='' - - EXTRA_CONTEXT='use_compiled_extensions=y include_example_code=y' - - EXTRA_CONTEXT="package_name=AstropyProject" FOLDERNAME='AstropyProject' - - EXTRA_CONTEXT='_parent_project=sunpy' - - EXTRA_CONTEXT='minimum_python_version=3.6' - - TASK='render' FLAGS='--config-file rendered.yml --no-input' EXTRA_CONTEXT='use_compiled_extensions=y include_example_code=y license=Other' - -install: - - pip install sphinx-astropy cookiecutter gitpython tox - -script: - - cd docs ; make html ; cd .. - - cookiecutter --no-input ./ -o ../test $EXTRA_CONTEXT $FLAGS - - cd ../test/$FOLDERNAME - - git init - - if [[ $TASK == 'test' ]]; then tox -e py38-test; fi - - if [[ $TASK == 'test' ]]; then tox -e build_docs; fi - - if [[ $TASK == 'test' ]]; then tox -e codestyle; fi - - -after_success: - - cd ../../package-template - - bash .travis-deploy.sh diff --git a/QUESTIONS.rst b/QUESTIONS.rst index f344d6a4..0dd23623 100644 --- a/QUESTIONS.rst +++ b/QUESTIONS.rst @@ -16,10 +16,9 @@ a description of each of the prompts. 9. ``use_compiled_extensions``: Whether you plan to use compiled extensions in your package 10. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. 11. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. -12. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service. -13. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. -14. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. -15. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. -16. ``required_dependencies``: Comma-separated list of required dependencies -17. ``optional_dependencies``: Comma-separated list of optional dependencies -18. ``minimum_python_version``: Version string of minimum supported Python version +12. ``use_gh_actions``: If ``'y'`` the template will include example files for the Github Actions CI service under ``.github/workflows`` . +13. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. +14. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. +15. ``required_dependencies``: Comma-separated list of required dependencies +16. ``optional_dependencies``: Comma-separated list of optional dependencies +17. ``minimum_python_version``: Version string of minimum supported Python version diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index c4e172a0..7e04ce48 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -39,9 +39,6 @@ def process_license(license_name): process_license('{{ cookiecutter.license }}') - if '{{ cookiecutter.use_travis_ci }}' != 'y': - remove_file('.travis.yml') - if '{{ cookiecutter.use_gh_actions }}' != 'y': remove_dir('.github') diff --git a/rendered.yml b/rendered.yml index c13cf7db..457fd05e 100644 --- a/rendered.yml +++ b/rendered.yml @@ -11,7 +11,6 @@ default_context: use_compiled_extensions: "y" edit_on_github_extension: "False" github_project: "astropy/astropy" - use_travis_ci: "y" use_gh_actions: "y" use_read_the_docs: "y" sphinx_theme: "astropy-bootstrap" diff --git a/{{ cookiecutter.package_name }}/.gitignore b/{{ cookiecutter.package_name }}/.gitignore index a557aba1..72767dda 100644 --- a/{{ cookiecutter.package_name }}/.gitignore +++ b/{{ cookiecutter.package_name }}/.gitignore @@ -34,7 +34,7 @@ docs/_build .flooignore # Visual Studio Code project files -.vscode +.vscode/ # Packages/installer info *.egg From 322683b1c5b9a6112b5243609fd9b5ce30b506a8 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 18:00:34 -0700 Subject: [PATCH 17/34] remove travis question from cookiecutter.json --- cookiecutter.json | 1 - 1 file changed, 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 4ea98696..4ef3514d 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -10,7 +10,6 @@ "include_example_code": "y", "edit_on_github_extension": "False", "github_project": "astropy/astropy", - "use_travis_ci": "y", "use_gh_actions": "y", "use_read_the_docs": "y", "sphinx_theme": "astropy-bootstrap", From 6e8ca55b535fc131b2fbec8f491608d5d32c6e69 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 18:12:16 -0700 Subject: [PATCH 18/34] Revert "remove more references to travis; add .vscode to .gitignore" This reverts commit e7d866b01c49f6afb81491c3158b6f0080d88b33. --- .gitignore | 3 -- .travis-deploy.sh | 24 +++++++++++ .travis.yml | 46 ++++++++++++++++++++++ QUESTIONS.rst | 13 +++--- hooks/post_gen_project.py | 3 ++ rendered.yml | 1 + {{ cookiecutter.package_name }}/.gitignore | 2 +- 7 files changed, 82 insertions(+), 10 deletions(-) create mode 100644 .travis-deploy.sh create mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index fe662b05..869b1442 100644 --- a/.gitignore +++ b/.gitignore @@ -30,9 +30,6 @@ docs/_build # Pycharm editor project files .idea -# VS Code editor project files -.vscode/ - # Floobits project files .floo .flooignore diff --git a/.travis-deploy.sh b/.travis-deploy.sh new file mode 100644 index 00000000..152b432a --- /dev/null +++ b/.travis-deploy.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -evax + +if [[ "${TRAVIS_PULL_REQUEST}" = "false" && "$TRAVIS_OS_NAME" = "linux" && $TASK = 'render' ]]; then + openssl aes-256-cbc -K $encrypted_c554857c6215_key -iv $encrypted_c554857c6215_iv -in github_deploy_key.enc -out ~/.ssh/publish-key -d + chmod u=rw,og= ~/.ssh/publish-key + echo "Host github.com" >> ~/.ssh/config + echo " IdentityFile ~/.ssh/publish-key" >> ~/.ssh/config + + base_dir=$(pwd) + + cd ../test/ + git clone git@github.com:astropy/package-template rendered + cd rendered + git --version + git config --global user.name "Travis CI" + git config --global user.email "travis@travis.ci" + git remote update + git checkout master + rsync -avz --delete --exclude .git/ ../packagename/ ./ + git add -A + git commit --allow-empty -m "Update rendered version to ""$TRAVIS_COMMIT" + git push origin master +fi diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..299bcccd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,46 @@ +language: python + +os: + - linux + +python: 3.8 + +env: + global: + + # The following versions are the 'default' for tests, unless + # overridden underneath. They are defined here in order to save having + # to repeat them for all configurations. + - FOLDERNAME='packagename' + - TASK='test' + - EXTRA_CONTEXT='' + - FLAGS='' + + matrix: + # Extra context is a way to override options that the user normally + # specifies during the questions phase of the cookiecutter setup. The keys + # being overridden here must exist in the cookiecutter.json + # See https://cookiecutter.readthedocs.io/en/0.9.1/advanced_usage.html#injecting-extra-context + - EXTRA_CONTEXT='' + - EXTRA_CONTEXT='use_compiled_extensions=y include_example_code=y' + - EXTRA_CONTEXT="package_name=AstropyProject" FOLDERNAME='AstropyProject' + - EXTRA_CONTEXT='_parent_project=sunpy' + - EXTRA_CONTEXT='minimum_python_version=3.6' + - TASK='render' FLAGS='--config-file rendered.yml --no-input' EXTRA_CONTEXT='use_compiled_extensions=y include_example_code=y license=Other' + +install: + - pip install sphinx-astropy cookiecutter gitpython tox + +script: + - cd docs ; make html ; cd .. + - cookiecutter --no-input ./ -o ../test $EXTRA_CONTEXT $FLAGS + - cd ../test/$FOLDERNAME + - git init + - if [[ $TASK == 'test' ]]; then tox -e py38-test; fi + - if [[ $TASK == 'test' ]]; then tox -e build_docs; fi + - if [[ $TASK == 'test' ]]; then tox -e codestyle; fi + + +after_success: + - cd ../../package-template + - bash .travis-deploy.sh diff --git a/QUESTIONS.rst b/QUESTIONS.rst index 0dd23623..f344d6a4 100644 --- a/QUESTIONS.rst +++ b/QUESTIONS.rst @@ -16,9 +16,10 @@ a description of each of the prompts. 9. ``use_compiled_extensions``: Whether you plan to use compiled extensions in your package 10. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. 11. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. -12. ``use_gh_actions``: If ``'y'`` the template will include example files for the Github Actions CI service under ``.github/workflows`` . -13. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. -14. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. -15. ``required_dependencies``: Comma-separated list of required dependencies -16. ``optional_dependencies``: Comma-separated list of optional dependencies -17. ``minimum_python_version``: Version string of minimum supported Python version +12. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service. +13. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. +14. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. +15. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. +16. ``required_dependencies``: Comma-separated list of required dependencies +17. ``optional_dependencies``: Comma-separated list of optional dependencies +18. ``minimum_python_version``: Version string of minimum supported Python version diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 7e04ce48..c4e172a0 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -39,6 +39,9 @@ def process_license(license_name): process_license('{{ cookiecutter.license }}') + if '{{ cookiecutter.use_travis_ci }}' != 'y': + remove_file('.travis.yml') + if '{{ cookiecutter.use_gh_actions }}' != 'y': remove_dir('.github') diff --git a/rendered.yml b/rendered.yml index 457fd05e..c13cf7db 100644 --- a/rendered.yml +++ b/rendered.yml @@ -11,6 +11,7 @@ default_context: use_compiled_extensions: "y" edit_on_github_extension: "False" github_project: "astropy/astropy" + use_travis_ci: "y" use_gh_actions: "y" use_read_the_docs: "y" sphinx_theme: "astropy-bootstrap" diff --git a/{{ cookiecutter.package_name }}/.gitignore b/{{ cookiecutter.package_name }}/.gitignore index 72767dda..a557aba1 100644 --- a/{{ cookiecutter.package_name }}/.gitignore +++ b/{{ cookiecutter.package_name }}/.gitignore @@ -34,7 +34,7 @@ docs/_build .flooignore # Visual Studio Code project files -.vscode/ +.vscode # Packages/installer info *.egg From c0e1aaf5ba5a020c819d8d15a08916a5bd38c535 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 18:38:02 -0700 Subject: [PATCH 19/34] remove reference to travis in QUESTIONS.rst --- QUESTIONS.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/QUESTIONS.rst b/QUESTIONS.rst index f344d6a4..3bf40155 100644 --- a/QUESTIONS.rst +++ b/QUESTIONS.rst @@ -16,10 +16,9 @@ a description of each of the prompts. 9. ``use_compiled_extensions``: Whether you plan to use compiled extensions in your package 10. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. 11. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. -12. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service. -13. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. -14. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. -15. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. -16. ``required_dependencies``: Comma-separated list of required dependencies -17. ``optional_dependencies``: Comma-separated list of optional dependencies -18. ``minimum_python_version``: Version string of minimum supported Python version +12. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. +13. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. +14. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. +15. ``required_dependencies``: Comma-separated list of required dependencies +16. ``optional_dependencies``: Comma-separated list of optional dependencies +17. ``minimum_python_version``: Version string of minimum supported Python version From 95675a975cdb316b6ed8b2591da5cfa3c50fb021 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 18:38:25 -0700 Subject: [PATCH 20/34] remove reference to travis in rendered.yml --- rendered.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/rendered.yml b/rendered.yml index c13cf7db..457fd05e 100644 --- a/rendered.yml +++ b/rendered.yml @@ -11,7 +11,6 @@ default_context: use_compiled_extensions: "y" edit_on_github_extension: "False" github_project: "astropy/astropy" - use_travis_ci: "y" use_gh_actions: "y" use_read_the_docs: "y" sphinx_theme: "astropy-bootstrap" From 026de85ad10c7b6a42b93fd7330d385eae87ed44 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 18:39:11 -0700 Subject: [PATCH 21/34] comment out section for uploading to codecov in the default workflow template --- .../.github/workflows/ci_tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml index c80e0232..17237354 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml @@ -72,8 +72,8 @@ jobs: run: | tox -e ${{ matrix.toxenv }} # This is an example of how to upload coverage to codecov - - name: Upload coverage to codecov - if: "endsWith(matrix.toxenv, '-cov')" - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml + # - name: Upload coverage to codecov + # if: "endsWith(matrix.toxenv, '-cov')" + # uses: codecov/codecov-action@v1 + # with: + # file: ./coverage.xml From 8497d535c988fe70f058cd71007952a05bae40f8 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 18:39:47 -0700 Subject: [PATCH 22/34] expunge travis bit in post_gen_project.py --- hooks/post_gen_project.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index c4e172a0..7e04ce48 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -39,9 +39,6 @@ def process_license(license_name): process_license('{{ cookiecutter.license }}') - if '{{ cookiecutter.use_travis_ci }}' != 'y': - remove_file('.travis.yml') - if '{{ cookiecutter.use_gh_actions }}' != 'y': remove_dir('.github') From fa6fa76d06602fb94ed43fe010f649bb1ee1b923 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Mon, 16 Nov 2020 18:40:16 -0700 Subject: [PATCH 23/34] update docs to reflect the move from travis to github actions as the default choice for CI --- docs/ape17.rst | 9 ++++----- docs/nextsteps.rst | 43 +++++++++++++++++++------------------------ docs/options.rst | 1 - 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/docs/ape17.rst b/docs/ape17.rst index 17f6f078..daf44d3b 100644 --- a/docs/ape17.rst +++ b/docs/ape17.rst @@ -496,11 +496,10 @@ recommended approach is to use the tox file to set up the different configurations you want to use, and to then keep the CI configuration as simple as possible. -If you use Travis CI, a good place to start is the ``.travis.yml`` file -generated in :ref:`Step 0 `, and you can then see if any previous customizations you had -made need to be copied over. This file shows how one can configure Travis to use -tox, optionally using conda via ci-helpers to set up Python on MacOS X and -Windows. +Github now has an integrated CI service, Github Actions. If you wish to use Actions, a good place to start +is the ``.github/workflows/ci_tests.yml`` file generated in :ref:`Step 0 `. You can then +see if any previous customizations you had made need to be copied over. This file shows how one can configure +Actions to use tox to test different environments with different versions of python on different platforms. Step 14 - Update ReadTheDocs configuration ------------------------------------------ diff --git a/docs/nextsteps.rst b/docs/nextsteps.rst index 2ebfa644..66cd1289 100644 --- a/docs/nextsteps.rst +++ b/docs/nextsteps.rst @@ -15,37 +15,32 @@ Setting Up Continuous Integration `Continuous Integration `__ (CI) -services, like Travis CI, continuously test your package -for each commit. Every pull requests against your main repository will be -automatically tested, and failing tests will be flagged by these services. - -Travis CI -######### - -You should register your package on https://travis-ci.org and modify the -``.travis.yml`` file to your needs. The default ``.travis.yml`` file contains a -large number of builds, against various versions of Python, Astropy, and -numpy, and you should choose the ones relevant to your project. Full documentation -of the ``.travis.yml`` file can be found on the -`Travis CI `__ website. - -There are many `example build configuations -`__ for -``.travis.yml``. Generally you should aim to always have your ``master`` branch +services continuously test your package +for each commit. Every pull request against your main repository will be +automatically tested and failing tests will be flagged by these services. + +Github Actions +############## + +Github now provides an integrated CI service called `Github Actions `__. +The default workflows in ``.github/workflows`` show how to set up perform integration testing +upon every push or pull request, ``ci_tests.yml``, and how to run scheduled tests via cron, ``ci_cron_weekly.yml``. +The default ``ci_tests.yml`` file contains a large number of builds against various versions of Python, astropy, and +numpy, and you should choose the ones relevant to your project. Generally you should aim to always have your ``master`` branch work with the latest stable and latest development version of astropy (i.e. the astropy git master branch) and the same versions of python and numpy supported -by astropy. The template ``.travis.yml`` covers those versions; in some +by astropy. The template ``ci_tests.yml`` covers those versions; in some circumstances you may need to limit the versions your package covers. -Coveralls -######### +Codecov +####### -Coveralls is a web interface to monitoring what lines of code in your project +Codecov is a web interface to monitoring what lines of code in your project are executed by your test suite. -If you register your package with `coveralls.io `_, you -will need to uncomment the coveralls line in the ``.travis.yml`` file to enable -upload of your coverage statistics to coveralls. +If you register your package with `codecov.io `_, you +will need to uncomment the codecov section in the ``ci_tests.yml`` file under +``.github/workflows`` to enable upload of your coverage statistics to codecov. Read the Docs ############# diff --git a/docs/options.rst b/docs/options.rst index 335496e3..54fd8e33 100644 --- a/docs/options.rst +++ b/docs/options.rst @@ -18,7 +18,6 @@ a description of each of the prompts: #. ``use_compiled_extensions``: Whether you plan to use compiled extensions in your package #. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. #. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. -#. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service. #. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. #. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. #. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. From 677370c719fe8fd34cd14d82792c94c840d42dc8 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 11:55:01 -0700 Subject: [PATCH 24/34] bump supported python versions up a notch. include 3.9 for future-proofing. --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 4ef3514d..f4da4e47 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -16,7 +16,7 @@ "_parent_project": "astropy", "required_dependencies": "astropy", "optional_dependencies": "", - "minimum_python_version": ["3.6", "3.7", "3.8"], + "minimum_python_version": ["3.7", "3.8", "3.9"], "_copy_without_render": [ ".github" ] From da62bd18e44e40fb50405968d2423bce3369b89d Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 11:55:30 -0700 Subject: [PATCH 25/34] fix typos in ape17.rst --- docs/ape17.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ape17.rst b/docs/ape17.rst index daf44d3b..06cca9b4 100644 --- a/docs/ape17.rst +++ b/docs/ape17.rst @@ -496,7 +496,7 @@ recommended approach is to use the tox file to set up the different configurations you want to use, and to then keep the CI configuration as simple as possible. -Github now has an integrated CI service, Github Actions. If you wish to use Actions, a good place to start +GitHub now has an integrated CI service, GitHub Actions. If you wish to use Actions, a good place to start is the ``.github/workflows/ci_tests.yml`` file generated in :ref:`Step 0 `. You can then see if any previous customizations you had made need to be copied over. This file shows how one can configure Actions to use tox to test different environments with different versions of python on different platforms. From d92e94d514e2c8337d3c440099a49191ef2323b0 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 11:56:01 -0700 Subject: [PATCH 26/34] fix typos in nextsteps.rst --- docs/nextsteps.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/nextsteps.rst b/docs/nextsteps.rst index 66cd1289..780ad7ff 100644 --- a/docs/nextsteps.rst +++ b/docs/nextsteps.rst @@ -23,10 +23,10 @@ Github Actions ############## Github now provides an integrated CI service called `Github Actions `__. -The default workflows in ``.github/workflows`` show how to set up perform integration testing +The default workflows in ``.github/workflows`` show how to set up integration testing upon every push or pull request, ``ci_tests.yml``, and how to run scheduled tests via cron, ``ci_cron_weekly.yml``. The default ``ci_tests.yml`` file contains a large number of builds against various versions of Python, astropy, and -numpy, and you should choose the ones relevant to your project. Generally you should aim to always have your ``master`` branch +numpy, and you should choose the ones relevant to your project. Generally, you should aim to always have your ``master`` branch work with the latest stable and latest development version of astropy (i.e. the astropy git master branch) and the same versions of python and numpy supported by astropy. The template ``ci_tests.yml`` covers those versions; in some From f5fde9ec9ecba53fbd4f42226554777b79749b02 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 11:56:35 -0700 Subject: [PATCH 27/34] fix post_gen_project.py to only remove the template workflows --- hooks/post_gen_project.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 7e04ce48..da80cfc6 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -40,7 +40,8 @@ def process_license(license_name): process_license('{{ cookiecutter.license }}') if '{{ cookiecutter.use_gh_actions }}' != 'y': - remove_dir('.github') + remove_file('.github/workflows/ci_tests.yml') + remove_file('.github/workflows/ci_cron_weekly.yml') if '{{ cookiecutter.use_read_the_docs }}' != 'y': remove_file('.rtd-environment.yml') From 40833b39853702529968782178c5ac8fd852672d Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 11:57:31 -0700 Subject: [PATCH 28/34] include fix from astropy/astropy#11054 to prevent double-runs when PRs are opened --- .../.github/workflows/ci_tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml index 17237354..dd434c98 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml @@ -4,7 +4,12 @@ name: CI Tests -on: [push, pull_request] +on: + push: + branches: + - master + tags: + pull_request: jobs: # Github Actions supports ubuntu, windows, and macos virtual environments: From 7caea3c2f06822e9fa43490b765aad2410e9c867 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 14:00:13 -0700 Subject: [PATCH 29/34] change coverage step to use contains instead of endsWith --- {{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml index dd434c98..81ef1439 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml @@ -78,7 +78,7 @@ jobs: tox -e ${{ matrix.toxenv }} # This is an example of how to upload coverage to codecov # - name: Upload coverage to codecov - # if: "endsWith(matrix.toxenv, '-cov')" + # if: "contains(matrix.toxenv, '-cov')" # uses: codecov/codecov-action@v1 # with: # file: ./coverage.xml From 2fc7f51b57877ff7ef0a2824a88e72e61cf76514 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 14:10:27 -0700 Subject: [PATCH 30/34] change master to main to reflect new github default; add commented bits to ci workflow to show how to run CI based on pushed tags and how to limit it to PRs against specific branches --- .../.github/workflows/ci_tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml index 81ef1439..01dfafd4 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml @@ -7,9 +7,11 @@ name: CI Tests on: push: branches: - - master - tags: + - main + # tags: # run CI if specific tags are pushed pull_request: + # branches: # only build on PRs against main if you need to further limit when CI is run + # - main jobs: # Github Actions supports ubuntu, windows, and macos virtual environments: From 3b016ecb7067923ecb8689ceb79d301f24219b99 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 16:08:43 -0700 Subject: [PATCH 31/34] more changes to reflect github's change to main as the default branch name --- docs/nextsteps.rst | 4 ++-- docs/updating.rst | 2 +- {{ cookiecutter.package_name }}/docs/conf.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/nextsteps.rst b/docs/nextsteps.rst index 780ad7ff..131be4fe 100644 --- a/docs/nextsteps.rst +++ b/docs/nextsteps.rst @@ -26,8 +26,8 @@ Github now provides an integrated CI service called `Github Actions Date: Tue, 17 Nov 2020 16:54:06 -0700 Subject: [PATCH 32/34] add PR number for migration away from travis in template --- TEMPLATE_CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TEMPLATE_CHANGES.md b/TEMPLATE_CHANGES.md index e2c72141..83b9aefc 100644 --- a/TEMPLATE_CHANGES.md +++ b/TEMPLATE_CHANGES.md @@ -18,7 +18,7 @@ be copied over manually if desired. - Refactored the template to follow the recommendations in APE 17: https://github.com/astropy/astropy-APEs/blob/master/APE17.rst [#438] -- Switch to using Github Actions for CI; remove Travis config. +- Switch to using Github Actions for CI; remove Travis config. [#449] - Added cron job for RST link checking [#482] From 88a818e498db8181e3a6173fb1b02f1bedbaf9a5 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 16:54:35 -0700 Subject: [PATCH 33/34] flesh out some comments in the ci_tests.yml workflow --- .../.github/workflows/ci_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml index 01dfafd4..a3029030 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci_tests.yml @@ -7,10 +7,10 @@ name: CI Tests on: push: branches: - - main + - main # GitHub now defaults to 'main' as the name of the primary branch. Change this as needed. # tags: # run CI if specific tags are pushed pull_request: - # branches: # only build on PRs against main if you need to further limit when CI is run + # branches: # only build on PRs against 'main' if you need to further limit when CI is run. # - main jobs: From fd8a4d376b6f43ff9da4be5b0aadf30cd81593ae Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Tue, 17 Nov 2020 18:33:49 -0700 Subject: [PATCH 34/34] fix some grammer and spelling --- QUESTIONS.rst | 2 +- TEMPLATE_CHANGES.md | 4 ++-- docs/ape17.rst | 2 +- docs/nextsteps.rst | 6 +++--- docs/options.rst | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/QUESTIONS.rst b/QUESTIONS.rst index 3bf40155..c0cfe118 100644 --- a/QUESTIONS.rst +++ b/QUESTIONS.rst @@ -16,7 +16,7 @@ a description of each of the prompts. 9. ``use_compiled_extensions``: Whether you plan to use compiled extensions in your package 10. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. 11. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. -12. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. +12. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the GitHub Actions CI service. 13. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. 14. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. 15. ``required_dependencies``: Comma-separated list of required dependencies diff --git a/TEMPLATE_CHANGES.md b/TEMPLATE_CHANGES.md index 83b9aefc..a8469064 100644 --- a/TEMPLATE_CHANGES.md +++ b/TEMPLATE_CHANGES.md @@ -13,12 +13,12 @@ be copied over manually if desired. - Moved as much as possible of the setup.py configuration to setup.cfg, and now require setuptools>=30.3. [#375] -- Removed Appveyor CI option. Use ``os: windows-latest`` in Github Actions. [#420] +- Removed Appveyor CI option. Use ``os: windows-latest`` in GitHub Actions. [#420] - Refactored the template to follow the recommendations in APE 17: https://github.com/astropy/astropy-APEs/blob/master/APE17.rst [#438] -- Switch to using Github Actions for CI; remove Travis config. [#449] +- Switch to using GitHub Actions for CI; remove Travis config. [#449] - Added cron job for RST link checking [#482] diff --git a/docs/ape17.rst b/docs/ape17.rst index 06cca9b4..358e10ea 100644 --- a/docs/ape17.rst +++ b/docs/ape17.rst @@ -499,7 +499,7 @@ as possible. GitHub now has an integrated CI service, GitHub Actions. If you wish to use Actions, a good place to start is the ``.github/workflows/ci_tests.yml`` file generated in :ref:`Step 0 `. You can then see if any previous customizations you had made need to be copied over. This file shows how one can configure -Actions to use tox to test different environments with different versions of python on different platforms. +Actions to use tox to test different environments with different versions of Python on different platforms. Step 14 - Update ReadTheDocs configuration ------------------------------------------ diff --git a/docs/nextsteps.rst b/docs/nextsteps.rst index 131be4fe..5fdf88b4 100644 --- a/docs/nextsteps.rst +++ b/docs/nextsteps.rst @@ -19,15 +19,15 @@ services continuously test your package for each commit. Every pull request against your main repository will be automatically tested and failing tests will be flagged by these services. -Github Actions +GitHub Actions ############## -Github now provides an integrated CI service called `Github Actions `__. +GitHub now provides an integrated CI service called `GitHub Actions `__. The default workflows in ``.github/workflows`` show how to set up integration testing upon every push or pull request, ``ci_tests.yml``, and how to run scheduled tests via cron, ``ci_cron_weekly.yml``. The default ``ci_tests.yml`` file contains a large number of builds against various versions of Python, astropy, and numpy, and you should choose the ones relevant to your project. Generally, you should aim to always have your -``main`` branch work with the latest stable and latest development version of astropy (i.e. the +``main`` branch work with the latest stable and latest development version of astropy (i.e., the astropy git master branch) and the same versions of python and numpy supported by astropy. The template ``ci_tests.yml`` covers those versions; in some circumstances you may need to limit the versions your package covers. diff --git a/docs/options.rst b/docs/options.rst index 54fd8e33..c6dcd8bf 100644 --- a/docs/options.rst +++ b/docs/options.rst @@ -18,7 +18,7 @@ a description of each of the prompts: #. ``use_compiled_extensions``: Whether you plan to use compiled extensions in your package #. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension. #. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension. -#. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the Github Actions CI service. +#. ``use_gh_actions``: If ``'y'`` the template will include an example ``.github/workflows/tox-tests.yml`` file for the GitHub Actions CI service. #. ``use_read_the_docs``: If ``'y'`` the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs. #. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file. #. ``required_dependencies``: Comma-separated list of required dependencies