From 7f9ea692672cf4239e3b4f354a7d9d65b54cf7ec Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Sat, 11 Sep 2021 11:41:18 -0600 Subject: [PATCH 01/23] add pytest workflow --- .github/workflows/pytest.yml | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000000..ca85dd9766 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,70 @@ +name: pytest + +on: [pull_request, push] + +jobs: + test: + env: + VERSIONMAP: '{"3.6": "36", "3.7": "37", "3.8": "38", "3.9": "39"}' + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + environment-type: [conda, bare] + suffix: [''] + include: + - os: ubuntu-latest + python-version: 3.6 + environment-type: conda + suffix: -min + exclude: + - os: macos-latest + environment-type: conda + - os: windows-latest + environment-type: bare + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }}${{ matrix.suffix }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up conda environment + if: matrix.environment-type == 'conda' + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + environment-file: ${{ env.REQUIREMENTS }} + python-version: ${{ matrix.python-version }} + auto-activate-base: false + env: + REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml + + - name: Create bare environment + if: matrix.environment-type == 'bare' + env: + REQUIREMENTS: pip install pytest pytest-cov pytest-mock requests-mock pytest-timeout pytest-rerunfailures pytest-remotedata + run: | + pip install $REQUIREMENTS + pip install . + + - name: Run tests + shell: bash -l {0} # necessary for conda env to be active + env: + ARGS: "${{ (matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda') && '--remote-data' || '' }}" + NREL_API_KEY: ${{ secrets.NREL_API_KEY }} + BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} + BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} + run: pytest pvlib --cov=./ --cov-report=xml $ARGS + + # - name: Upload coverage to Codecov + # if: matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' + # uses: codecov/codecov-action@v2 + # with: + # directory: ./coverage/reports/ + # fail_ci_if_error: true + # verbose: true From aa4cc95841da18a146476c88b49eed30358f10e8 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Sat, 11 Sep 2021 11:57:43 -0600 Subject: [PATCH 02/23] add some comments --- .github/workflows/pytest.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ca85dd9766..e5c67d53b6 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -5,13 +5,17 @@ on: [pull_request, push] jobs: test: env: + # we need to turn "3.6" into 36 to build the conda requirement filename, + # but there's no good way to do that via string manipulation. So set up + # a map that will be parsed as JSON later: VERSIONMAP: '{"3.6": "36", "3.7": "37", "3.8": "38", "3.9": "39"}' + strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] environment-type: [conda, bare] - suffix: [''] + suffix: [''] # placeholder as an alternative to "-min" include: - os: ubuntu-latest python-version: 3.6 @@ -42,6 +46,8 @@ jobs: python-version: ${{ matrix.python-version }} auto-activate-base: false env: + # build requirement filename. First replacement is for the python + # version, mapping from "3.7" to "37", second is to add "-min" if needed REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml - name: Create bare environment @@ -55,6 +61,7 @@ jobs: - name: Run tests shell: bash -l {0} # necessary for conda env to be active env: + # we want --remote-data only on conda+linux, so use this short-circuiting logic: ARGS: "${{ (matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda') && '--remote-data' || '' }}" NREL_API_KEY: ${{ secrets.NREL_API_KEY }} BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} From cc993b1c41db039f007e4ab94451e06a8072834b Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 14 Sep 2021 12:39:35 -0600 Subject: [PATCH 03/23] set fail-fast to false --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e5c67d53b6..cae38b0f23 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -11,6 +11,7 @@ jobs: VERSIONMAP: '{"3.6": "36", "3.7": "37", "3.8": "38", "3.9": "39"}' strategy: + fail-fast: false # don't cancel other matrix jobs when one fails matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] From e691532b2f6b330f727025122d730c46f31b136a Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 6 Oct 2021 12:46:11 -0600 Subject: [PATCH 04/23] see if secrets work --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index cae38b0f23..1cb2884fe3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -54,7 +54,7 @@ jobs: - name: Create bare environment if: matrix.environment-type == 'bare' env: - REQUIREMENTS: pip install pytest pytest-cov pytest-mock requests-mock pytest-timeout pytest-rerunfailures pytest-remotedata + REQUIREMENTS: pytest pytest-cov pytest-mock requests-mock pytest-timeout pytest-rerunfailures pytest-remotedata run: | pip install $REQUIREMENTS pip install . @@ -64,7 +64,7 @@ jobs: env: # we want --remote-data only on conda+linux, so use this short-circuiting logic: ARGS: "${{ (matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda') && '--remote-data' || '' }}" - NREL_API_KEY: ${{ secrets.NREL_API_KEY }} + NREL_API_KEY: ${{ secrets.NRELAPIKEY }} BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} run: pytest pvlib --cov=./ --cov-report=xml $ARGS From 99446a02e5efa8273439f88aa31683fcaec69d5d Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 11 Oct 2021 17:21:43 -0600 Subject: [PATCH 05/23] move --remote-data tests to other workflow --- .github/workflows/pytest-remote-data.yml | 66 ++++++++++++++++++++++++ .github/workflows/pytest.yml | 5 +- 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pytest-remote-data.yml diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml new file mode 100644 index 0000000000..3add2548a3 --- /dev/null +++ b/.github/workflows/pytest-remote-data.yml @@ -0,0 +1,66 @@ +name: pytest-remote-data + +on: + pull_request_target: + types: [labeled] + +jobs: + test: + env: + # we need to turn "3.6" into 36 to build the conda requirement filename, + # but there's no good way to do that via string manipulation. So set up + # a map that will be parsed as JSON later: + VERSIONMAP: '{"3.6": "36", "3.7": "37", "3.8": "38", "3.9": "39"}' + + strategy: + fail-fast: false # don't cancel other matrix jobs when one fails + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + suffix: [''] # placeholder as an alternative to "-min" + include: + - python-version: 3.6 + suffix: -min + + runs-on: ubuntu-latest + if: contains(github.event.pull_request.labels.*.name, 'remote-data') + + steps: + - uses: actions/checkout@v2 + # pull_request_target runs in the context of the target branch (pvlib/master), not the + # PR head, so specify the PR head explicitly: + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Python ${{ matrix.python-version }}${{ matrix.suffix }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up conda environment + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + environment-file: ${{ env.REQUIREMENTS }} + python-version: ${{ matrix.python-version }} + auto-activate-base: false + env: + # build requirement filename. First replacement is for the python + # version, mapping from "3.7" to "37", second is to add "-min" if needed + REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml + + - name: Run tests + shell: bash -l {0} # necessary for conda env to be active + env: + # copy GitHub Secrets into environment variables for the tests to access + NREL_API_KEY: ${{ secrets.NRELAPIKEY }} + BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} + BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} + run: pytest pvlib --cov=./ --cov-report=xml --remote-data + + # - name: Upload coverage to Codecov + # if: matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' + # uses: codecov/codecov-action@v2 + # with: + # directory: ./coverage/reports/ + # fail_ci_if_error: true + # verbose: true diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1cb2884fe3..d1c49f39b2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -62,12 +62,11 @@ jobs: - name: Run tests shell: bash -l {0} # necessary for conda env to be active env: - # we want --remote-data only on conda+linux, so use this short-circuiting logic: - ARGS: "${{ (matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda') && '--remote-data' || '' }}" + # copy GitHub Secrets into environment variables for the tests to access NREL_API_KEY: ${{ secrets.NRELAPIKEY }} BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} - run: pytest pvlib --cov=./ --cov-report=xml $ARGS + run: pytest pvlib --cov=./ --cov-report=xml # - name: Upload coverage to Codecov # if: matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' From 9463f0b33d24ebd80946f9f9251639d31f2793c4 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Fri, 29 Oct 2021 14:53:22 -0600 Subject: [PATCH 06/23] remove secrets from default pytest workflow --- .github/workflows/pytest.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d1c49f39b2..87587e5894 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -61,11 +61,6 @@ jobs: - name: Run tests shell: bash -l {0} # necessary for conda env to be active - env: - # copy GitHub Secrets into environment variables for the tests to access - NREL_API_KEY: ${{ secrets.NRELAPIKEY }} - BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} - BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} run: pytest pvlib --cov=./ --cov-report=xml # - name: Upload coverage to Codecov From 584f1344d833677e017e9ff75f3def44d99a0b46 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Fri, 29 Oct 2021 14:57:00 -0600 Subject: [PATCH 07/23] simplify bare environment installation --- .github/workflows/pytest.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 87587e5894..a98bc7fb9a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -53,11 +53,8 @@ jobs: - name: Create bare environment if: matrix.environment-type == 'bare' - env: - REQUIREMENTS: pytest pytest-cov pytest-mock requests-mock pytest-timeout pytest-rerunfailures pytest-remotedata run: | - pip install $REQUIREMENTS - pip install . + pip install .[test] - name: Run tests shell: bash -l {0} # necessary for conda env to be active From 4c2e755611ea7dfc35e969c735011fccc7eb0e88 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 18 Apr 2022 10:51:43 -0400 Subject: [PATCH 08/23] simplify --- .github/workflows/pytest-remote-data.yml | 8 +++----- .github/workflows/pytest.yml | 10 ++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 3add2548a3..a2e13dabd9 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -1,6 +1,9 @@ name: pytest-remote-data on: + # use pull_request_target, in combination with the `remote-data` label (below) + # so that we can access repository secrets. + # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ pull_request_target: types: [labeled] @@ -31,11 +34,6 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - name: Set up Python ${{ matrix.python-version }}${{ matrix.suffix }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Set up conda environment uses: conda-incubator/setup-miniconda@v2 with: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a98bc7fb9a..6d28420564 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -33,11 +33,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }}${{ matrix.suffix }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Set up conda environment if: matrix.environment-type == 'conda' uses: conda-incubator/setup-miniconda@v2 @@ -51,8 +46,11 @@ jobs: # version, mapping from "3.7" to "37", second is to add "-min" if needed REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml - - name: Create bare environment + - name: Set up bare Python ${{ matrix.python-version }}${{ matrix.suffix }} environment if: matrix.environment-type == 'bare' + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} run: | pip install .[test] From 23416dca366900ed2100f2ad439ddefc3feedd87 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 18 Apr 2022 11:08:58 -0400 Subject: [PATCH 09/23] un-simplify --- .github/workflows/pytest.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6d28420564..d2e06b8a87 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -46,13 +46,16 @@ jobs: # version, mapping from "3.7" to "37", second is to add "-min" if needed REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml - - name: Set up bare Python ${{ matrix.python-version }}${{ matrix.suffix }} environment + - name: Install Python ${{ matrix.python-version }}${{ matrix.suffix }} if: matrix.environment-type == 'bare' uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - run: | - pip install .[test] + + - name: Set up bare environment + if: matrix.environment-type == 'bare' + shell: bash -l {0} # necessary for conda env to be active + run: pip install .[test] - name: Run tests shell: bash -l {0} # necessary for conda env to be active From 7846f0e894d76456cb943326f51997f7975072d1 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 18 Apr 2022 11:13:50 -0400 Subject: [PATCH 10/23] thrashing around the "debug the CI" morass --- .github/workflows/pytest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d2e06b8a87..0c0ebc10e0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -54,7 +54,6 @@ jobs: - name: Set up bare environment if: matrix.environment-type == 'bare' - shell: bash -l {0} # necessary for conda env to be active run: pip install .[test] - name: Run tests From 2e6eda3856c0ee15a47e86f0fb3f0dcca6fd626f Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 18 Apr 2022 14:23:11 -0400 Subject: [PATCH 11/23] fix macos py3.6 --- .github/workflows/pytest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0c0ebc10e0..3f5575a611 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,7 +13,8 @@ jobs: strategy: fail-fast: false # don't cancel other matrix jobs when one fails matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # use macos-10.15 instead of macos-latest for py3.6 support + os: [ubuntu-latest, macos-10.15, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] environment-type: [conda, bare] suffix: [''] # placeholder as an alternative to "-min" From 3d4f0f77ea5f7a5360c486342055b29148602144 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 18 Apr 2022 15:52:47 -0400 Subject: [PATCH 12/23] disable codecov upload in azure pipelines --- ci/azure/conda_linux.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/azure/conda_linux.yml b/ci/azure/conda_linux.yml index 3bf8215cc4..d907e03b4d 100644 --- a/ci/azure/conda_linux.yml +++ b/ci/azure/conda_linux.yml @@ -13,7 +13,6 @@ jobs: suffix: '-min' Python36: python.version: '36' - coverage: true Python37: python.version: '37' Python38: From d5bac80c959b1884d5eabe2a5fb4a1983144f630 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 18 Apr 2022 19:44:24 -0400 Subject: [PATCH 13/23] enable codecov in github actions --- .coveragerc | 8 +++++++- .github/workflows/pytest-remote-data.yml | 22 +++++++++++----------- .github/workflows/pytest.yml | 18 ++++++++++-------- codecov.yml | 6 ++++++ 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/.coveragerc b/.coveragerc index 9e7e885ab3..1a19e675e1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,8 @@ [run] -omit = pvlib/_version.py \ No newline at end of file +# NOTE: the github action jobs in pvlib-python/.github/workflows +# add entries to this `omit` list to calculate test coverage separately +# for the iotools subpackage. +# If changing this file, make sure it does not break that integration. +omit = + pvlib/_version.py + #pvlib/iotools/* diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index a2e13dabd9..7171b548aa 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -29,10 +29,10 @@ jobs: steps: - uses: actions/checkout@v2 - # pull_request_target runs in the context of the target branch (pvlib/master), not the - # PR head, so specify the PR head explicitly: + # pull_request_target runs in the context of the target branch (pvlib/master), + # but what we need is the hypothetical merge commit: with: - ref: ${{ github.event.pull_request.head.sha }} + ref: "refs/pull/${{ github.event.number }}/merge" - name: Set up conda environment uses: conda-incubator/setup-miniconda@v2 @@ -53,12 +53,12 @@ jobs: NREL_API_KEY: ${{ secrets.NRELAPIKEY }} BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} - run: pytest pvlib --cov=./ --cov-report=xml --remote-data + run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data - # - name: Upload coverage to Codecov - # if: matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' - # uses: codecov/codecov-action@v2 - # with: - # directory: ./coverage/reports/ - # fail_ci_if_error: true - # verbose: true + - name: Upload coverage to Codecov + if: matrix.python-version == 3.9 + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true + verbose: true + flags: iotools # flags are configured in codecov.yml \ No newline at end of file diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3f5575a611..414844b055 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -59,12 +59,14 @@ jobs: - name: Run tests shell: bash -l {0} # necessary for conda env to be active - run: pytest pvlib --cov=./ --cov-report=xml + run: | + sed -i '/iotools/s/#//' .coveragerc # don't include pvlib.iotools in coverage + pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools - # - name: Upload coverage to Codecov - # if: matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' - # uses: codecov/codecov-action@v2 - # with: - # directory: ./coverage/reports/ - # fail_ci_if_error: true - # verbose: true + - name: Upload coverage to Codecov + if: matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true + verbose: true + flags: core # flags are configured in codecov.yml \ No newline at end of file diff --git a/codecov.yml b/codecov.yml index dbcb6f075f..c85a3edcfd 100644 --- a/codecov.yml +++ b/codecov.yml @@ -25,3 +25,9 @@ coverage: - "pvlib/tests/.*" comment: off + +# "flags" are used to identify subsets of the overall codebase when calculating coverage. +# Currently used for "iotools" (just pvlib.iotools) and "core" (everything else) +# https://docs.codecov.com/docs/flags#recommended-automatic-flag-management +flag_management: + default_rules: From 7ec9f65b09e7cac2733eab24755f0a27b2c78ff2 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Mon, 18 Apr 2022 19:57:44 -0400 Subject: [PATCH 14/23] fix janky coverage hack --- .coveragerc | 2 +- .github/workflows/pytest.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index 1a19e675e1..8cc7facffc 100644 --- a/.coveragerc +++ b/.coveragerc @@ -5,4 +5,4 @@ # If changing this file, make sure it does not break that integration. omit = pvlib/_version.py - #pvlib/iotools/* + #pvlib/iotools/* diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 414844b055..1764d1b824 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -60,7 +60,7 @@ jobs: - name: Run tests shell: bash -l {0} # necessary for conda env to be active run: | - sed -i '/iotools/s/#//' .coveragerc # don't include pvlib.iotools in coverage + sed -i '/#pvlib\/iotools/s/#//' .coveragerc # don't include pvlib.iotools in coverage pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools - name: Upload coverage to Codecov From 829830819d8f5f0133d7586491b51cc59cda4426 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 20 Apr 2022 11:14:54 -0400 Subject: [PATCH 15/23] undo unnecessary changes to .coveragerc --- .coveragerc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.coveragerc b/.coveragerc index 8cc7facffc..9e7e885ab3 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,8 +1,2 @@ [run] -# NOTE: the github action jobs in pvlib-python/.github/workflows -# add entries to this `omit` list to calculate test coverage separately -# for the iotools subpackage. -# If changing this file, make sure it does not break that integration. -omit = - pvlib/_version.py - #pvlib/iotools/* +omit = pvlib/_version.py \ No newline at end of file From fef33d5061c394ba9e3f6496b359c66bba3d973b Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 20 Apr 2022 14:52:49 -0400 Subject: [PATCH 16/23] add label reminder to PR template --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f716995416..15a3856159 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,6 +7,6 @@ - [ ] Adds description and name entries in the appropriate "what's new" file in [`docs/sphinx/source/whatsnew`](https://github.com/pvlib/pvlib-python/tree/master/docs/sphinx/source/whatsnew) for all changes. Includes link to the GitHub Issue with `` :issue:`num` `` or this Pull Request with `` :pull:`num` ``. Includes contributor name and/or GitHub username (link with `` :ghuser:`user` ``). - [ ] New code is fully documented. Includes [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) compliant docstrings, examples, and comments where necessary. - [ ] Pull request is nearly complete and ready for detailed review. - - [ ] Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue. + - [ ] Maintainer: Appropriate GitHub Labels (including `remote-data`) and Milestone are assigned to the Pull Request and linked Issue. From e50b3106dbac01014cdb3b9c967580e1bb0b2543 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Sun, 12 Jun 2022 14:22:00 -0400 Subject: [PATCH 17/23] rework workflows and codecov --- .github/workflows/pytest-remote-data.yml | 69 ++++++++++++++++++++--- .github/workflows/pytest.yml | 21 ++++--- codecov.yml | 72 ++++++++++++++++++------ 3 files changed, 128 insertions(+), 34 deletions(-) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 7171b548aa..257823e234 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -1,11 +1,54 @@ +# A secondary test job that only runs the iotools tests if explicitly requested +# (for pull requests) or on a push to the master branch. +# Because the iotools tests require GitHub secrets, we need to be careful about +# malicious PRs accessing the secrets and exposing them externally. +# +# We prevent this by only running this workflow when a maintainer has looked +# over the PR's diff and verified that nothing malicious seems to be going on. +# The maintainer then adds the "remote-data" label to the PR, which will then +# trigger this workflow via the combination of the "on: ... types:" +# and "if:" sections below. The first restricts the workflow to only run when +# a label is added to the PR and the second requires one of the PR's labels +# is the "remote-data" label. Technically this is slightly different from +# triggering when the "remote-data" label is added, since it will also trigger +# when "remote-data" is added, then later some other label is added. Maybe +# there's a better way to do this. +# +# But wait, you say! Can't a malicious PR get around this by modifying +# this workflow file and removing the label requirement? I think the answer +# is "no" as long as we trigger the workflow on "pull_request_target" instead +# of the usual "pull_request". The difference is what context the workflow +# runs inside: "pull_request" runs in the context of the fork, where changes +# to the workflow definition will take immediate effect, while "pull_request_target" +# runs in the context of the main pvlib repository, where the original (non-fork) +# workflow definition is used instead. Of course by switching away from the fork's +# context to keep our original workflow definitions, we're also keeping all the +# original code, so the tests won't be run against the PR's new code. To fix this +# we explicitly check out the PR's code as the first step of the workflow. +# This allows the job to run modified pvlib & pytest code, but only ever via +# the original workflow file. +# So long as a maintainer always verifies that the PR's code is not malicious prior to +# adding the label and triggering this workflow, I think this should not present +# a security risk. +# +# Note that this workflow can be triggered again by removing and re-adding the +# "remote-data" label to the PR. +# +# Note also that "pull_request_target" is also the only way for the secrets +# to be accessible in the first place. +# +# Further reading: +# - https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ +# - https://github.community/t/can-workflow-changes-be-used-with-pull-request-target/178626/7 + name: pytest-remote-data on: - # use pull_request_target, in combination with the `remote-data` label (below) - # so that we can access repository secrets. - # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ pull_request_target: types: [labeled] + push: + branches: + - master jobs: test: @@ -19,21 +62,25 @@ jobs: fail-fast: false # don't cancel other matrix jobs when one fails matrix: python-version: [3.6, 3.7, 3.8, 3.9] - suffix: [''] # placeholder as an alternative to "-min" + suffix: [''] # the alternative to "-min" include: - python-version: 3.6 suffix: -min runs-on: ubuntu-latest - if: contains(github.event.pull_request.labels.*.name, 'remote-data') + if: (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'remote-data')) || (github.event_name == 'push') steps: - uses: actions/checkout@v2 + if: github.event_name == 'pull_request_target' # pull_request_target runs in the context of the target branch (pvlib/master), - # but what we need is the hypothetical merge commit: + # but what we need is the hypothetical merge commit from the PR: with: ref: "refs/pull/${{ github.event.number }}/merge" + - uses: actions/checkout@v2 + if: github.event_name == 'push' + - name: Set up conda environment uses: conda-incubator/setup-miniconda@v2 with: @@ -46,6 +93,10 @@ jobs: # version, mapping from "3.7" to "37", second is to add "-min" if needed REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml + - name: List installed package versions + shell: bash -l {0} # necessary for conda env to be active + run: conda list + - name: Run tests shell: bash -l {0} # necessary for conda env to be active env: @@ -53,12 +104,12 @@ jobs: NREL_API_KEY: ${{ secrets.NRELAPIKEY }} BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} - run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data + run: pytest pvlib/tests/iotools pvlib/tests/test_forecast.py --cov=./ --cov-report=xml --remote-data - name: Upload coverage to Codecov - if: matrix.python-version == 3.9 + if: matrix.python-version == 3.6 && matrix.suffix == '' uses: codecov/codecov-action@v2 with: fail_ci_if_error: true verbose: true - flags: iotools # flags are configured in codecov.yml \ No newline at end of file + flags: remote-data # flags are configured in codecov.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1764d1b824..c52510c2cf 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -24,7 +24,7 @@ jobs: environment-type: conda suffix: -min exclude: - - os: macos-latest + - os: macos-10.15 environment-type: conda - os: windows-latest environment-type: bare @@ -47,7 +47,12 @@ jobs: # version, mapping from "3.7" to "37", second is to add "-min" if needed REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml - - name: Install Python ${{ matrix.python-version }}${{ matrix.suffix }} + - name: List installed package versions (conda) + if: matrix.environment-type == 'conda' + shell: bash -l {0} # necessary for conda env to be active + run: conda list + + - name: Install bare Python ${{ matrix.python-version }}${{ matrix.suffix }} if: matrix.environment-type == 'bare' uses: actions/setup-python@v1 with: @@ -55,18 +60,20 @@ jobs: - name: Set up bare environment if: matrix.environment-type == 'bare' - run: pip install .[test] + run: | + pip install .[test] + pip freeze - name: Run tests shell: bash -l {0} # necessary for conda env to be active run: | - sed -i '/#pvlib\/iotools/s/#//' .coveragerc # don't include pvlib.iotools in coverage - pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools + # ignore iotools & forecast; those tests are run in a separate workflow + pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools --ignore=pvlib/tests/test_forecast.py - name: Upload coverage to Codecov - if: matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' + if: matrix.python-version == 3.6 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' uses: codecov/codecov-action@v2 with: fail_ci_if_error: true verbose: true - flags: core # flags are configured in codecov.yml \ No newline at end of file + flags: core # flags are configured in codecov.yml diff --git a/codecov.yml b/codecov.yml index c85a3edcfd..c407f28d16 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,32 +2,68 @@ codecov: notify: require_ci_to_pass: no +# "flags" are used to identify subsets of the overall codebase when calculating coverage. +# Currently used for "remote_data" (pvlib.iotools & forecast) and "core" (everything else). +# Because we only run the remote_data tests sometimes, we need to split it out so that +# codecov doesn't report a big drop in coverage when we don't run them. +# We also use "carryforward: true" so that, when we don't run remote_data tests, the last +# known coverage is carried forward and used in place of the missing coverage. +# https://docs.codecov.com/docs/flags +flags: + + core: + paths: + - pvlib/ + - '!pvlib/iotools/' + - '!pvlib/tests/iotools/' + - '!pvlib/forecast.py' + - '!pvlib/tests/test_forecast.py' + carryforward: false + + remote-data: + paths: + - pvlib/iotools/ + - pvlib/tests/iotools + - pvlib/forecast.py + - pvlib/tests/test_forecast.py + carryforward: true # if not run, use coverage from previous commit + + coverage: - status: + status: # each entry here represents a check status to report to GitHub patch: default: target: 100% - if_no_uploads: error - if_not_found: success - if_ci_failed: failure + project: - default: false - library: + default: off + + core: target: auto - if_no_uploads: error - if_not_found: success - if_ci_failed: failure + flags: + - core + + remote-data: + target: auto + flags: + - remote-data + + tests-core: + target: 95% paths: - - "pvlib/.*" - tests: + - 'pvlib/tests/.*' + - '!pvlib/tests/iotools/.*' + - '!pvlib/tests/test_forecast.py' + flags: + - core + + tests-remote-data: target: 95% paths: - - "pvlib/tests/.*" + - 'pvlib/tests/iotools/.*' + - 'pvlib/tests/test_forecast.py' + flags: + - remote-data -comment: off -# "flags" are used to identify subsets of the overall codebase when calculating coverage. -# Currently used for "iotools" (just pvlib.iotools) and "core" (everything else) -# https://docs.codecov.com/docs/flags#recommended-automatic-flag-management -flag_management: - default_rules: +comment: off From a15b528d05da0fcc8e881dd49223e28571126b58 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Sun, 12 Jun 2022 14:50:41 -0400 Subject: [PATCH 18/23] whatsnew --- docs/sphinx/source/whatsnew/v0.9.2.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.9.2.rst b/docs/sphinx/source/whatsnew/v0.9.2.rst index 05b7ed58ab..39a741c080 100644 --- a/docs/sphinx/source/whatsnew/v0.9.2.rst +++ b/docs/sphinx/source/whatsnew/v0.9.2.rst @@ -22,6 +22,8 @@ Bug fixes Testing ~~~~~~~ +* Switched CI testing provider from Azure to GitHub Actions (:pull:`1306`) + Documentation ~~~~~~~~~~~~~ @@ -40,3 +42,4 @@ Contributors * Naman Priyadarshi (:ghuser:`Naman-Priyadarshi`) * Chencheng Luo (:ghuser:`roger-lcc`) * Prajwal Borkar (:ghuser:`PrajwalBorkar`) +* Kevin Anderson (:ghuser:`kanderso-nrel`) From b3b9c7d735d0b626f53610d67ee3ce9bb2c237fd Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 14 Jun 2022 14:35:32 -0400 Subject: [PATCH 19/23] remove azure config files --- azure-pipelines.yml | 45 ------------------------------ ci/azure/conda_linux.yml | 57 -------------------------------------- ci/azure/conda_windows.yml | 41 --------------------------- ci/azure/posix.yml | 41 --------------------------- 4 files changed, 184 deletions(-) delete mode 100644 azure-pipelines.yml delete mode 100644 ci/azure/conda_linux.yml delete mode 100644 ci/azure/conda_windows.yml delete mode 100644 ci/azure/posix.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index dc048dd04a..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,45 +0,0 @@ -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master - - -jobs: - -- template: ci/azure/posix.yml - parameters: - name: Test_bare_Linux - vmImage: ubuntu-20.04 - - -- template: ci/azure/posix.yml - parameters: - name: Test_bare_macOS - vmImage: macOS-10.15 - - -- template: ci/azure/conda_linux.yml - parameters: - name: Test_conda_linux - vmImage: ubuntu-20.04 - - -- template: ci/azure/conda_windows.yml - parameters: - name: Test_conda_windows - vmImage: windows-latest - - -- job: 'Publish' - dependsOn: 'Test_conda_linux' - pool: - vmImage: 'ubuntu-latest' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - architecture: 'x64' - - - script: python setup.py sdist - displayName: 'Build sdist' diff --git a/ci/azure/conda_linux.yml b/ci/azure/conda_linux.yml deleted file mode 100644 index d907e03b4d..0000000000 --- a/ci/azure/conda_linux.yml +++ /dev/null @@ -1,57 +0,0 @@ -parameters: - name: '' - vmImage: '' - -jobs: -- job: ${{ parameters.name }} - pool: - vmImage: ${{ parameters.vmImage }} - strategy: - matrix: - Python36-min: - python.version: '36' - suffix: '-min' - Python36: - python.version: '36' - Python37: - python.version: '37' - Python38: - python.version: '38' - Python39: - python.version: '39' - - steps: - - bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin" - displayName: Add conda to PATH - - script: conda env create --quiet --file ci/requirements-py$(python.version)$(suffix).yml - displayName: Create Anaconda environment - - script: | - source activate test_env - pip install pytest-azurepipelines - pip install -e . - displayName: 'pip dependencies' - - script: | - source activate test_env - conda list - displayName: 'List installed dependencies' - - script: | - source activate test_env - export NREL_API_KEY=$(nrelApiKey) - export BSRN_FTP_USERNAME=$(BSRN_FTP_USERNAME) - export BSRN_FTP_PASSWORD=$(BSRN_FTP_PASSWORD) - pytest pvlib --remote-data --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html - displayName: 'pytest' - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Linux $(python.version)' - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' - condition: eq(variables['coverage'], true) - - script: | - bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda - displayName: 'codecov' - condition: eq(variables['coverage'], true) diff --git a/ci/azure/conda_windows.yml b/ci/azure/conda_windows.yml deleted file mode 100644 index 4b8cf61911..0000000000 --- a/ci/azure/conda_windows.yml +++ /dev/null @@ -1,41 +0,0 @@ -parameters: - name: '' - vmImage: '' - -jobs: -- job: ${{ parameters.name }} - pool: - vmImage: ${{ parameters.vmImage }} - strategy: - matrix: - Python36-windows: - python.version: '36' - Python37-windows: - python.version: '37' - Python38-windows: - python.version: '38' - Python39-windows: - python.version: '39' - - steps: - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: Add conda to PATH - - script: conda env create --quiet --file ci/requirements-py$(python.version).yml - displayName: Create Anaconda environment - - script: | - call activate test_env - pip install pytest-azurepipelines - pip install -e . - displayName: 'pip dependencies' - - script: | - call activate test_env - conda list - displayName: 'List installed dependencies' - - script: | - call activate test_env - pytest pvlib --junitxml=junit/test-results.xml - displayName: 'pytest' - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Windows $(python.version)' diff --git a/ci/azure/posix.yml b/ci/azure/posix.yml deleted file mode 100644 index 086f03dd69..0000000000 --- a/ci/azure/posix.yml +++ /dev/null @@ -1,41 +0,0 @@ -parameters: - name: '' - vmImage: '' - -jobs: -- job: ${{ parameters.name }} - pool: - vmImage: ${{ parameters.vmImage }} - strategy: - matrix: - Python36: - python.version: '3.6' - Python37: - python.version: '3.7' - Python38: - python.version: '3.8' - Python39: - python.version: '3.9' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - - - script: | - pip install pytest pytest-cov pytest-mock requests-mock pytest-timeout pytest-azurepipelines pytest-rerunfailures pytest-remotedata - pip install -e . - pytest pvlib --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html - displayName: 'Test with pytest' - - - task: PublishTestResults@2 - condition: succeededOrFailed() - inputs: - testResultsFiles: '**/test-*.xml' - testRunTitle: 'Publish test results for Python $(python.version)' - - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' From d5275cea0df37b08455dbce1654241c009a6a171 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 14 Jun 2022 14:36:12 -0400 Subject: [PATCH 20/23] don't pytest on all pushes, only master --- .github/workflows/pytest.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c52510c2cf..61aea379c5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,6 +1,10 @@ name: pytest -on: [pull_request, push] +on: + pull_request: + push: + branches: + - master jobs: test: From ea1722937737c7017ad0f2bbe97778b4c142e920 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 14 Jun 2022 14:37:19 -0400 Subject: [PATCH 21/23] build sdist on PRs --- .github/workflows/publish.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e404ca7d5d..8e342564a6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,11 +1,10 @@ name: Publish distributions to PyPI -# if this workflow is modified to be a generic CI workflow then -# add an if statement to the publish step so it only runs on tags. on: + pull_request: push: - tags: - - "v*" + branches: + - master jobs: build-n-publish: @@ -31,7 +30,9 @@ jobs: - name: Build packages run: python setup.py sdist bdist_wheel + # only publish distribution to PyPI for tagged commits - name: Publish distribution to PyPI + if: startsWith(github.ref, 'refs/tags/v') uses: pypa/gh-action-pypi-publish@master with: user: __token__ From 4b78783448cb6de3acb62b8d2b3abfc4b06a3883 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 14 Jun 2022 14:40:18 -0400 Subject: [PATCH 22/23] switch to more convenient environment filenames --- .github/workflows/pytest-remote-data.yml | 9 ++------- .github/workflows/pytest.yml | 9 ++------- ...uirements-py36-min.yml => requirements-py3.6-min.yml} | 0 ci/{requirements-py36.yml => requirements-py3.6.yml} | 0 ci/{requirements-py37.yml => requirements-py3.7.yml} | 0 ci/{requirements-py38.yml => requirements-py3.8.yml} | 0 ci/{requirements-py39.yml => requirements-py3.9.yml} | 0 7 files changed, 4 insertions(+), 14 deletions(-) rename ci/{requirements-py36-min.yml => requirements-py3.6-min.yml} (100%) rename ci/{requirements-py36.yml => requirements-py3.6.yml} (100%) rename ci/{requirements-py37.yml => requirements-py3.7.yml} (100%) rename ci/{requirements-py38.yml => requirements-py3.8.yml} (100%) rename ci/{requirements-py39.yml => requirements-py3.9.yml} (100%) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 257823e234..3b1a9b4b2d 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -52,11 +52,6 @@ on: jobs: test: - env: - # we need to turn "3.6" into 36 to build the conda requirement filename, - # but there's no good way to do that via string manipulation. So set up - # a map that will be parsed as JSON later: - VERSIONMAP: '{"3.6": "36", "3.7": "37", "3.8": "38", "3.9": "39"}' strategy: fail-fast: false # don't cancel other matrix jobs when one fails @@ -90,8 +85,8 @@ jobs: auto-activate-base: false env: # build requirement filename. First replacement is for the python - # version, mapping from "3.7" to "37", second is to add "-min" if needed - REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml + # version, second is to add "-min" if needed + REQUIREMENTS: ci/requirements-py${{ matrix.python-version }}${{ matrix.suffix }}.yml - name: List installed package versions shell: bash -l {0} # necessary for conda env to be active diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 61aea379c5..56b4b5e618 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,11 +8,6 @@ on: jobs: test: - env: - # we need to turn "3.6" into 36 to build the conda requirement filename, - # but there's no good way to do that via string manipulation. So set up - # a map that will be parsed as JSON later: - VERSIONMAP: '{"3.6": "36", "3.7": "37", "3.8": "38", "3.9": "39"}' strategy: fail-fast: false # don't cancel other matrix jobs when one fails @@ -48,8 +43,8 @@ jobs: auto-activate-base: false env: # build requirement filename. First replacement is for the python - # version, mapping from "3.7" to "37", second is to add "-min" if needed - REQUIREMENTS: ci/requirements-py${{ fromJSON(env.VERSIONMAP)[matrix.python-version] }}${{ matrix.suffix }}.yml + # version, second is to add "-min" if needed + REQUIREMENTS: ci/requirements-py${{ matrix.python-version }}${{ matrix.suffix }}.yml - name: List installed package versions (conda) if: matrix.environment-type == 'conda' diff --git a/ci/requirements-py36-min.yml b/ci/requirements-py3.6-min.yml similarity index 100% rename from ci/requirements-py36-min.yml rename to ci/requirements-py3.6-min.yml diff --git a/ci/requirements-py36.yml b/ci/requirements-py3.6.yml similarity index 100% rename from ci/requirements-py36.yml rename to ci/requirements-py3.6.yml diff --git a/ci/requirements-py37.yml b/ci/requirements-py3.7.yml similarity index 100% rename from ci/requirements-py37.yml rename to ci/requirements-py3.7.yml diff --git a/ci/requirements-py38.yml b/ci/requirements-py3.8.yml similarity index 100% rename from ci/requirements-py38.yml rename to ci/requirements-py3.8.yml diff --git a/ci/requirements-py39.yml b/ci/requirements-py3.9.yml similarity index 100% rename from ci/requirements-py39.yml rename to ci/requirements-py3.9.yml From 5a486fba158edc59b9b686a8cf4858fb921416bb Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 14 Jun 2022 14:40:57 -0400 Subject: [PATCH 23/23] use most recent checkout action --- .github/workflows/pytest-remote-data.yml | 2 +- .github/workflows/pytest.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 3b1a9b4b2d..f9a726af41 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -66,7 +66,7 @@ jobs: if: (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'remote-data')) || (github.event_name == 'push') steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 if: github.event_name == 'pull_request_target' # pull_request_target runs in the context of the target branch (pvlib/master), # but what we need is the hypothetical merge commit from the PR: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 56b4b5e618..07c0045a48 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -31,7 +31,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up conda environment if: matrix.environment-type == 'conda'