diff --git a/.github/workflows/check-code.yml b/.github/workflows/check-code.yml index e1200cdd..884dc212 100644 --- a/.github/workflows/check-code.yml +++ b/.github/workflows/check-code.yml @@ -12,6 +12,11 @@ on: default: '3.9' required: false type: string + extra-typing: + description: 'Package extra to be installed for type checks + include mypy' + default: 'test' + required: false + type: string defaults: run: @@ -35,7 +40,7 @@ jobs: - name: Install dependencies run: | # don't use --upgrade to respect the version installed via setup.py - pip install -e '.[test]' mypy types-setuptools \ + pip install -e '.[${{ inputs.extra-typing }}]' mypy \ --extra-index-url https://download.pytorch.org/whl/cpu/torch_stable.html pip list diff --git a/.github/workflows/ci-use-checks.yaml b/.github/workflows/ci-use-checks.yaml index 60cd21c0..f591c6f8 100644 --- a/.github/workflows/ci-use-checks.yaml +++ b/.github/workflows/ci-use-checks.yaml @@ -15,6 +15,7 @@ jobs: uses: ./.github/workflows/check-code.yml with: actions-ref: ${{ github.sha }} # use local version + extra-typing: 'typing' check-schema: uses: ./.github/workflows/check-schema.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index d865fa98..a455e22a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- +- CI: allow specify typing extra ([#110](https://github.com/Lightning-AI/utilities/pull/110)) ### Fixed diff --git a/requirements/typing.txt b/requirements/typing.txt new file mode 100644 index 00000000..432605a4 --- /dev/null +++ b/requirements/typing.txt @@ -0,0 +1,3 @@ +mypy>=1.0.0 + +types-setuptools