From cd36c1cf677e7137ea15f418e22e17343ac808e9 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:47:32 +0800 Subject: [PATCH] update `rm -rf /opt/hostedtoolcache` avoid change the python version (#7424) Fixes #7416 ### Description update `rm -rf /opt/hostedtoolcache` avoid change the python version ### Types of changes - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- .github/workflows/docker.yml | 2 +- .github/workflows/release.yml | 6 +++--- .github/workflows/setupapp.yml | 4 ++-- monai/transforms/smooth_field/array.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 229ae675f5..065125cc33 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -62,7 +62,7 @@ jobs: - name: docker_build shell: bash run: | - rm -rf /opt/hostedtoolcache + find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; docker --version # get tag info for versioning cat _version.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a03d2cea6c..c134724665 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: python -m pip install --user --upgrade setuptools wheel - name: Build and test source archive and wheel file run: | - rm -rf /opt/hostedtoolcache + find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; git fetch --depth=1 origin +refs/tags/*:refs/tags/* root_dir=$PWD echo "$root_dir" @@ -102,7 +102,7 @@ jobs: python-version: '3.9' - shell: bash run: | - rm -rf /opt/hostedtoolcache + find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; git describe python -m pip install --user --upgrade setuptools wheel python setup.py build @@ -143,7 +143,7 @@ jobs: RELEASE_VERSION: ${{ steps.versioning.outputs.tag }} shell: bash run: | - rm -rf /opt/hostedtoolcache + find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; # get tag info for versioning mv _version.py monai/ # version checks diff --git a/.github/workflows/setupapp.yml b/.github/workflows/setupapp.yml index 82394a86dd..a6407deb33 100644 --- a/.github/workflows/setupapp.yml +++ b/.github/workflows/setupapp.yml @@ -100,7 +100,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ steps.pip-cache.outputs.datew }} - name: Install the dependencies run: | - rm -rf /opt/hostedtoolcache + find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; python -m pip install --upgrade pip wheel python -m pip install -r requirements-dev.txt - name: Run quick tests CPU ubuntu @@ -146,7 +146,7 @@ jobs: - name: Install the default branch with build (dev branch only) if: github.ref == 'refs/heads/dev' run: | - rm -rf /opt/hostedtoolcache + find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; BUILD_MONAI=1 pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI python -c 'import monai; monai.config.print_config()' - name: Get the test cases (dev branch only) diff --git a/monai/transforms/smooth_field/array.py b/monai/transforms/smooth_field/array.py index c9df5f1dbb..9d19263f8b 100644 --- a/monai/transforms/smooth_field/array.py +++ b/monai/transforms/smooth_field/array.py @@ -96,7 +96,7 @@ def __init__( self.set_spatial_size(spatial_size) def randomize(self, data: Any | None = None) -> None: - self.field[self.rand_slices] = torch.from_numpy(self.R.uniform(self.low, self.high, self.crand_size)) + self.field[self.rand_slices] = torch.from_numpy(self.R.uniform(self.low, self.high, self.crand_size)) # type: ignore[index] def set_spatial_size(self, spatial_size: Sequence[int] | None) -> None: """