From 07df7f6ee8f9aa71ff4f9e4d20fa9c3da2b47728 Mon Sep 17 00:00:00 2001 From: Ibrahim Ahmed Date: Thu, 28 Oct 2021 12:47:44 -0700 Subject: [PATCH 1/5] Updated requirements --- requirements.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c77aa582..68dbd817 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,15 +3,14 @@ 0x-contract-wrappers==2.0.0 0x-json-schemas==2.1.0 0x-order-utils==4.0.1 -aiohttp==3.7.4 async-timeout==3.0.1 attrs==21.2.0 base58==2.1.0 bitarray==1.2.2 certifi==2021.10.8 -chardet==4.0.0 charset-normalizer==2.0.6 cytoolz==0.11.0 +dataclasses-json==0.5.6 Deprecated==1.2.13 eth-abi==2.1.1 eth-account==0.5.6 @@ -26,6 +25,8 @@ idna==3.2 ipfshttpclient==0.8.0a2 jsonschema==3.2.0 lru-dict==1.1.7 +marshmallow==3.14.0 +marshmallow-enum==1.5.1 multiaddr==0.0.9 multidict==5.2.0 mypy-extensions==0.4.3 @@ -40,6 +41,7 @@ six==1.16.0 stringcase==1.2.0 toolz==0.11.1 typing-extensions==3.10.0.2 +typing-inspect==0.7.1 urllib3==1.26.7 varint==1.0.2 web3==5.24.0 From d1922f08147af41e6a82758b0a1faaea70f34643 Mon Sep 17 00:00:00 2001 From: Ibrahim Ahmed Date: Thu, 28 Oct 2021 12:48:15 -0700 Subject: [PATCH 2/5] Added basic import test --- .gitignore | 2 ++ tests/__init__.py | 0 tests/test_import.py | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/test_import.py diff --git a/.gitignore b/.gitignore index a2c2f851..78ea947e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ nftlabs/modules/.DS_Store .DS_Store x.sh examples/test.py + +**/*.pyc diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_import.py b/tests/test_import.py new file mode 100644 index 00000000..0e21c296 --- /dev/null +++ b/tests/test_import.py @@ -0,0 +1,14 @@ +import unittest + +from nftlabs import NftlabsSdk, SdkOptions + + +class TestSum(unittest.TestCase): + def test_init_sdk(self): + """ + Test that tries to instatiate the SDK + """ + sdk = NftlabsSdk(SdkOptions(), "https://rpc-mumbai.maticvigil.com") + +if __name__ == '__main__': + unittest.main() \ No newline at end of file From 1257fa7f246485ca14de5a562c9af4625205e25b Mon Sep 17 00:00:00 2001 From: Ibrahim Ahmed Date: Thu, 28 Oct 2021 12:48:58 -0700 Subject: [PATCH 3/5] Github action for unit tests --- .github/workflows/run-tests.yml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..adadbe2f --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,37 @@ +name: Run Unit Tests + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +jobs: + tests: + name: "Python ${{ matrix.python-version }}" + runs-on: "ubuntu-latest" + env: + USING_COVERAGE: '3.6,3.8' + + strategy: + matrix: + python-version: [ "3.6", "3.7", "3.8", "pypy3" ] + + steps: + - uses: "actions/checkout@v2" + - uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + - name: "Install dependencies" + run: | + set -xe + python -VV + python -m site + python -m pip install -r requirements.txt + python -m pip install --upgrade pip setuptools wheel + python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions + python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions + + - name: "Run tox targets for ${{ matrix.python-version }}" + run: "python -m tox" \ No newline at end of file From 257ef329c1e761193eb11e4edfcad788cc7af4d7 Mon Sep 17 00:00:00 2001 From: Ibrahim Ahmed Date: Thu, 28 Oct 2021 12:54:14 -0700 Subject: [PATCH 4/5] Added tox config file --- tox.ini | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..9e0be863 --- /dev/null +++ b/tox.ini @@ -0,0 +1,6 @@ +[gh-actions] +python = + 3.6: py36 + 3.7: py37, docs + 3.8: py38, lint, manifest + pypy3: pypy3 \ No newline at end of file From 64c0f00792995c68e269ece0dbbdbf6750f44196 Mon Sep 17 00:00:00 2001 From: Ibrahim Ahmed Date: Thu, 28 Oct 2021 12:59:19 -0700 Subject: [PATCH 5/5] Update test matrix --- .github/workflows/run-tests.yml | 8 ++------ tox.ini | 6 ------ 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 tox.ini diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index adadbe2f..c1752f4b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -29,9 +29,5 @@ jobs: python -VV python -m site python -m pip install -r requirements.txt - python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions - python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions - - - name: "Run tox targets for ${{ matrix.python-version }}" - run: "python -m tox" \ No newline at end of file + - name: "Run tests targets for ${{ matrix.python-version }}" + run: "python3 -m unittest discover -s tests" \ No newline at end of file diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 9e0be863..00000000 --- a/tox.ini +++ /dev/null @@ -1,6 +0,0 @@ -[gh-actions] -python = - 3.6: py36 - 3.7: py37, docs - 3.8: py38, lint, manifest - pypy3: pypy3 \ No newline at end of file