`test/lint/lint-python.py` thinks flake8 is not installed when it actually is #26792

issue kristapsk opened this issue on January 2, 2023
  1. kristapsk commented at 4:40 PM on January 2, 2023: contributor
    $ ./test/lint/lint-python.py 
    Skipping Python linting since flake8 is not installed.
    $ flake8 --version
    5.0.4 (mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes: 2.5.0) CPython 3.10.9 on Linux
    

    If I try old lint-python.sh, it works.

  2. kristapsk added the label Bug on Jan 2, 2023
  3. jonatack commented at 6:42 PM on January 2, 2023: contributor

    Out of curiosity, do you still see the issue with the change at #26257? (Will rebase it.) Perhaps the dependencies need updating. Also, what is the result of running uname -a?

  4. kristapsk commented at 6:49 PM on January 2, 2023: contributor

    Also, what is the result of running uname -a?

    It's Linux on x86_64 (Gentoo).

  5. maflcko commented at 9:17 AM on January 3, 2023: member

    Previously the check was done with command flake8, now it is done via import pkg_resources

  6. maflcko added the label Tests on Jan 3, 2023
  7. maflcko commented at 9:26 AM on January 3, 2023: member

    Unrelated: You'll need the version specified in the script. Currently, flake8==4.0.1

  8. kristapsk commented at 9:38 AM on January 3, 2023: contributor

    Figured out what's happening. I have Python 3.8, 3.9 and 3.10 present in the system. The default is set to 3.8, but flake8 was installed only for 3.9 and 3.10. Also, flake8 5.0.4 works, but gives lots of E275 errors.

    $ eselect python list
    Available Python interpreters, in order of preference:
      [1]   python3.8
      [2]   python3.10
      [3]   python3.9
    $ python --version
    Python 3.8.15
    $ sudo emerge -pv flake8
    
    These are the packages that would be merged, in order:
    
    Calculating dependencies... done!
    [ebuild   R    ] dev-python/flake8-5.0.4::gentoo  USE="-doc -test" PYTHON_TARGETS="python3_9 python3_10 (-pypy3) -python3_8 -python3_11" 0 KiB
    
    Total: 1 package (1 reinstall), Size of downloads: 0 KiB
    
    $ python test/lint/lint-python.py 
    Skipping Python linting since flake8 is not installed.
    $ python3.10 test/lint/lint-python.py 
    contrib/linearize/linearize-hashes.py:81:19: E275 missing whitespace after keyword
    contrib/seeds/generate-seeds.py:73:23: E275 missing whitespace after keyword
    contrib/seeds/generate-seeds.py:79:15: E275 missing whitespace after keyword
    test/functional/feature_coinstatsindex.py:224:15: E275 missing whitespace after keyword
    test/functional/feature_coinstatsindex.py:271:15: E275 missing whitespace after keyword
    test/functional/feature_coinstatsindex.py:276:15: E275 missing whitespace after keyword
    test/functional/feature_index_prune.py:65:19: E275 missing whitespace after keyword
    test/functional/feature_index_prune.py:83:19: E275 missing whitespace after keyword
    test/functional/feature_index_prune.py:90:19: E275 missing whitespace after keyword
    test/functional/interface_usdt_utxocache.py:360:19: E275 missing whitespace after keyword
    test/functional/interface_usdt_utxocache.py:361:19: E275 missing whitespace after keyword
    test/functional/interface_usdt_validation.py:115:19: E275 missing whitespace after keyword
    test/functional/mempool_fee_histogram.py:38:15: E275 missing whitespace after keyword
    test/functional/mocks/invalid_signer.py:13:7: E275 missing whitespace after keyword
    test/functional/mocks/signer.py:13:7: E275 missing whitespace after keyword
    test/functional/p2p_addr_relay.py:52:15: E275 missing whitespace after keyword
    test/functional/p2p_blocksonly.py:107:15: E275 missing whitespace after keyword
    test/functional/p2p_getaddr_caching.py:63:15: E275 missing whitespace after keyword
    test/functional/p2p_getaddr_caching.py:88:23: E275 missing whitespace after keyword
    test/functional/p2p_getaddr_caching.py:89:23: E275 missing whitespace after keyword
    test/functional/p2p_getaddr_caching.py:90:23: E275 missing whitespace after keyword
    test/functional/p2p_getaddr_caching.py:122:15: E275 missing whitespace after keyword
    test/functional/p2p_getaddr_caching.py:123:15: E275 missing whitespace after keyword
    test/functional/p2p_getaddr_caching.py:124:15: E275 missing whitespace after keyword
    test/functional/p2p_headers_sync_with_minchainwork.py:60:19: E275 missing whitespace after keyword
    test/functional/p2p_headers_sync_with_minchainwork.py:72:19: E275 missing whitespace after keyword
    test/functional/p2p_headers_sync_with_minchainwork.py:92:15: E275 missing whitespace after keyword
    test/functional/p2p_message_capture.py:39:15: E275 missing whitespace after keyword
    test/functional/p2p_message_capture.py:47:19: E275 missing whitespace after keyword
    test/functional/rpc_blockchain.py:373:15: E275 missing whitespace after keyword
    test/functional/rpc_rawtransaction.py:219:19: E275 missing whitespace after keyword
    test/functional/rpc_rawtransaction.py:221:23: E275 missing whitespace after keyword
    test/functional/rpc_rawtransaction.py:222:23: E275 missing whitespace after keyword
    test/functional/rpc_rawtransaction.py:224:23: E275 missing whitespace after keyword
    test/functional/rpc_rawtransaction.py:225:23: E275 missing whitespace after keyword
    test/functional/rpc_rawtransaction.py:238:15: E275 missing whitespace after keyword
    test/functional/rpc_rawtransaction.py:242:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:49:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:59:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:63:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:67:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:71:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:75:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:92:15: E275 missing whitespace after keyword
    test/functional/rpc_scanblocks.py:94:15: E275 missing whitespace after keyword
    test/functional/test_framework/key.py:142:15: E275 missing whitespace after keyword
    test/functional/test_framework/key.py:265:15: E275 missing whitespace after keyword
    test/functional/test_framework/key.py:279:15: E275 missing whitespace after keyword
    test/functional/test_framework/key.py:352:15: E275 missing whitespace after keyword
    test/functional/test_framework/key.py:365:15: E275 missing whitespace after keyword
    test/functional/test_framework/key.py:378:15: E275 missing whitespace after keyword
    test/functional/test_framework/key.py:391:15: E275 missing whitespace after keyword
    test/functional/test_framework/script.py:827:15: E275 missing whitespace after keyword
    test/functional/test_framework/script.py:830:15: E275 missing whitespace after keyword
    test/functional/test_framework/siphash.py:34:11: E275 missing whitespace after keyword
    test/functional/test_framework/siphash.py:64:11: E275 missing whitespace after keyword
    test/functional/wallet_avoidreuse.py:198:15: E275 missing whitespace after keyword
    test/functional/wallet_backwards_compatibility.py:196:35: E275 missing whitespace after keyword
    test/functional/wallet_backwards_compatibility.py:202:35: E275 missing whitespace after keyword
    test/functional/wallet_backwards_compatibility.py:204:31: E275 missing whitespace after keyword
    test/functional/wallet_backwards_compatibility.py:207:31: E275 missing whitespace after keyword
    test/functional/wallet_bumpfee.py:560:11: E275 missing whitespace after keyword
    test/functional/wallet_implicitsegwit.py:39:19: E275 missing whitespace after keyword
    test/functional/wallet_importdescriptors.py:490:15: E275 missing whitespace after keyword
    test/functional/wallet_importdescriptors.py:491:15: E275 missing whitespace after keyword
    test/functional/wallet_reorgsrestore.py:97:15: E275 missing whitespace after keyword
    test/functional/wallet_reorgsrestore.py:101:15: E275 missing whitespace after keyword
    test/functional/wallet_send.py:282:15: E275 missing whitespace after keyword
    test/functional/wallet_send.py:286:15: E275 missing whitespace after keyword
    test/functional/wallet_signer.py:177:15: E275 missing whitespace after keyword
    test/functional/wallet_signer.py:206:15: E275 missing whitespace after keyword
    test/functional/wallet_signer.py:215:15: E275 missing whitespace after keyword
    test/functional/wallet_signer.py:221:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:247:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:263:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:265:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:287:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:289:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:305:19: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:310:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:332:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:334:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:336:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:338:15: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:341:19: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:378:19: E275 missing whitespace after keyword
    test/functional/wallet_taproot.py:386:15: E275 missing whitespace after keyword
    
  9. fanquake commented at 9:42 AM on January 3, 2023: member

    You'll need the version specified in the script. Currently, flake8==4.0.1

    Closing as this isn't an issue. If you want to run the linters, you need to use the same versions of dependencies as the CI. We cannot gaurantee that any other versions will "work".

  10. fanquake closed this on Jan 3, 2023

  11. maflcko referenced this in commit 4bb840a453 on Jan 4, 2023
  12. sidhujag referenced this in commit 3eb0157842 on Jan 4, 2023
  13. bitcoin locked this on Jan 3, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 03:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me