{"language": "Python", "id": 116, "repo_owner": "wandb", "repo_name": "wandb", "head_branch": "main", "workflow_name": "pre-commit", "workflow_filename": "pre-commit.yml", "workflow_path": ".github/workflows/pre-commit.yml", "contributor": "c-core-labs", "sha_fail": "077f6aaac3ebb96626ac747fb126a0b4d752489c", "sha_success": "4c315803bfdb46fa7818cb08fd7224fb0bb599f1", "workflow": "name: pre-commit\n\non:\n pull_request:\n push:\n branches: [main]\n\njobs:\n pre-commit:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-go@v4\n with:\n go-version: '1.21'\n - uses: actions/setup-python@v3\n - name: setup env\n run: |\n ./core/scripts/code-checks.sh update\n - uses: pre-commit/[email protected]\n with:\n extra_args: --hook-stage pre-push --all-files\n env:\n SKIP: go-generate-graphql\n", "logs": [{"step_name": "pre-commit/6_Run [email protected]", "log": "##[group]Run pre-commit/[email protected]\nwith:\n extra_args: --hook-stage pre-push --all-files\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\n##[group]Run python -m pip install pre-commit\n\u001b[36;1mpython -m pip install pre-commit\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\nCollecting pre-commit\n Downloading pre_commit-3.6.0-py2.py3-none-any.whl.metadata (1.3 kB)\nCollecting cfgv>=2.0.0 (from pre-commit)\n Downloading cfgv-3.4.0-py2.py3-none-any.whl.metadata (8.5 kB)\nCollecting identify>=1.0.0 (from pre-commit)\n Downloading identify-2.5.33-py2.py3-none-any.whl.metadata (4.4 kB)\nCollecting nodeenv>=0.11.1 (from pre-commit)\n Downloading nodeenv-1.8.0-py2.py3-none-any.whl.metadata (21 kB)\nCollecting pyyaml>=5.1 (from pre-commit)\n Downloading PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)\nCollecting virtualenv>=20.10.0 (from pre-commit)\n Downloading virtualenv-20.25.0-py3-none-any.whl.metadata (4.5 kB)\nCollecting setuptools (from nodeenv>=0.11.1->pre-commit)\n Downloading setuptools-69.0.2-py3-none-any.whl.metadata (6.3 kB)\nCollecting distlib<1,>=0.3.7 (from virtualenv>=20.10.0->pre-commit)\n Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)\nCollecting filelock<4,>=3.12.2 (from virtualenv>=20.10.0->pre-commit)\n Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)\nCollecting platformdirs<5,>=3.9.1 (from virtualenv>=20.10.0->pre-commit)\n Downloading platformdirs-4.1.0-py3-none-any.whl.metadata (11 kB)\nDownloading pre_commit-3.6.0-py2.py3-none-any.whl (204 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 204.0/204.0 kB 26.8 MB/s eta 0:00:00\nDownloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)\nDownloading identify-2.5.33-py2.py3-none-any.whl (98 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 98.9/98.9 kB 31.0 MB/s eta 0:00:00\nDownloading nodeenv-1.8.0-py2.py3-none-any.whl (22 kB)\nDownloading PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (724 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 725.0/725.0 kB 90.4 MB/s eta 0:00:00\nDownloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 3.8/3.8 MB 116.1 MB/s eta 0:00:00\nDownloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 468.9/468.9 kB 81.8 MB/s eta 0:00:00\nDownloading filelock-3.13.1-py3-none-any.whl (11 kB)\nDownloading platformdirs-4.1.0-py3-none-any.whl (17 kB)\nDownloading setuptools-69.0.2-py3-none-any.whl (819 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 819.5/819.5 kB 92.1 MB/s eta 0:00:00\nInstalling collected packages: distlib, setuptools, pyyaml, platformdirs, identify, filelock, cfgv, virtualenv, nodeenv, pre-commit\nSuccessfully installed cfgv-3.4.0 distlib-0.3.8 filelock-3.13.1 identify-2.5.33 nodeenv-1.8.0 platformdirs-4.1.0 pre-commit-3.6.0 pyyaml-6.0.1 setuptools-69.0.2 virtualenv-20.25.0\n##[group]Run python -m pip freeze --local\n\u001b[36;1mpython -m pip freeze --local\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\ncfgv==3.4.0\ndistlib==0.3.8\nfilelock==3.13.1\nidentify==2.5.33\nnodeenv==1.8.0\nplatformdirs==4.1.0\npre-commit==3.6.0\nPyYAML==6.0.1\nsetuptools==69.0.2\nvirtualenv==20.25.0\n##[group]Run actions/cache@v3\nwith:\n path: ~/.cache/pre-commit\n key: pre-commit-3|/opt/hostedtoolcache/Python/3.12.1/x64|22e1ac8b31209d20dbc1af062b7bb70cb716a8ce5ddbf255b52ad3a34004f0dc\n enableCrossOsArchive: false\n fail-on-cache-miss: false\n lookup-only: false\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\nReceived 0 of 48057368 (0.0%), 0.0 MBs/sec\nCache Size: ~46 MB (48057368 B)\n[command]/usr/bin/tar -xf /home/runner/work/_temp/516a3dc9-7b6f-410a-9989-4b9d88d8a69b/cache.tzst -P -C /home/runner/work/wandb/wandb --use-compress-program unzstd\nReceived 48057368 of 48057368 (100.0%), 22.9 MBs/sec\nCache restored successfully\nCache restored from key: pre-commit-3|/opt/hostedtoolcache/Python/3.12.1/x64|22e1ac8b31209d20dbc1af062b7bb70cb716a8ce5ddbf255b52ad3a34004f0dc\n##[group]Run pre-commit run --show-diff-on-failure --color=always --hook-stage pre-push --all-files\n\u001b[36;1mpre-commit run --show-diff-on-failure --color=always --hook-stage pre-push --all-files\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\nruff.....................................................................\u001b[41mFailed\u001b[m\n\u001b[2m- hook id: ruff\u001b[m\n\u001b[2m- files were modified by this hook\u001b[m\n\nFound 1 error (1 fixed, 0 remaining).\n\nblack-jupyter............................................................\u001b[41mFailed\u001b[m\n\u001b[2m- hook id: black-jupyter\u001b[m\n\u001b[2m- files were modified by this hook\u001b[m\n\n\u001b[1mreformatted wandb/integration/ultralytics/callback.py\u001b[0m\n\n\u001b[1mAll done! \u2728 \ud83c\udf70 \u2728\u001b[0m\n\u001b[34m\u001b[1m1 file \u001b[0m\u001b[1mreformatted\u001b[0m, \u001b[34m870 files \u001b[0mleft unchanged.\n\nblacken-docs.............................................................\u001b[42mPassed\u001b[m\nclang-format.............................................................\u001b[42mPassed\u001b[m\ncheck for merge conflicts................................................\u001b[42mPassed\u001b[m\ntrailing-whitespace......................................................\u001b[42mPassed\u001b[m\nend-of-file-fixer........................................................\u001b[42mPassed\u001b[m\ncheck-yaml...............................................................\u001b[42mPassed\u001b[m\ncheck-added-large-files..................................................\u001b[42mPassed\u001b[m\ncheck-shebang-scripts-are-executable.....................................\u001b[42mPassed\u001b[m\ncheck-executables-have-shebangs..........................................\u001b[42mPassed\u001b[m\ncheck-symlinks.......................................(no files to check)\u001b[46;30mSkipped\u001b[m\ncheck-toml...............................................................\u001b[42mPassed\u001b[m\ndebug-statements.........................................................\u001b[42mPassed\u001b[m\nforbid-submodules....................................(no files to check)\u001b[46;30mSkipped\u001b[m\nblack....................................................................\u001b[42mPassed\u001b[m\ngo-generate-proto........................................................\u001b[42mPassed\u001b[m\ngo-generate-graphql.....................................................\u001b[43;30mSkipped\u001b[m\ngo-fmt...................................................................\u001b[42mPassed\u001b[m\ngo-imports...............................................................\u001b[42mPassed\u001b[m\ngo-unit-tests............................................................\u001b[42mPassed\u001b[m\ngo-vet...................................................................\u001b[42mPassed\u001b[m\ngolangci-lint............................................................\u001b[42mPassed\u001b[m\ngo-critic................................................................\u001b[42mPassed\u001b[m\ngo-cyclo.................................................................\u001b[42mPassed\u001b[m\ngo-mod-tidy..............................................................\u001b[42mPassed\u001b[m\ngo-build.................................................................\u001b[42mPassed\u001b[m\npre-commit hook(s) made changes.\nIf you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.\nTo run `pre-commit` as part of git workflow, use `pre-commit install`.\nAll changes made by hooks:\n\u001b[1mdiff --git a/wandb/integration/ultralytics/bbox_utils.py b/wandb/integration/ultralytics/bbox_utils.py\u001b[m\n\u001b[1mindex 798aa57..9cee915 100644\u001b[m\n\u001b[1m--- a/wandb/integration/ultralytics/bbox_utils.py\u001b[m\n\u001b[1m+++ b/wandb/integration/ultralytics/bbox_utils.py\u001b[m\n\u001b[36m@@ -3,6 +3,7 @@\u001b[m \u001b[mfrom typing import Any, Dict, List, Optional, Tuple, Union\u001b[m\n import torch\u001b[m\n from ultralytics.engine.results import Results\u001b[m\n from ultralytics.models.yolo.detect import DetectionPredictor\u001b[m\n\u001b[32m+\u001b[m\n try:\u001b[m\n from ultralytics.yolo.utils import ops\u001b[m\n except ModuleNotFoundError:\u001b[m\n\u001b[1mdiff --git a/wandb/integration/ultralytics/callback.py b/wandb/integration/ultralytics/callback.py\u001b[m\n\u001b[1mindex ed8a224..618fc5a 100644\u001b[m\n\u001b[1m--- a/wandb/integration/ultralytics/callback.py\u001b[m\n\u001b[1m+++ b/wandb/integration/ultralytics/callback.py\u001b[m\n\u001b[36m@@ -42,6 +42,7 @@\u001b[m \u001b[mtry:\u001b[m\n SegmentationValidator,\u001b[m\n )\u001b[m\n from ultralytics.utils.torch_utils import de_parallel\u001b[m\n\u001b[32m+\u001b[m\n try:\u001b[m\n from ultralytics.yolo.utils import RANK, __version__\u001b[m\n except ModuleNotFoundError:\u001b[m\n##[error]Process completed with exit code 1.\n"}], "diff": "diff --git a/wandb/cli/cli.py b/wandb/cli/cli.py\nindex 94a3ece90..1d0031488 100644\n--- a/wandb/cli/cli.py\n+++ b/wandb/cli/cli.py\n@@ -1496,6 +1496,8 @@ def launch(\n if cli_template_vars:\n if queue is None:\n raise LaunchError(\"'--set-var' flag requires queue to be set\")\n+ if entity is None:\n+ entity = launch_utils.get_default_entity(api, config)\n public_api = PublicApi()\n runqueue = RunQueue(client=public_api.client, name=queue, entity=entity)\n template_variables = launch_utils.fetch_and_validate_template_variables(\ndiff --git a/wandb/integration/ultralytics/bbox_utils.py b/wandb/integration/ultralytics/bbox_utils.py\nindex 798aa573a..8b924697d 100644\n--- a/wandb/integration/ultralytics/bbox_utils.py\n+++ b/wandb/integration/ultralytics/bbox_utils.py\n@@ -3,10 +3,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union\n import torch\n from ultralytics.engine.results import Results\n from ultralytics.models.yolo.detect import DetectionPredictor\n-try:\n- from ultralytics.yolo.utils import ops\n-except ModuleNotFoundError:\n- from ultralytics.utils import ops\n+from ultralytics.yolo.utils import ops\n \n import wandb\n \ndiff --git a/wandb/integration/ultralytics/callback.py b/wandb/integration/ultralytics/callback.py\nindex ed8a22465..2e133a163 100644\n--- a/wandb/integration/ultralytics/callback.py\n+++ b/wandb/integration/ultralytics/callback.py\n@@ -42,10 +42,7 @@ try:\n SegmentationValidator,\n )\n from ultralytics.utils.torch_utils import de_parallel\n- try:\n- from ultralytics.yolo.utils import RANK, __version__\n- except ModuleNotFoundError:\n- from ultralytics.utils import RANK, __version__\n+ from ultralytics.yolo.utils import RANK, __version__\n \n from wandb.integration.ultralytics.bbox_utils import (\n plot_predictions,\ndiff --git a/wandb/integration/yolov8/yolov8.py b/wandb/integration/yolov8/yolov8.py\nindex 1c5dbd0fe..310a39114 100644\n--- a/wandb/integration/yolov8/yolov8.py\n+++ b/wandb/integration/yolov8/yolov8.py\n@@ -2,13 +2,8 @@ from typing import Any, Callable, Dict, List, Optional\n \n from ultralytics.yolo.engine.model import YOLO\n from ultralytics.yolo.engine.trainer import BaseTrainer\n-\n-try:\n- from ultralytics.yolo.utils import RANK\n- from ultralytics.yolo.utils.torch_utils import get_flops, get_num_params\n-except ModuleNotFoundError:\n- from ultralytics.utils import RANK\n- from ultralytics.utils.torch_utils import get_flops, get_num_params\n+from ultralytics.yolo.utils import RANK\n+from ultralytics.yolo.utils.torch_utils import get_flops, get_num_params\n from ultralytics.yolo.v8.classify.train import ClassificationTrainer\n \n import wandb\ndiff --git a/wandb/sdk/launch/utils.py b/wandb/sdk/launch/utils.py\nindex 05efe128e..69f4e57bb 100644\n--- a/wandb/sdk/launch/utils.py\n+++ b/wandb/sdk/launch/utils.py\n@@ -204,10 +204,7 @@ def set_project_entity_defaults(\n config_project = launch_config.get(\"project\")\n project = config_project or source_uri or \"\"\n if entity is None:\n- config_entity = None\n- if launch_config:\n- config_entity = launch_config.get(\"entity\")\n- entity = config_entity or api.default_entity\n+ entity = get_default_entity(api, launch_config)\n prefix = \"\"\n if platform.system() != \"Windows\" and sys.stdout.encoding == \"UTF-8\":\n prefix = \"\ud83d\ude80 \"\n@@ -217,6 +214,13 @@ def set_project_entity_defaults(\n return project, entity\n \n \n+def get_default_entity(api: Api, launch_config: Optional[Dict[str, Any]]):\n+ config_entity = None\n+ if launch_config:\n+ config_entity = launch_config.get(\"entity\")\n+ return config_entity or api.default_entity\n+\n+\n def construct_launch_spec(\n uri: Optional[str],\n job: Optional[str],\n", "difficulty": 0, "changed_files": ["wandb/cli/cli.py", "wandb/integration/ultralytics/bbox_utils.py", "wandb/integration/ultralytics/callback.py", "wandb/integration/yolov8/yolov8.py", "wandb/sdk/launch/utils.py"], "commit_link": "https://github.com/wandb/wandb/tree/077f6aaac3ebb96626ac747fb126a0b4d752489c"} |