diff --git a/.gitignore b/.gitignore index 7dc3b4c..9fe3640 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,10 @@ __pycache__ # Packaging build/ +dist/ + +# Pipenv +.venv # VIM *.swo diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 49a907a..4dde81e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,16 @@ Start by cloning the repository. git clone git@github.com:trusttoken/bnb-tx-python.git ``` +Install dependencies +``` +pipenv install +``` + +Run flake8 +``` +pipenv run flake8 +``` + # Pull Requests Please try to adhere to the following guidelines. diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..93bb783 --- /dev/null +++ b/Pipfile @@ -0,0 +1,16 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + + +[dev-packages] +pytest = "~=4.0" +flake8 = "==3.6" + + +[packages] +ecdsa = "==0.13.2" + +[requires] +python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..3d653c2 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,145 @@ +{ + "_meta": { + "hash": { + "sha256": "4b1b63a805b556107f8d3cec6fef711d70760b6df5cbad35a943843e8f11530f" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "ecdsa": { + "hashes": [ + "sha256:20c17e527e75acad8f402290e158a6ac178b91b881f941fc6ea305bfdfb9657c", + "sha256:5c034ffa23413ac923541ceb3ac14ec15a0d2530690413bff58c12b80e56d884" + ], + "index": "pypi", + "version": "==0.13.2" + } + }, + "develop": { + "atomicwrites": { + "hashes": [ + "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", + "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" + ], + "version": "==1.3.0" + }, + "attrs": { + "hashes": [ + "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", + "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" + ], + "version": "==19.1.0" + }, + "flake8": { + "hashes": [ + "sha256:6a35f5b8761f45c5513e3405f110a86bea57982c3b75b766ce7b65217abe1670", + "sha256:c01f8a3963b3571a8e6bd7a4063359aff90749e160778e03817cd9b71c9e07d2" + ], + "index": "pypi", + "version": "==3.6" + }, + "importlib-metadata": { + "hashes": [ + "sha256:23d3d873e008a513952355379d93cbcab874c58f4f034ff657c7a87422fa64e8", + "sha256:80d2de76188eabfbfcf27e6a37342c2827801e59c4cc14b0371c56fed43820e3" + ], + "version": "==0.19" + }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, + "more-itertools": { + "hashes": [ + "sha256:409cd48d4db7052af495b09dec721011634af3753ae1ef92d2b32f73a745f832", + "sha256:92b8c4b06dac4f0611c0729b2f2ede52b2e1bac1ab48f089c7ddc12e26bb60c4" + ], + "markers": "python_version > '2.7'", + "version": "==7.2.0" + }, + "packaging": { + "hashes": [ + "sha256:a7ac867b97fdc07ee80a8058fe4435ccd274ecc3b0ed61d852d7d53055528cf9", + "sha256:c491ca87294da7cc01902edbe30a5bc6c4c28172b5138ab4e4aa1b9d7bfaeafe" + ], + "version": "==19.1" + }, + "pluggy": { + "hashes": [ + "sha256:0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", + "sha256:b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c" + ], + "version": "==0.12.0" + }, + "py": { + "hashes": [ + "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", + "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" + ], + "version": "==1.8.0" + }, + "pycodestyle": { + "hashes": [ + "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", + "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" + ], + "version": "==2.4.0" + }, + "pyflakes": { + "hashes": [ + "sha256:9a7662ec724d0120012f6e29d6248ae3727d821bba522a0e6b356eff19126a49", + "sha256:f661252913bc1dbe7fcfcbf0af0db3f42ab65aabd1a6ca68fe5d466bace94dae" + ], + "version": "==2.0.0" + }, + "pyparsing": { + "hashes": [ + "sha256:6f98a7b9397e206d78cc01df10131398f1c8b8510a2f4d97d9abd82e1aacdd80", + "sha256:d9338df12903bbf5d65a0e4e87c2161968b10d2e489652bb47001d82a9b028b4" + ], + "version": "==2.4.2" + }, + "pytest": { + "hashes": [ + "sha256:6aa9bc2f6f6504d7949e9df2a756739ca06e58ffda19b5e53c725f7b03fb4aae", + "sha256:b77ae6f2d1a760760902a7676887b665c086f71e3461c64ed2a312afcedc00d6" + ], + "index": "pypi", + "version": "==4.6.4" + }, + "six": { + "hashes": [ + "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", + "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + ], + "version": "==1.12.0" + }, + "wcwidth": { + "hashes": [ + "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", + "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" + ], + "version": "==0.1.7" + }, + "zipp": { + "hashes": [ + "sha256:4970c3758f4e89a7857a973b1e2a5d75bcdc47794442f2e2dd4fe8e0466e809a", + "sha256:8a5712cfd3bb4248015eb3b0b3c54a5f6ee3f2425963ef2a0125b8bc40aafaec" + ], + "version": "==0.5.2" + } + } +} diff --git a/binance_transaction/tests/test_base.py b/binance_transaction/tests/test_base.py index 1723680..ca2074c 100644 --- a/binance_transaction/tests/test_base.py +++ b/binance_transaction/tests/test_base.py @@ -1,4 +1,4 @@ -from .base import Bool, Bytes, String, StringVarInt, VarInt +from binance_transaction.base import Bool, Bytes, String, StringVarInt, VarInt import base64 diff --git a/binance_transaction/tests/test_dex.py b/binance_transaction/tests/test_dex.py index 64dbed3..8f0566b 100644 --- a/binance_transaction/tests/test_dex.py +++ b/binance_transaction/tests/test_dex.py @@ -2,8 +2,8 @@ import hashlib -from .bnb_transaction import BnbTransaction -from .crypto import uncompress_key, verify_sig +from binance_transaction.bnb_transaction import BnbTransaction +from binance_transaction.crypto import uncompress_key, verify_sig def test_new_order(): diff --git a/binance_transaction/tests/test_gov.py b/binance_transaction/tests/test_gov.py index f063e7b..d32eb4c 100644 --- a/binance_transaction/tests/test_gov.py +++ b/binance_transaction/tests/test_gov.py @@ -1,8 +1,8 @@ import base64 import hashlib -from .bnb_transaction import BnbTransaction -from .crypto import verify_sig, uncompress_key +from binance_transaction.bnb_transaction import BnbTransaction +from binance_transaction.crypto import verify_sig, uncompress_key def test_vote_encoding(): diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..a622bef --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +testpaths = binance_transaction diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5919f31 --- /dev/null +++ b/setup.py @@ -0,0 +1,21 @@ +import setuptools + +with open("README.md", "r") as fh: + long_description = fh.read() + +setuptools.setup( + name="binance_transaction", + version="0.0.1", + author="William Morriss", + author_email="wjmelements@gmail.com", + description="Binance Chain Transactions", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/trusttoken/bnb-tx-python", + packages=setuptools.find_packages(), + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], +) diff --git a/tox.ini b/tox.ini index ab6ddae..d4e7569 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ [flake8] max-line-length = 120 -exclude = build +exclude = build,.venv