Skip to content

Commit 77146db

Browse files
committed
Fix up flake8 issues, terminate tests on flake8 "analyze" target in GNU makefile
1 parent 1c94c66 commit 77146db

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
python3 -m pip install -r requirements-tests.txt
3636
- name: Lint with flake8
3737
run: |
38-
make analyze || true
38+
make analyze
3939
- name: Test with pytest
4040
run: |
4141
make test

slip39/api.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import hdwallet
1919
from hdwallet import cryptocurrencies
2020

21+
from .defaults import BITS_DEFAULT, BITS, MNEM_ROWS_COLS, GROUP_REQUIRED_RATIO, CRYPTO_PATHS
22+
from .util import ordinal
23+
2124
log = logging.getLogger( __package__ )
2225

2326
# Support for private key encryption via BIP-38 and Ethereum JSON wallet is optional; pip install slip39[wallet]
@@ -46,17 +49,13 @@
4649
log.exception( message )
4750
paper_wallet_issues.append( message )
4851

49-
from .defaults import BITS_DEFAULT, BITS, MNEM_ROWS_COLS, GROUP_REQUIRED_RATIO, CRYPTO_PATHS
50-
from .util import ordinal
51-
5252

5353
RANDOM_BYTES = secrets.token_bytes
5454

5555

56-
5756
def paper_wallet_available():
5857
"""Determine if encrypted BIP-38 and Ethereum JSON Paper Wallets are available."""
59-
available = AES and scrypt and eth_account
58+
available = AES and scrypt and eth_account
6059
if not available:
6160
log.warning( f"Paper Wallets unavailable; perhaps run: 'python3 -m pip install slip39[gui,wallet]': {', '.join( paper_wallet_issues )}" )
6261
return available
@@ -161,7 +160,7 @@ class BinanceMainnet( cryptocurrencies.Cryptocurrency ):
161160
DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0"
162161
WIF_SECRET_KEY = 0x80
163162

164-
163+
165164
class Account( hdwallet.HDWallet ):
166165

167166
"""Supports producing Legacy addresses for Bitcoin, and Litecoin. Doge (D...) and Ethereum (0x...)
@@ -348,13 +347,13 @@ def wrapper( self, *args, **kwds ):
348347
symbol = self.hdwallet._cryptocurrency.SYMBOL
349348
try:
350349
self.hdwallet._cryptocurrency.SYMBOL \
351-
= self.CRYPTO_LOCAL_SYMBOL.get( symbol, symbol )
350+
= self.CRYPTO_LOCAL_SYMBOL.get( symbol, symbol ) # noqa: E126
352351
return method( self, *args, **kwds )
353352
finally:
354353
self.hdwallet._cryptocurrency.SYMBOL \
355-
= symbol
354+
= symbol # noqa: E126
356355
return wrapper
357-
356+
358357
@substitute_symbol
359358
def legacy_address( self ):
360359
return self.hdwallet.p2pkh_address()

slip39/generator/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def main( argv=None ):
8585
help="Use the supplied 128-, 256- or 512-bit hex value as the secret seed; '-' (default) reads it from stdin (eg. output from slip39.recover)" )
8686
ap.add_argument( '-f', '--format', action='append',
8787
default=[],
88-
help=f"Specify crypto address formats: {', '.join( Account.FORMATS )}; default: " +', '.join(
89-
f'{c}:{Account.address_format(c)}' for c in Account.CRYPTO_NAMES.values()
88+
help=f"Specify crypto address formats: {', '.join( Account.FORMATS )}; default: " + ', '.join(
89+
f"{c}:{Account.address_format(c)}" for c in Account.CRYPTO_NAMES.values()
9090
))
9191
ap.add_argument( '-c', '--cryptocurrency', action='append',
9292
default=[],

slip39/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def main( argv=None ):
4242
))
4343
ap.add_argument( '-c', '--cryptocurrency', action='append',
4444
default=[],
45-
help=f"A crypto name and optional derivation path (eg. '../<range>/<range>'); defaults: " + ', '.join(
46-
f'{c}:{Account.path_default(c)}' for c in Account.CRYPTO_NAMES.values()
45+
help="A crypto name and optional derivation path (eg. '../<range>/<range>'); defaults: " + ', '.join(
46+
f"{c}:{Account.path_default(c)}" for c in Account.CRYPTO_NAMES.values()
4747
))
4848
ap.add_argument( '-p', '--path',
4949
default=None,

0 commit comments

Comments
 (0)