diff --git a/.github/workflows/check_docs.yaml b/.github/workflows/check_docs.yaml index 45d8a3f54..530e101b2 100644 --- a/.github/workflows/check_docs.yaml +++ b/.github/workflows/check_docs.yaml @@ -22,7 +22,9 @@ jobs: cache-dependency-path: setup.py - name: Install dependencies - run: pip install -r requirements.txt + run: | + pip install -r requirements.txt + pip list - name: Build docs run: mkdocs build -d build --strict diff --git a/.github/workflows/code_formatting.yml b/.github/workflows/code_formatting.yml index 7bc73b353..7539052f7 100644 --- a/.github/workflows/code_formatting.yml +++ b/.github/workflows/code_formatting.yml @@ -23,9 +23,12 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + pip list + - name: ruff check run: | ruff check . + - name: ruff format run: | ruff format . diff --git a/.github/workflows/deploy_docs.yaml b/.github/workflows/deploy_docs.yaml index 976bbc648..98474ea7a 100644 --- a/.github/workflows/deploy_docs.yaml +++ b/.github/workflows/deploy_docs.yaml @@ -25,7 +25,9 @@ jobs: cache-dependency-path: setup.py - name: Install dependencies - run: pip install -r requirements.txt + run: | + pip install -r requirements.txt + pip list - name: Deploy docs run: mkdocs gh-deploy --force diff --git a/.github/workflows/repo_scraper.yml b/.github/workflows/repo_scraper.yml index 49992fb63..34b896735 100644 --- a/.github/workflows/repo_scraper.yml +++ b/.github/workflows/repo_scraper.yml @@ -22,6 +22,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r tools/repo_scraper/requirements.txt + pip list - name: Run repo scraper env: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab91e6ef5..01e3d9d6b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: detect-private-key - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.7 + rev: v0.5.5 hooks: # try to fix what is possible - id: ruff diff --git a/requirements.txt b/requirements.txt index 9e577470f..d07c59291 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ mkdocs-git-revision-date-localized-plugin>=1.2.6 mkdocs-exclude>=1.0.2 # Developer stuff -ruff>=0.4.7 +ruff>=0.5.5 codespell>=2.2.6 pre-commit>=3.7.0 diff --git a/s10_extra/exercise_files/fashion_trainer.py b/s10_extra/exercise_files/fashion_trainer.py index cbb5e08e6..01eaabdce 100644 --- a/s10_extra/exercise_files/fashion_trainer.py +++ b/s10_extra/exercise_files/fashion_trainer.py @@ -23,7 +23,7 @@ def output_label(label): 8: "Bag", 9: "Ankle Boot", } - label = label.item() if type(label) == torch.Tensor else label + label = label.item() if isinstance(label, torch.Tensor) else label return output_mapping[label] diff --git a/s6_the_cloud/using_the_cloud.md b/s6_the_cloud/using_the_cloud.md index 568f74ec2..a158b2557 100644 --- a/s6_the_cloud/using_the_cloud.md +++ b/s6_the_cloud/using_the_cloud.md @@ -667,7 +667,7 @@ the images we are used to that use Pytorch. 'build', '.', '-t', - 'europe-west1-docker.pkg.dev/$PROJECT_ID//_IMAGE_NAME', + 'europe-west1-docker.pkg.dev/$PROJECT_ID//$_IMAGE_NAME', '-f', '' ] @@ -675,7 +675,7 @@ the images we are used to that use Pytorch. id: 'Push container image' args: [ 'push', - 'europe-west1-docker.pkg.dev/$PROJECT_ID//_IMAGE_NAME' + 'europe-west1-docker.pkg.dev/$PROJECT_ID//$_IMAGE_NAME' ] substitutions: _IMAGE_NAME: 'my_image' diff --git a/s9_scalable_applications/exercise_files/fashion_trainer.py b/s9_scalable_applications/exercise_files/fashion_trainer.py index 8dea3bf31..1ab791d9e 100644 --- a/s9_scalable_applications/exercise_files/fashion_trainer.py +++ b/s9_scalable_applications/exercise_files/fashion_trainer.py @@ -23,7 +23,7 @@ def output_label(label): 8: "Bag", 9: "Ankle Boot", } - label = label.item() if type(label) == torch.Tensor else label + label = label.item() if isinstance(torch.Tensor) else label return output_mapping[label]