Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests][Scripts] Bump Python version to 3.8 and add more linting #2877

Merged
merged 16 commits into from
Aug 22, 2023

Commits on Aug 17, 2023

  1. test: Remove python3.4 workaround in feature_dbcrash

    MarcoFalke authored and Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    f46217b View commit details
    Browse the repository at this point in the history
  2. Strictly enforce instance attrs in critical functional test classes.

    Additionally, removed redundant parentheses and added PEP-8 compliant
    spacing around those classes.
    JustinTArthur authored and Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    a560910 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    036ab88 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    457f2a8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5619891 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8c0dd38 View commit details
    Browse the repository at this point in the history
  7. scripts: exclude wallet_bumpfee.py from linting

    this is a test that we don't actually support at the moment.
    Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    19862fd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    77b42a2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ef83f5b View commit details
    Browse the repository at this point in the history
  10. scripted-diff: test: Remove brackets after assert

    -BEGIN VERIFY SCRIPT-
    sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test)
    -END VERIFY SCRIPT-
    Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    07d1c56 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6f822ae View commit details
    Browse the repository at this point in the history
  12. scripts: clean github-merge.py and symbol-check.py

    clean both files to adhere to flake8 standards.
    Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    c757ce3 View commit details
    Browse the repository at this point in the history
  13. lint: more python linting

    Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    139ae9d View commit details
    Browse the repository at this point in the history
  14. scripted-diff: test: Use py3.5 bytes::hex() method

    -BEGIN VERIFY SCRIPT-
    sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str)
    
    export RE_B_0="[^()]*"                          # match no bracket
    export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one ()
    export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (())
    
    export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)"
    
    sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g"      $(git grep -l -E '(b2x|bytes_to_hex_str)')
    
    sed -i --regexp-extended -e "/  +bytes_to_hex_str( as b2x)?,/d"    $(git grep -l bytes_to_hex_str)
    sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g"   $(git grep -l bytes_to_hex_str)
    sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g"    $(git grep -l bytes_to_hex_str)
    
    export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)"
    
    sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share')
    
    sed -i --regexp-extended -e  "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share')
    sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share')
    
    sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh
    -END VERIFY SCRIPT-
    Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    ec22835 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    17bc5bf View commit details
    Browse the repository at this point in the history
  16. Bump python version to 3.8

    Fuzzbawls committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    c340533 View commit details
    Browse the repository at this point in the history