forked from andelf/tronpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Circleci setup * bump * bump * bump * Bump * Install test requirements * Add tests * More improvements * Fix linting issues * Disable mypy for now
- Loading branch information
1 parent
8761f36
commit 02af96d
Showing
21 changed files
with
434 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
bitcartcc: bitcartcc/bitcartcc-shared@1 | ||
|
||
executors: | ||
main-executor: | ||
parameters: | ||
v: | ||
type: string | ||
default: "3.8" | ||
|
||
docker: | ||
- image: cimg/python:<< parameters.v >> | ||
|
||
environment: | ||
TEST_ARGS: "--junitxml test-results/pytest/coverage.xml --cov-report html:coverage" | ||
|
||
commands: | ||
install_dependencies: | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ .Branch }}-{{ checksum "~/.pyenv/version" }}-{{ checksum "setup.py" }}-{{ checksum "test-requirements.txt" }} | ||
|
||
- run: | ||
name: install library | ||
command: | | ||
virtualenv ~/venv | ||
echo ". ~/venv/bin/activate" >> $BASH_ENV | ||
source $BASH_ENV | ||
pip install -U . | ||
pip install -U -r test-requirements.txt | ||
- save_cache: | ||
paths: | ||
- ~/venv | ||
key: v1-dependencies-{{ .Branch }}-{{ checksum "~/.pyenv/version" }}-{{ checksum "setup.py" }}-{{ checksum "test-requirements.txt" }} | ||
|
||
upload-results: | ||
steps: | ||
- store_test_results: | ||
path: test-results | ||
|
||
- store_artifacts: | ||
path: coverage | ||
|
||
- store_artifacts: | ||
path: test-results | ||
|
||
jobs: | ||
test: | ||
parameters: | ||
v: | ||
type: string | ||
|
||
executor: | ||
name: main-executor | ||
v: << parameters.v >> | ||
|
||
environment: | ||
PYTHON: << parameters.v >> | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- checkout | ||
|
||
- install_dependencies | ||
|
||
- run: | ||
name: run fast tests | ||
command: | | ||
make lint | ||
make test | ||
- upload-results | ||
|
||
workflows: | ||
version: 2 | ||
test_and_deploy: | ||
jobs: | ||
- test: | ||
name: test-<< matrix.v >> | ||
matrix: | ||
parameters: | ||
v: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[flake8] | ||
max-complexity=11 | ||
max-line-length=127 | ||
ignore=E266, E203, W503 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
all: ci | ||
|
||
lint: | ||
flake8 | ||
# mypy tronpy | ||
|
||
checkformat: | ||
black --check . | ||
isort --check . | ||
|
||
format: | ||
black . | ||
isort . | ||
|
||
test: | ||
pytest tests/ ${TEST_ARGS} | ||
|
||
ci: checkformat lint test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,8 @@ | |
'name': 'tronpy', | ||
'version': '0.2.6', | ||
'description': 'TRON Python client library', | ||
'long_description': '# tronpy\n\nTRON Python Client Library.\n\n## How to use\n\n```python\nfrom tronpy import Tron\n\nclient = Tron(network=\'nile\')\n# Private key of TJzXt1sZautjqXnpjQT4xSCBHNSYgBkDr3\npriv_key = PrivateKey(bytes.fromhex("8888888888888888888888888888888888888888888888888888888888888888"))\n\ntxn = (\n client.trx.transfer("TJzXt1sZautjqXnpjQT4xSCBHNSYgBkDr3", "TVjsyZ7fYF3qLF6BQgPmTEZy1xrNNyVAAA", 1_000)\n .memo("test memo")\n .fee_limit(100_000_000)\n .build()\n .inspect()\n .sign(priv_key)\n .broadcast()\n)\n\nprint(txn)\n# > {\'result\': True, \'txid\': \'5182b96bc0d74f416d6ba8e22380e5920d8627f8fb5ef5a6a11d4df030459132\'}\nprint(txn.wait())\n# > {\'id\': \'5182b96bc0d74f416d6ba8e22380e5920d8627f8fb5ef5a6a11d4df030459132\', \'blockNumber\': 6415370, \'blockTimeStamp\': 1591951155000, \'contractResult\': [\'\'], \'receipt\': {\'net_usage\': 283}}\n```\n', | ||
'long_description': open("README.md").read(), | ||
'long_description_content_type': "text/markdown", | ||
'author': 'andelf', | ||
'author_email': '[email protected]', | ||
'maintainer': None, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
black | ||
codecov | ||
flake8 | ||
isort | ||
mypy | ||
pre-commit | ||
pytest | ||
pytest-asyncio | ||
pytest-cov |
Empty file.
Oops, something went wrong.