From aeb17f02a5e17a9bc8681a533733094731df836e Mon Sep 17 00:00:00 2001 From: Simon Heybrock Date: Mon, 17 Jul 2023 14:36:14 +0200 Subject: [PATCH 1/3] Update from template --- .copier-answers.yml | 3 +- .github/workflows/ci.yml | 25 +++++++-------- .github/workflows/docs.yml | 4 +-- .github/workflows/release.yml | 15 +++++---- .github/workflows/test.yml | 59 +++++++++++++++++++++++++++++++++++ pyproject.toml | 11 +++++-- 6 files changed, 90 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.copier-answers.yml b/.copier-answers.yml index 227f6fd4..abea6e29 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,7 +1,8 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 6c45980 +_commit: 3143b74 _src_path: gh:scipp/copier_template description: Build scientific pipelines for your data +github_linux_image: ubuntu-20.04 max_python: '3.11' min_python: '3.8' orgname: scipp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dff0639c..b363f2bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: jobs: formatting: name: Formatting and static analysis - runs-on: ubuntu-20.04 + runs-on: 'ubuntu-20.04' steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 @@ -25,23 +25,21 @@ jobs: commit_message: Apply automatic formatting tests: - name: Tests ${{ matrix.name }} + name: Tests ${{ matrix.os }} py${{ matrix.python }} needs: formatting - runs-on: ubuntu-20.04 strategy: matrix: - include: - - {name: '3.8', python: '3.8', os: ubuntu-20.04, tox: py38} + os: ['ubuntu-20.04'] + python: + - version: '3.8' + tox-env: 'py38' - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python }} - - run: python -m pip install --upgrade pip - - run: python -m pip install -r requirements/ci.txt - - run: tox -e ${{ matrix.tox }} + uses: ./.github/workflows/test.yml + with: + os-variant: ${{ matrix.os }} + python-version: ${{ matrix.python.version }} + tox-env: ${{ matrix.python.tox-env }} docs: needs: tests @@ -50,4 +48,3 @@ jobs: publish: false version: ${{ github.ref_name }} branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }} - diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9b614cd3..0ca062d1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,8 +37,9 @@ env: jobs: docs: name: Build documentation - runs-on: ubuntu-20.04 + runs-on: 'ubuntu-20.04' steps: + - run: sudo apt install --yes graphviz pandoc - uses: actions/checkout@v3 with: @@ -71,4 +72,3 @@ jobs: single-commit: true clean-exclude: release ssh-key: ${{ secrets.GH_PAGES_DEPLOY_KEY }} - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed3c5e8e..6babad6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ defaults: jobs: build_conda: name: Conda build - runs-on: ubuntu-20.04 + runs-on: 'ubuntu-20.04' steps: - uses: actions/checkout@v2 @@ -31,7 +31,7 @@ jobs: build_wheels: name: Wheels - runs-on: ubuntu-20.04 + runs-on: 'ubuntu-20.04' steps: - uses: actions/checkout@v3 @@ -58,7 +58,7 @@ jobs: upload_pypi: name: Deploy PyPI needs: [build_wheels, build_conda] - runs-on: ubuntu-20.04 + runs-on: 'ubuntu-20.04' if: github.event_name == 'release' && github.event.action == 'published' steps: @@ -72,22 +72,22 @@ jobs: upload_conda: name: Deploy Conda Forge needs: [build_wheels, build_conda] - runs-on: ubuntu-20.04 + runs-on: 'ubuntu-20.04' if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v3 - uses: conda-incubator/setup-miniconda@v2 with: - python-version: '3.8' - run: conda install -c conda-forge --yes anaconda-client - run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-*/*/*.tar.bz2) - manage-versions: name: Manage Versions - runs-on: ubuntu-20.04 + + runs-on: 'ubuntu-20.04' + outputs: version-new: ${{ steps.version.outputs.new }} version-replaced: ${{ steps.version.outputs.replaced }} @@ -124,4 +124,3 @@ jobs: publish: true version: ${{ needs.manage-versions.outputs.version-replaced }} secrets: inherit - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..a24b3925 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) + +name: Test + +on: + workflow_dispatch: + inputs: + os-variant: + default: 'ubuntu-20.04' + type: string + python-version: + default: '3.8' + type: string + tox-env: + default: 'test' + type: string + pip-recipe: + default: 'requirements/ci.txt' + type: string + coverage-report: + default: false + type: boolean + workflow_call: + inputs: + os-variant: + default: 'ubuntu-20.04' + type: string + python-version: + default: '3.8' + type: string + tox-env: + default: 'test' + type: string + pip-recipe: + default: 'requirements/ci.txt' + type: string + coverage-report: + default: false + type: boolean + +jobs: + test: + name: tests ${{ inputs.os-variant }}, py${{ inputs.python-version }} + runs-on: ${{ inputs.os-variant }} + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: ${{ inputs.python-version }} + - run: python -m pip install --upgrade pip + - run: python -m pip install -r ${{ inputs.pip-recipe }} + - run: tox -e ${{ inputs.tox-env }} + - uses: actions/upload-artifact@v3 + if: ${{ inputs.coverage-report }} + with: + name: CoverageReport + path: coverage_html/ diff --git a/pyproject.toml b/pyproject.toml index 5487b956..ab9fd237 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" name = "sciline" description = "Build scientific pipelines for your data" authors= [{name="Scipp contributors"}] -license = { "file" = "LICENSE" } +license = { file = "LICENSE" } readme = "README.md" classifiers = [ "Intended Audience :: Science/Research", @@ -57,5 +57,12 @@ skip_gitignore = true profile = "black" [tool.mypy] -mypy_path = "src" +strict = true ignore_missing_imports = true +enable_error_code = [ + "ignore-without-code", + "redundant-expr", + "truthy-bool", +] +show_error_codes = true +warn_unreachable = true From 0a223ee5d861f4dc08b20ff72dd06368f01bcfaf Mon Sep 17 00:00:00 2001 From: Simon Heybrock Date: Tue, 18 Jul 2023 07:56:06 +0200 Subject: [PATCH 2/3] Fixed upstream --- .copier-answers.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index abea6e29..f11b912e 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 3143b74 +_commit: 96938e6 _src_path: gh:scipp/copier_template description: Build scientific pipelines for your data github_linux_image: ubuntu-20.04 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b363f2bd..8a5f57b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: commit_message: Apply automatic formatting tests: - name: Tests ${{ matrix.os }} py${{ matrix.python }} + name: Tests needs: formatting strategy: matrix: From 960d5e7ac1db8c0c37b60dcb7e1c756372d940fb Mon Sep 17 00:00:00 2001 From: Simon Heybrock Date: Tue, 18 Jul 2023 08:01:58 +0200 Subject: [PATCH 3/3] Try remove job name --- .copier-answers.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index f11b912e..aa6a5376 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 96938e6 +_commit: 14eaf11 _src_path: gh:scipp/copier_template description: Build scientific pipelines for your data github_linux_image: ubuntu-20.04 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a24b3925..ee406028 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,6 @@ on: jobs: test: - name: tests ${{ inputs.os-variant }}, py${{ inputs.python-version }} runs-on: ${{ inputs.os-variant }} steps: @@ -57,3 +56,4 @@ jobs: with: name: CoverageReport path: coverage_html/ +