File size: 11,226 Bytes
7b61cd4
1
{"language": "Python", "id": 18, "repo_owner": "scrapy", "repo_name": "scrapy", "head_branch": "component-getters", "workflow_name": "Checks", "workflow_filename": "checks.yml", "workflow_path": ".github/workflows/checks.yml", "contributor": "Gallaecio", "sha_fail": "0f71221cf9875ed8ef3400e1008408e79b6691e6", "sha_success": "c1ba9ccdf916b89d875628ba143dc5c9f6977430", "workflow": "name: Checks\non: [push, pull_request]\n\nconcurrency:\n  group: ${{github.workflow}}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  checks:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        include:\n        - python-version: \"3.12\"\n          env:\n            TOXENV: pylint\n        - python-version: 3.8\n          env:\n            TOXENV: typing\n        - python-version: \"3.11\"  # Keep in sync with .readthedocs.yml\n          env:\n            TOXENV: docs\n        - python-version: \"3.12\"\n          env:\n            TOXENV: twinecheck\n\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Set up Python ${{ matrix.python-version }}\n      uses: actions/setup-python@v4\n      with:\n        python-version: ${{ matrix.python-version }}\n\n    - name: Run check\n      env: ${{ matrix.env }}\n      run: |\n        pip install -U tox\n        tox\n\n  pre-commit:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - uses: pre-commit/[email protected]\n", "logs": [{"step_name": "checks (3.12, pylint)/4_Run check.txt", "log": "##[group]Run pip install -U tox\n\u001b[36;1mpip install -U tox\u001b[0m\n\u001b[36;1mtox\u001b[0m\nshell: /usr/bin/bash -e {0}\nenv:\n  pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib/pkgconfig\n  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.1/x64\n  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.1/x64\n  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.1/x64\n  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n  TOXENV: pylint\n##[endgroup]\nCollecting tox\n  Downloading tox-4.11.4-py3-none-any.whl.metadata (5.0 kB)\nCollecting cachetools>=5.3.1 (from tox)\n  Downloading cachetools-5.3.2-py3-none-any.whl.metadata (5.2 kB)\nCollecting chardet>=5.2 (from tox)\n  Downloading chardet-5.2.0-py3-none-any.whl.metadata (3.4 kB)\nCollecting colorama>=0.4.6 (from tox)\n  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\nCollecting filelock>=3.12.3 (from tox)\n  Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)\nCollecting packaging>=23.1 (from tox)\n  Downloading packaging-23.2-py3-none-any.whl.metadata (3.2 kB)\nCollecting platformdirs>=3.10 (from tox)\n  Downloading platformdirs-4.1.0-py3-none-any.whl.metadata (11 kB)\nCollecting pluggy>=1.3 (from tox)\n  Downloading pluggy-1.3.0-py3-none-any.whl.metadata (4.3 kB)\nCollecting pyproject-api>=1.6.1 (from tox)\n  Downloading pyproject_api-1.6.1-py3-none-any.whl.metadata (2.8 kB)\nCollecting virtualenv>=20.24.3 (from tox)\n  Downloading virtualenv-20.25.0-py3-none-any.whl.metadata (4.5 kB)\nCollecting distlib<1,>=0.3.7 (from virtualenv>=20.24.3->tox)\n  Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)\nDownloading tox-4.11.4-py3-none-any.whl (153 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 154.0/154.0 kB 16.6 MB/s eta 0:00:00\nDownloading cachetools-5.3.2-py3-none-any.whl (9.3 kB)\nDownloading chardet-5.2.0-py3-none-any.whl (199 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 199.4/199.4 kB 48.7 MB/s eta 0:00:00\nDownloading filelock-3.13.1-py3-none-any.whl (11 kB)\nDownloading packaging-23.2-py3-none-any.whl (53 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 53.0/53.0 kB 16.1 MB/s eta 0:00:00\nDownloading platformdirs-4.1.0-py3-none-any.whl (17 kB)\nDownloading pluggy-1.3.0-py3-none-any.whl (18 kB)\nDownloading pyproject_api-1.6.1-py3-none-any.whl (12 kB)\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 104.2 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.3 MB/s eta 0:00:00\nInstalling collected packages: distlib, pluggy, platformdirs, packaging, filelock, colorama, chardet, cachetools, virtualenv, pyproject-api, tox\nSuccessfully installed cachetools-5.3.2 chardet-5.2.0 colorama-0.4.6 distlib-0.3.8 filelock-3.13.1 packaging-23.2 platformdirs-4.1.0 pluggy-1.3.0 pyproject-api-1.6.1 tox-4.11.4 virtualenv-20.25.0\n\n[notice] A new release of pip is available: 23.3.1 -> 23.3.2\n[notice] To update, run: pip install --upgrade pip\npylint: install_deps> python -I -m pip install -ctests/upper-constraints.txt boto3 google-cloud-storage 'markupsafe<2.1.0' 'mitmproxy<8,>=4.0.4; python_version < \"3.9\" and implementation_name != \"pypy\"' Pillow pylint==3.0.1 robotexclusionrulesparser 'Twisted[http2]' -r tests/requirements.txt\n.pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel\n.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__\n.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__\n.pkg: get_requires_for_build_wheel> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__\n.pkg: install_requires_for_build_wheel> python -I -m pip install wheel\n.pkg: freeze> python -m pip freeze --all\n.pkg: pip==23.3.1,setuptools==69.0.2,wheel==0.42.0\n.pkg: prepare_metadata_for_build_wheel> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__\n.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__\npylint: install_package_deps> python -I -m pip install -ctests/upper-constraints.txt 'PyDispatcher>=2.0.5; platform_python_implementation == \"CPython\"' 'PyPyDispatcher>=2.1.0; platform_python_implementation == \"PyPy\"' 'Twisted>=18.9.0' 'cryptography>=36.0.0' 'cssselect>=0.9.1' 'itemadapter>=0.1.0' 'itemloaders>=1.0.1' 'lxml>=4.4.1' packaging 'parsel>=1.5.0' 'protego>=0.1.15' 'pyOpenSSL>=21.0.0' 'queuelib>=1.4.2' 'service-identity>=18.1.0' setuptools tldextract 'w3lib>=1.17.0' 'zope.interface>=5.1.0'\npylint: install_package> python -I -m pip install -ctests/upper-constraints.txt --force-reinstall --no-deps /home/runner/work/scrapy/scrapy/.tox/.tmp/package/1/Scrapy-2.11.0.tar.gz\npylint: freeze> python -m pip freeze --all\npylint: astroid==3.0.2,asttokens==2.4.1,attrs==23.1.0,Automat==22.10.0,blessed==1.20.0,boto3==1.34.3,botocore==1.34.3,bpython==0.24,Brotli==1.1.0,cachetools==5.3.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,constantly==23.10.4,coverage==7.3.3,cryptography==41.0.7,cssselect==1.2.0,curtsies==0.4.2,cwcwidth==0.1.9,decorator==5.1.1,dill==0.3.7,execnet==2.0.2,executing==2.0.1,filelock==3.13.1,google-api-core==2.15.0,google-auth==2.25.2,google-cloud-core==2.4.1,google-cloud-storage==2.14.0,google-crc32c==1.5.0,google-resumable-media==2.7.0,googleapis-common-protos==1.62.0,greenlet==3.0.2,h2==4.1.0,hpack==4.0.0,hyperframe==6.0.1,hyperlink==21.0.0,idna==3.6,incremental==22.10.0,iniconfig==2.0.0,ipython==8.18.1,isort==5.13.2,itemadapter==0.8.0,itemloaders==1.1.0,jedi==0.19.1,jmespath==1.0.1,lxml==4.9.3,MarkupSafe==2.0.1,matplotlib-inline==0.1.6,mccabe==0.7.0,packaging==23.2,parsel==1.8.1,parso==0.8.3,pexpect==4.9.0,Pillow==10.1.0,pip==23.3.2,platformdirs==4.1.0,pluggy==1.3.0,priority==1.3.0,prompt-toolkit==3.0.43,Protego==0.3.0,protobuf==4.25.1,ptyprocess==0.7.0,pure-eval==0.2.2,pyasn1==0.5.1,pyasn1-modules==0.3.0,pycparser==2.21,PyDispatcher==2.0.7,pyftpdlib==1.5.9,Pygments==2.17.2,pylint==3.0.1,pyOpenSSL==23.3.0,pytest==7.4.3,pytest-cov==4.0.0,pytest-xdist==3.5.0,python-dateutil==2.8.2,pyxdg==0.28,queuelib==1.6.2,requests==2.31.0,requests-file==1.5.1,robotexclusionrulesparser==1.7.1,rsa==4.9,s3transfer==0.9.0,Scrapy @ file:///home/runner/work/scrapy/scrapy/.tox/.tmp/package/1/Scrapy-2.11.0.tar.gz#sha256=6f43aa5d37ec10736bd947dbba89df54ebc97175083ab360a721b3360f0d895b,service-identity==23.1.0,setuptools==69.0.2,six==1.16.0,stack-data==0.6.3,sybil==6.0.2,testfixtures==7.2.2,tldextract==5.1.1,tomlkit==0.12.3,traitlets==5.14.0,Twisted==23.10.0,typing_extensions==4.9.0,urllib3==2.0.7,uvloop==0.19.0,w3lib==2.1.2,wcwidth==0.2.12,zope.interface==6.1,zstandard==0.22.0\npylint: commands[0]> pylint conftest.py docs extras scrapy setup.py tests\n<unknown>:230: SyntaxWarning: invalid escape sequence '\\d'\n************* Module scrapy.crawler\nscrapy/crawler.py:182:4: W0211: Static method with 'cls' as first argument (bad-staticmethod-argument)\nscrapy/crawler.py:184:15: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)\n\n------------------------------------\nYour code has been rated at 10.00/10\n\npylint: exit 20 (56.60 seconds) /home/runner/work/scrapy/scrapy> pylint conftest.py docs extras scrapy setup.py tests pid=2086\n.pkg: _exit> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__\n  pylint: FAIL code 20 (100.72=setup[44.12]+cmd[56.60] seconds)\n  evaluation failed :( (100.86 seconds)\n##[error]Process completed with exit code 20.\n"}], "diff": "diff --git a/scrapy/crawler.py b/scrapy/crawler.py\nindex 76f4048e4..333b39f33 100644\n--- a/scrapy/crawler.py\n+++ b/scrapy/crawler.py\n@@ -179,9 +179,12 @@ class Crawler:\n             yield maybeDeferred(self.engine.stop)\n \n     @staticmethod\n-    def _get_component(cls, components):\n+    def _get_component(component_class, components):\n         for component in components:\n-            if type(component) is cls:\n+            if (\n+                type(component)  # pylint: disable=unidiomatic-typecheck\n+                is component_class\n+            ):\n                 return component\n         return None\n \n", "difficulty": "1"}