From e1f913ea7585085f641b2a6d12278ab56c129ae6 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 21 Nov 2023 12:32:12 +0100 Subject: [PATCH 1/5] run full test matrix only on PRs to the master branch, update python target to 3.12 --- .github/workflows/pytest.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 4d9881d6bb..0fc7f3d094 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -28,12 +28,11 @@ jobs: runs-on: ${{ matrix.runner }} strategy: matrix: - python-version: ["3.8", "3.11"] + python-version: ["3.8", "3.12"] runner: ["ubuntu-latest"] include: - runner: "ubuntu-20.04" python-version: "3.8" - steps: - uses: actions/checkout@v3 name: Check out source-code repository @@ -43,6 +42,9 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: "pip" + # run full test matrix only on PRs to the master branch + if: github.ref == 'refs/heads/master' || matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8' + - name: Install dependencies run: | python -m pip install --upgrade pip -r requirements-dev.txt From 1be57f608f4216f67a20c97b7be70f13bdfaf748 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 21 Nov 2023 13:12:40 +0100 Subject: [PATCH 2/5] upgrade to python 3.12 --- .github/workflows/create-lint-wf.yml | 4 ++-- .github/workflows/create-test-lint-wf-template.yml | 4 ++-- .github/workflows/create-test-wf.yml | 4 ++-- .github/workflows/deploy-pypi.yml | 4 ++-- .github/workflows/fix-linting.yml | 4 ++-- .github/workflows/lint-code.yml | 6 +++--- .github/workflows/sync.yml | 4 ++-- .github/workflows/tools-api-docs-dev.yml | 4 ++-- .github/workflows/tools-api-docs-release.yml | 4 ++-- CHANGELOG.md | 1 + README.md | 2 +- nf_core/pipeline-template/.github/workflows/linting.yml | 2 +- 12 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 8f6836f309..d5f377a486 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -31,10 +31,10 @@ jobs: name: Check out source-code repository # Set up nf-core/tools - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 2689805dd1..5ce9b41118 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -36,10 +36,10 @@ jobs: - uses: actions/checkout@v3 name: Check out source-code repository - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 5faa59772c..d96518d7c6 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -29,10 +29,10 @@ jobs: - uses: actions/checkout@v3 name: Check out source-code repository - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/deploy-pypi.yml b/.github/workflows/deploy-pypi.yml index 1f539fe09a..9b46f0731b 100644 --- a/.github/workflows/deploy-pypi.yml +++ b/.github/workflows/deploy-pypi.yml @@ -16,10 +16,10 @@ jobs: - uses: actions/checkout@v3 name: Check out source-code repository - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml index ed2314046a..f56cb927fc 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -38,10 +38,10 @@ jobs: # Override to remove the default --check flag so that we make changes options: "--color" - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: python-isort uses: isort/isort-action@v1.0.0 with: diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index edff9a8c82..a951230a6a 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -76,10 +76,10 @@ jobs: - name: Check out source-code repository uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: python-isort uses: isort/isort-action@v1.1.0 with: @@ -92,7 +92,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v3 with: - python-version: 3.11 + python-version: 3.12 cache: "pip" - name: Install dependencies diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index fbbdacc8ab..5e7719973f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -48,10 +48,10 @@ jobs: path: nf-core/${{ matrix.pipeline }} fetch-depth: "0" - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/tools-api-docs-dev.yml b/.github/workflows/tools-api-docs-dev.yml index add939aba1..3a4725a944 100644 --- a/.github/workflows/tools-api-docs-dev.yml +++ b/.github/workflows/tools-api-docs-dev.yml @@ -26,10 +26,10 @@ jobs: - name: Check out source-code repository uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/tools-api-docs-release.yml b/.github/workflows/tools-api-docs-release.yml index f049d74ca0..8a6eda1318 100644 --- a/.github/workflows/tools-api-docs-release.yml +++ b/.github/workflows/tools-api-docs-release.yml @@ -21,10 +21,10 @@ jobs: - name: Check out source-code repository uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index b8fcce59fb..f64047db4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Change testing framework for modules and subworkflows from pytest to nf-test ([#2490](https://github.com/nf-core/tools/pull/2490)) - `bump_version` keeps now the indentation level of the updated version entries ([#2514](https://github.com/nf-core/tools/pull/2514)) +- Run tests with Python 3.12 ([#2522](https://github.com/nf-core/tools/pull/2522)). # [v2.10 - Nickel Ostrich](https://github.com/nf-core/tools/releases/tag/2.10) + [2023-09-25] diff --git a/README.md b/README.md index 8e6b52d4c2..9dcafe4386 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ conda install nf-core Alternatively, you can create a new environment with both nf-core/tools and nextflow: ```bash -conda create --name nf-core python=3.11 nf-core nextflow +conda create --name nf-core python=3.12 nf-core nextflow conda activate nf-core ``` diff --git a/nf_core/pipeline-template/.github/workflows/linting.yml b/nf_core/pipeline-template/.github/workflows/linting.yml index 29fc466ed6..edce89065f 100644 --- a/nf_core/pipeline-template/.github/workflows/linting.yml +++ b/nf_core/pipeline-template/.github/workflows/linting.yml @@ -78,7 +78,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.12" architecture: "x64" - name: Install dependencies From fa3f6b70a8bd86f473600c71315d3c6b2b724fc0 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 21 Nov 2023 13:47:23 +0100 Subject: [PATCH 3/5] add manual dispatch exception to mypy check --- .github/workflows/lint-code.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index f214bc680b..b4bd2fa4fb 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -135,4 +135,5 @@ jobs: enable_threshold_check: "true" enable_base_tip_check: "true" github_token: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'pull_request' && github.head_ref == 'dev' }} + # only run on PRs to dev branch or manual dispatch + if: ${{ github.event_name == 'pull_request' && github.head_ref == 'dev' }} || github.event_name == 'workflow_dispatch' From 5bba99cd83f12fe2ed4a714c7ea3fa3aeb183783 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 21 Nov 2023 13:56:28 +0100 Subject: [PATCH 4/5] add mypy.ini --- mypy.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000000..f869fa7e47 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +warn_unused_configs = True From c23fed6bcf6d8e625a8143914fa8f1b9c5494dfc Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 21 Nov 2023 14:02:26 +0100 Subject: [PATCH 5/5] add it to the action --- .github/workflows/lint-code.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index b4bd2fa4fb..737b5f11ac 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -132,6 +132,7 @@ jobs: with: max_tip: "60" sufficient_tip: "10" + mypy_config: "mypy.ini" enable_threshold_check: "true" enable_base_tip_check: "true" github_token: ${{ secrets.GITHUB_TOKEN }}