{"language": "Python", "id": 36, "repo_owner": "lightly-ai", "repo_name": "lightly", "head_branch": "master", "workflow_name": "Code Format Check", "workflow_filename": "test_code_format.yml", "workflow_path": ".github/workflows/test_code_format.yml", "contributor": "jameschapman19", "sha_fail": "9261583aece340e8b1ee2f06c68f017ce8da468c", "sha_success": "e8e30547893c2979e648108284c17d8ca8ec2995", "workflow": "name: Code Format Check\n\non:\n push:\n pull_request:\n workflow_dispatch:\n\njobs:\n test:\n name: Check\n runs-on: ubuntu-latest\n steps:\n - name: Checkout Code\n uses: actions/checkout@v3\n - name: Hack to get setup-python to work on nektos/act\n run: |\n if [ ! -f \"/etc/lsb-release\" ] ; then\n echo \"DISTRIB_RELEASE=18.04\" > /etc/lsb-release\n fi\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: \"3.7\"\n - uses: actions/cache@v2\n with:\n path: ${{ env.pythonLocation }}\n key: cache_v2_${{ env.pythonLocation }}-${{ hashFiles('requirements/**') }}\n - name: Install Dependencies and lightly\n run: pip install -e '.[all]'\n - name: Run Format Check\n run: |\n make format-check\n - name: Run Type Check\n run: |\n make type-check\n", "logs": [{"step_name": "Check/8_Run Type Check.txt", "log": "##[group]Run make type-check\n\u001b[36;1mmake type-check\u001b[0m\nshell: /usr/bin/bash -e {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.7.17/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib\n##[endgroup]\nmypy lightly tests\nlightly/loss/ssley_loss.py:6: note: In module imported here:\nlightly/utils/dist.py: note: In class \"GatherLayer\":\nlightly/utils/dist.py:19: error: Signature of \"forward\" incompatible with supertype \"Function\" [override]\nlightly/utils/dist.py:19: note: Error code \"override\" not covered by \"type: ignore\" comment\nlightly/utils/dist.py:19: note: Superclass:\nlightly/utils/dist.py:19: note: @staticmethod\nlightly/utils/dist.py:19: note: def forward(ctx: Any, *args: Any, **kwargs: Any) -> Any\nlightly/utils/dist.py:19: note: Subclass:\nlightly/utils/dist.py:19: note: @staticmethod\nlightly/utils/dist.py:19: note: def forward(ctx: Any, input: Tensor) -> tuple[Tensor, ...]\nFound 1 error in 1 file (checked 362 source files)\nmake: *** [Makefile:68: type-check] Error 1\n##[error]Process completed with exit code 2.\n"}], "diff": "diff --git a/lightly/utils/dist.py b/lightly/utils/dist.py\nindex f44df6b9..88407556 100644\n--- a/lightly/utils/dist.py\n+++ b/lightly/utils/dist.py\n@@ -14,9 +14,11 @@ class GatherLayer(Function):\n \n \"\"\"\n \n- # Type ignore is required because superclass uses Any type for ctx.\n+ # Type ignore misc is required because the superclass uses Any type for ctx.\n+ # Type ignore override is required because the superclass has a different signature\n+ # for forward.\n @staticmethod\n- def forward(ctx: Any, input: Tensor) -> Tuple[Tensor, ...]: # type: ignore[misc]\n+ def forward(ctx: Any, input: Tensor) -> Tuple[Tensor, ...]: # type: ignore[misc, override]\n ctx.save_for_backward(input)\n output = [torch.empty_like(input) for _ in range(dist.get_world_size())]\n dist.all_gather(output, input)\n", "difficulty": 1, "changed_files": ["lightly/utils/dist.py"], "commit_link": "https://github.com/lightly-ai/lightly/tree/9261583aece340e8b1ee2f06c68f017ce8da468c"}