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

Add flake8 for lint, 0.4.1 #29

Merged
merged 4 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python API CLI (3.8 - 3.12)
name: API & CLI, Py 3.8 - 3.12

on: [pull_request]

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ uninstall-dev:
lint:
isort .
black .
flake8 . --ignore=E501,W503
actionlint
checkmake Makefile

Expand Down
1 change: 0 additions & 1 deletion src/bipsea/bip32.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import hashlib
import hmac
import logging
import warnings
from typing import List

from ecdsa import SECP256k1, SigningKey, VerifyingKey
Expand Down
2 changes: 1 addition & 1 deletion src/bipsea/bip85.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def apply_85(derived_key: ExtendedKey, path: str) -> Dict[str, Union[bytes, str]
if app == APPLICATIONS["words"]:
language_index, n_words = indexes[:2]
n_words = int(n_words[:-1]) # chop the ' from hardened derivation
if not n_words in N_WORDS_META.keys():
if n_words not in N_WORDS_META.keys():
raise ValueError(f"Unsupported number of words: {n_words}.")
language = INDEX_TO_LANGUAGE[language_index]
n_bytes = N_WORDS_META[n_words]["entropy_bits"] // 8
Expand Down
1 change: 1 addition & 0 deletions src/bipsea/bipsea.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
TIMEOUT = 0.1

N_WORDS_ALLOWED_STR = [str(n) for n in N_WORDS_ALLOWED]
N_WORDS_ALLOWED_HELP = "|".join(N_WORDS_ALLOWED_STR)


logger = logging.getLogger(LOGGER)
Expand Down
2 changes: 1 addition & 1 deletion src/bipsea/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from collections import Counter
from typing import List, Sequence

__version__ = "0.4.0"
__version__ = "0.4.1"
__app_name__ = "bipsea"

LOGGER = __app_name__
Expand Down
3 changes: 0 additions & 3 deletions tests/test_bip39.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import hashlib
import logging
import re
import warnings
from unicodedata import is_normalized

import pytest
import requests
from data.bip39_vectors import VECTORS

from bipsea.bip32 import to_master_key
Expand Down
9 changes: 1 addition & 8 deletions tests/test_bip85.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@

from bipsea.bip32types import parse_ext_key
from bipsea.bip39 import LANGUAGES, verify_seed_words
from bipsea.bip85 import (
DRNG,
INDEX_TO_LANGUAGE,
apply_85,
derive,
to_entropy,
to_hex_string,
)
from bipsea.bip85 import DRNG, INDEX_TO_LANGUAGE, apply_85, derive, to_entropy
from bipsea.util import LOGGER, to_hex_string

logger = logging.getLogger(LOGGER)
Expand Down
1 change: 1 addition & 0 deletions tst-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
black>=24.4.2
build>=1.2.1
flake8>=7.0.0
isort>=5.13.2
pytest>=8.2.1
requests>=2.32.2
Expand Down