Skip to content

Commit e0540e3

Browse files
Improve bip32.py type hint (#107)
* ADD. adding mypy to dev-dependency * ADD. targetting Python 3.7 type hint ADD. mypy added to the static analyses step * FIX. correcting Tuple type annotion syntax DELETE. unnecessary conditional check of pnode in the derivation step * REFACTOR. improving derive() method branching self-explanatory * REFACTOR. most of HDWallet attributes can be explicitly typed since they are all required in each derivation step * UPDATE. returning False for is_mnemonic() explicitly * UPDATE. avoid type-converting an already defined variable * UPDATE. including mypy check in Github action ADD. adding a mypy exclude list which will act like a todo list in the future
1 parent f054d47 commit e0540e3

File tree

5 files changed

+166
-96
lines changed

5 files changed

+166
-96
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
- name: Install dependencies
2929
run: |
3030
poetry install
31-
- name: Lint with flake8
31+
- name: Run static analyses
3232
run: |
33-
poetry run flake8 pycardano
33+
make qa
3434
- name: Run unit tests
3535
run: |
3636
poetry run pytest --doctest-modules --ignore=examples --cov=pycardano --cov-config=.coveragerc --cov-report=xml

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ test: ## runs tests
6060
test-single: ## runs tests with "single" markers
6161
poetry run pytest -s -vv -m single
6262

63-
qa: ## runs static analysis with flake8
63+
qa: ## runs static analyses
6464
poetry run flake8 pycardano
65+
poetry run mypy --install-types --non-interactive pycardano
6566

6667
format: ## runs code style and formatter
6768
poetry run isort .

poetry.lock

Lines changed: 77 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)