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

Rewrite library #12

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8b482ab
Reformat with black
sterliakov Apr 29, 2022
13df445
Fix basic code style
sterliakov Apr 29, 2022
de48ff5
Support tuples in Function.decode
sterliakov Apr 29, 2022
977f81b
Support tuples and dynamic arrays, including hashed event parameters
sterliakov Apr 30, 2022
7e27a09
Better coverage config, deprecation code doesn't need to be tested
sterliakov Apr 30, 2022
156a01d
Lint with flake8, add hooks
sterliakov Apr 30, 2022
1341e8f
Update requirements, separate dev_requirements
sterliakov Apr 30, 2022
369ba26
Lint
sterliakov Apr 30, 2022
cc179f7
Better lint
sterliakov Apr 30, 2022
da6b28b
Make library pass type checking
sterliakov May 1, 2022
21fd646
Switch to modern PEP518 (PEP621) pyproject.toml to keep all configs a…
sterliakov May 2, 2022
ad68ee3
Better exceptions, use fixtures in tests
sterliakov May 4, 2022
9a2fdb1
Better typing
sterliakov May 4, 2022
4fecec8
Fix and lint existing docstrings
sterliakov May 4, 2022
97eadc3
Move utils back to cry for backwards-compat. Use absolute import
sterliakov May 4, 2022
1fab3cf
Remove darglint artifact
sterliakov May 4, 2022
b34c5c8
Better docs.
sterliakov May 5, 2022
b20a703
Fix tests to use fixtures
sterliakov May 5, 2022
1fcf325
Fix deprecation message
sterliakov May 5, 2022
8b31a3e
Cleaner recursive type
sterliakov May 5, 2022
c410591
Start documentation building
sterliakov May 7, 2022
b40ad32
Document TypedDict fields
sterliakov May 7, 2022
21b198d
Better deprecation handling
sterliakov May 7, 2022
d91bbcb
Fix TypedDict representation in docs
sterliakov May 8, 2022
779c0d2
Fight bad ``black`` formatting decision
sterliakov May 8, 2022
0605265
Enforce stricter validation with `voluptuous`
sterliakov May 9, 2022
55a2d65
Restrict certificate purpose, better docs
sterliakov May 9, 2022
2a7e6ca
Fix mistake in validation
sterliakov May 9, 2022
6da875c
Better docs.
sterliakov May 9, 2022
70bd02d
Add convenience methods to Event and Function ABI, refactor
sterliakov May 11, 2022
b111faf
Fix documentation hell
sterliakov May 11, 2022
554123d
Fix docstrings
sterliakov May 11, 2022
5621aa3
Fix members order
sterliakov May 11, 2022
89629a5
Improve coverage. Use better abstract layout for RLP
sterliakov May 12, 2022
c1baa6b
Improve workflows
sterliakov May 12, 2022
323ba51
Fix workflow
sterliakov May 12, 2022
de43d1e
Support tox
sterliakov May 12, 2022
f566267
Remove 3.11 that does not work yet (headers missing)
sterliakov May 12, 2022
cae6fe9
Minor cleanup
sterliakov May 13, 2022
6723899
Add solidity binding
sterliakov May 14, 2022
910bade
Add installation
sterliakov May 14, 2022
850c2f8
Add installation
sterliakov May 14, 2022
51e2879
Fix compatibility
sterliakov May 14, 2022
d459577
Update README
sterliakov May 14, 2022
19e2ad5
Fix typo
sterliakov May 14, 2022
de8c197
Prepare to deploy to rtd
sterliakov May 14, 2022
625370c
Fix typo
sterliakov May 14, 2022
5a48369
Update README
sterliakov May 14, 2022
f74c593
Replace HDNode attribute getters with properties
sterliakov May 14, 2022
e337bb4
Use repl in README
sterliakov May 14, 2022
ac22385
Better examples.
sterliakov May 14, 2022
4ef5f9f
Fix missing docs
sterliakov May 14, 2022
7b091db
Add installation docs.
sterliakov May 15, 2022
e07300e
Minor fixes
sterliakov May 15, 2022
29323c0
Remove outdated parts
sterliakov May 15, 2022
2b99cf0
Better inheritance support
sterliakov May 15, 2022
83bb1da
Fix typo.
sterliakov May 15, 2022
8cdf4b4
Add name filtering to `from_solidity` methods
sterliakov May 16, 2022
eab77d4
Support newer bip_utils
sterliakov May 16, 2022
ebe6e7c
Small cleanup
sterliakov May 16, 2022
b594f9d
Suport ABI constructor encoding.
sterliakov May 16, 2022
a014c63
Update docs
sterliakov May 17, 2022
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
12 changes: 6 additions & 6 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
@@ -15,18 +15,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -U pip setuptools wheel
pip install -e .[test]
- name: Test with pytest
run: |
python3 -m pytest -vv -s
pytest -vv -s
- name: Create Release
id: create_release
uses: actions/create-release@v1
@@ -36,4 +36,4 @@ jobs:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
prerelease: false
72 changes: 62 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -2,28 +2,80 @@ name: Pull Request & Push to Master Branch

on:
push:
branches: [ master ]
branches:
master
pull_request:
branches: [ master ]
branches:
master
workflow_dispatch:

jobs:
build:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install .[test]
pip install pre-commit
- name: Run pre-commit
run: |
pre-commit install
# python<3.7 uses older flake8 version, that reports errors on decorator line
# instead of def line. We cannot satisfy both, just ignore legacy and old.
if [ $(python -V | cut -d. -f2) -le 7 ]
then
SKIP="pytest,pyproject-flake8" pre-commit run --all-files -v
else
SKIP="pytest" pre-commit run --all-files -v
fi;

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
pip install -U pip setuptools wheel
pip install .[test]
- name: Run pytest
run: |
pytest -vv -s

docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -e .[docs]
- name: Make docs
run: |
python3 -m pytest -vv -s
cd docs
make clean html
sphinx-build -b linkcheck source build/linkcheck
63 changes: 63 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.9.3
hooks:
- id: isort
name: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/csachs/pyproject-flake8
rev: v0.0.1a4
hooks:
- id: pyproject-flake8
name: flake8
additional_dependencies: [
'flake8-docstrings',
'flake8-rst-docstrings',
'flake8-2020',
'flake8-alfred',
'flake8-broken-line',
'flake8-bugbear',
'flake8-builtins',
'flake8-debugger',
'flake8-noqa',
'flake8-pep3101',
'flake8-pie',
'flake8-pytest',
'flake8-pytest-style',
'flake8-simplify',
'pep8-naming',
]
- repo: local
hooks:
# We could use mypy-mirror, but it has some unconvenient limitations.
- id: doctest
name: doctest
entry: python -m doctest
language: system
files: "README.md"
- id: mypy
name: mypy
entry: mypy --config=pyproject.toml --cache-dir=/dev/null --no-incremental
language: system
types: [ python ]
exclude: "docs/*"
- id: pytest
name: pytest
entry: pytest -vv -s
language: system
types: [ python ]
pass_filenames: false
exclude: "setup.py"
always_run: true
21 changes: 21 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2
build:
os: ubuntu-20.04
tools:
python: "3.10"
apt_packages:
- graphviz

sphinx:
configuration: docs/source/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
- test
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
install:
python3 -m venv .env
. .env/bin/activate && pip3 install -r requirements.txt
. .env/bin/activate && python3 -m pip install -e .
pre-commit install

test:
. .env/bin/activate && python3 -m pytest --cov=thor_devkit --no-cov-on-fail --cov-report=term-missing -vv -s
. .env/bin/activate && python3 -m pytest -vv -s

publish: test
rm -rf dist/*
. .env/bin/activate && python3 setup.py sdist bdist_wheel
. .env/bin/activate && python3 -m twine upload dist/*
. .env/bin/activate \
&& python3 setup.py sdist bdist_wheel \
&& python3 -m twine upload dist/*
Loading