From 7225a7779a71add7c38e5b3a4808706fb20f66ec Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Sat, 2 Nov 2024 14:16:11 +0100 Subject: [PATCH 1/4] update --- .github/workflows/check-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index 269e6d55..a1ddbd00 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -91,6 +91,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 with: + fetch-depth: 0 # checkout entire history for all branches (required when using scm-based versioning) submodules: recursive - name: Set up Python 🐍 uses: actions/setup-python@v5 From 6ee53fd5c1cce31c016e8891bd23d96708086e7b Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 6 Nov 2024 17:43:36 +0000 Subject: [PATCH 2/4] split import --- .github/actions/pkg-install/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index 66b4cbf9..100a52e8 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -49,10 +49,15 @@ runs: pip list shell: bash - - name: package check + - name: package check / import + if: ${{ inputs.import-name != '' }} run: | - set -ex python -c "import ${{ inputs.import-name }} as pkg; print(f'version: {pkg.__version__}')" + shell: bash + + - name: package check / custom import + if: ${{ inputs.custom-import != '' }} + run: | python -c '${{ inputs.custom-import }}' shell: bash From 9086b504789bb602a435d922d9e087a9a2151fa6 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 6 Nov 2024 17:47:34 +0000 Subject: [PATCH 3/4] split import --- .github/actions/pkg-install/action.yml | 8 ++++---- .github/workflows/check-package.yml | 4 ++-- .github/workflows/ci-use-checks.yaml | 2 +- CHANGELOG.md | 7 +++++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index 100a52e8..d74e752b 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -17,7 +17,7 @@ inputs: description: "additional pip install flags" required: false default: "-f https://download.pytorch.org/whl/cpu/torch_stable.html" - custom-import: + custom-import-code: description: "additional import statement, need to be full python code" required: false default: "" @@ -56,9 +56,9 @@ runs: shell: bash - name: package check / custom import - if: ${{ inputs.custom-import != '' }} + if: ${{ inputs.custom-import-code != '' }} run: | - python -c '${{ inputs.custom-import }}' + python -c '${{ inputs.custom-import-code }}' shell: bash - name: Uninstall all @@ -81,5 +81,5 @@ runs: run: | set -ex python -c "import ${{ inputs.import-name }} as pkg; print(f'version: {pkg.__version__}')" - python -c '${{ inputs.custom-import }}' + python -c '${{ inputs.custom-import-code }}' shell: bash diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index a1ddbd00..64361321 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -25,7 +25,7 @@ on: description: "Import name to test with after installation" required: true type: string - custom-import: + custom-import-code: description: "additional import statement, need to be full python code" type: string required: false @@ -143,7 +143,7 @@ jobs: pkg-extras: ${{ inputs.install-extras }} pip-flags: ${{ inputs.install-flags }} import-name: ${{ inputs.import-name }} - custom-import: ${{ inputs.custom-import }} + custom-import-code: ${{ inputs.custom-import-code }} # TODO: add run doctests diff --git a/.github/workflows/ci-use-checks.yaml b/.github/workflows/ci-use-checks.yaml index afc1670c..bfafc9c7 100644 --- a/.github/workflows/ci-use-checks.yaml +++ b/.github/workflows/ci-use-checks.yaml @@ -64,7 +64,7 @@ jobs: install-extras: "[cli]" # todo: when we have a module with depence on extra, replace it # tried to import `lightning_utilities.cli.__main__` but told me it does not exits - custom-import: "import fire" + custom-import-code: "import fire" testing-matrix: | { "os": ["ubuntu-22.04", "macos-13", "windows-2022"], diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e9b992b..ca7473b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [Unreleased] - 2024-MM-DD + +### Changed + +- CI: split and rename `custom-import` to `custom-import-code` + + ## [0.11.8] - 2024-10-15 ### Changed From c7e3e115c07c85d631364ce4d88d821120033ec9 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Wed, 6 Nov 2024 18:10:05 +0000 Subject: [PATCH 4/4] Apply suggestions from code review --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca7473b9..4a35df5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- CI: split and rename `custom-import` to `custom-import-code` +- CI: split and rename `custom-import` to `custom-import-code` ([#325](https://github.com/Lightning-AI/utilities/pull/325)) ## [0.11.8] - 2024-10-15