From 78ffc2fd1411018d1ccacdcd4de8e7f7a6a10183 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Mon, 30 Jan 2023 22:00:44 -0600 Subject: [PATCH 1/8] (1) add hook that syncs pre-commit with poetry dependenceis (2) feat: Network.from_chain_id() fn (3) build: update dependencies --- .pre-commit-config.yaml | 53 +++++++++++++++++++++----------------- nibiru/__init__.py | 2 +- nibiru/pytypes/__init__.py | 2 +- nibiru/pytypes/network.py | 30 +++++++++++++++++++++ 4 files changed, 61 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ebdb949..08a7dd38 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,29 +1,34 @@ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 - hooks: - - id: end-of-file-fixer - exclude: nibiru/proto/.+ - - - id: trailing-whitespace - exclude: nibiru/proto/.+ - - - repo: https://github.com/psf/black - rev: 22.3.0 - hooks: - - id: black - files: \.py$ + - repo: https://github.com/floatingpurr/sync_with_poetry + rev: "" # the revision or tag to clone at + hooks: + - id: sync_with_poetry + args: [] # optional args + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.1.0 + hooks: + - id: end-of-file-fixer exclude: nibiru/proto/.+ - - repo: https://github.com/PyCQA/isort - rev: 5.10.1 - hooks: - - id: isort - files: \.py$ + - id: trailing-whitespace exclude: nibiru/proto/.+ - args: ["--profile", "black"] - - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 - hooks: - - id: flake8 + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + files: \.py$ + exclude: nibiru/proto/.+ + + - repo: https://github.com/PyCQA/isort + rev: 5.10.1 + hooks: + - id: isort + files: \.py$ + exclude: nibiru/proto/.+ + args: ["--profile", "black"] + + - repo: https://github.com/pycqa/flake8 + rev: 4.0.1 + hooks: + - id: flake8 diff --git a/nibiru/__init__.py b/nibiru/__init__.py index 5f2071f1..8d1afa43 100644 --- a/nibiru/__init__.py +++ b/nibiru/__init__.py @@ -20,7 +20,7 @@ import nibiru.pytypes # noqa from nibiru.grpc_client import GrpcClient # noqa from nibiru.msg import Msg # noqa -from nibiru.pytypes import Network # noqa +from nibiru.pytypes import Network, NetworkType # noqa from nibiru.pytypes import Coin, Direction, PoolAsset, Side, TxConfig, TxType # noqa from nibiru.sdk import Sdk # noqa from nibiru.tx import Transaction # noqa diff --git a/nibiru/pytypes/__init__.py b/nibiru/pytypes/__init__.py index d09b5616..1cff6bfa 100644 --- a/nibiru/pytypes/__init__.py +++ b/nibiru/pytypes/__init__.py @@ -13,5 +13,5 @@ TxType, ) from nibiru.pytypes.event import Event, RawEvent, TxLogEvents # noqa -from nibiru.pytypes.network import Network # noqa +from nibiru.pytypes.network import Network, NetworkType # noqa from nibiru.pytypes.tx_resp import RawTxResp, TxResp # noqa diff --git a/nibiru/pytypes/network.py b/nibiru/pytypes/network.py index 00de32a8..279df67f 100644 --- a/nibiru/pytypes/network.py +++ b/nibiru/pytypes/network.py @@ -7,6 +7,7 @@ """ import dataclasses import os +import enum from typing import Dict, Optional @@ -178,3 +179,32 @@ def devnet(cls, chain_num: int = 2) -> "Network": fee_denom='unibi', env='devnet', ) + + @classmethod + def from_chain_id(cls, chain_id: str) -> "Network": + """ + Soon! + """ + + chain_id_elements: List[str] = chain_id.split("-") + if len(chain_id_elements) != 3: + raise ValueError(f"invalid chain_id format: {chain_id}. Expected one like nibiru-testnet-2") + + prefix, chain_type, chain_number = chain_id_elements + chain_number = int(chain_number) + + if chain_type == NetworkType.DEVNET.value: + return Network.devnet(chain_number) + elif chain_type == NetworkType.TESTNET.value: + return Network.testnet(chain_number) + elif chain_type == NetworkType.LOCALNET.value: + return Network.localnet() + else: + network_types: List[str] = [member.value for member in NetworkType] + raise ValueError(f"invalid chain type: {chain_type}. Available options: {network_types}") + +class NetworkType(enum.Enum): + """Enum class for the available network types. E.g. 'testnet' and 'devnet'.""" + DEVNET = "devnet" + TESTNET = "testnet" + LOCALNET = "localnet" \ No newline at end of file From 51197b23390b517aa0a2c3830ecaf96c510105e7 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Mon, 30 Jan 2023 22:52:34 -0600 Subject: [PATCH 2/8] build: Google Colab supports 3.8 - test: replace ping tests with requests.get calls on the rpc, lcd, and grpc - chore: update dependencies --- .github/workflows/pytests.yml | 14 +-- .pre-commit-config.yaml | 10 +- .python-version | 2 +- nibiru/__init__.py | 12 +- nibiru/pytypes/network.py | 20 ++-- poetry.lock | 213 ++++++++++++---------------------- pyproject.toml | 4 +- tests/chain_info_test.py | 35 ++++++ tests/conftest.py | 49 +++----- tests/endpoint_test.py | 30 +++++ 10 files changed, 188 insertions(+), 201 deletions(-) create mode 100644 tests/endpoint_test.py diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 2017f44f..54caa1b3 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -30,16 +30,16 @@ jobs: # ---------------------------------------------- - name: Check out the repo uses: actions/checkout@v3 - - name: Set up Python 3.7 + - name: Set up Python (3.8) id: setup-python uses: actions/setup-python@v2 with: - python-version: 3.7.15 - # 3.7.15 is the highest version available for this GitHub action. - # See https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json - # to see the full list of supported Python versions. - # 3.7.16 is the highest 3.7 version available on pyenv - # See `grep '3.7' <<< $(pyenv install -l)` to view the available list. + python-version: 3.8.16 + # 3.8.16 is the highest version available for this GitHub action. + # For the full list of supported Python versions, see: + # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json + # 3.8.16 is the highest 3.8 version available on pyenv + # See `grep '3.8' <<< $(pyenv install -l)` to view the available list. - name: Run python run: python --version && python -c "print('hello')" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08a7dd38..2465ca69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,20 +14,12 @@ repos: exclude: nibiru/proto/.+ - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.12.0 hooks: - id: black files: \.py$ exclude: nibiru/proto/.+ - - repo: https://github.com/PyCQA/isort - rev: 5.10.1 - hooks: - - id: isort - files: \.py$ - exclude: nibiru/proto/.+ - args: ["--profile", "black"] - - repo: https://github.com/pycqa/flake8 rev: 4.0.1 hooks: diff --git a/.python-version b/.python-version index 36f601f1..eee6392d 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.7.16 +3.8.16 diff --git a/nibiru/__init__.py b/nibiru/__init__.py index 8d1afa43..37902fc6 100644 --- a/nibiru/__init__.py +++ b/nibiru/__init__.py @@ -20,8 +20,16 @@ import nibiru.pytypes # noqa from nibiru.grpc_client import GrpcClient # noqa from nibiru.msg import Msg # noqa -from nibiru.pytypes import Network, NetworkType # noqa -from nibiru.pytypes import Coin, Direction, PoolAsset, Side, TxConfig, TxType # noqa +from nibiru.pytypes import ( # noqa + Coin, + Direction, + Network, + NetworkType, + PoolAsset, + Side, + TxConfig, + TxType, +) from nibiru.sdk import Sdk # noqa from nibiru.tx import Transaction # noqa from nibiru.wallet import Address, PrivateKey, PublicKey # noqa diff --git a/nibiru/pytypes/network.py b/nibiru/pytypes/network.py index 279df67f..a99f893c 100644 --- a/nibiru/pytypes/network.py +++ b/nibiru/pytypes/network.py @@ -6,8 +6,8 @@ """ import dataclasses -import os import enum +import os from typing import Dict, Optional @@ -179,7 +179,7 @@ def devnet(cls, chain_num: int = 2) -> "Network": fee_denom='unibi', env='devnet', ) - + @classmethod def from_chain_id(cls, chain_id: str) -> "Network": """ @@ -188,7 +188,9 @@ def from_chain_id(cls, chain_id: str) -> "Network": chain_id_elements: List[str] = chain_id.split("-") if len(chain_id_elements) != 3: - raise ValueError(f"invalid chain_id format: {chain_id}. Expected one like nibiru-testnet-2") + raise ValueError( + f"invalid chain_id format: {chain_id}. Expected one like nibiru-testnet-2" + ) prefix, chain_type, chain_number = chain_id_elements chain_number = int(chain_number) @@ -199,12 +201,16 @@ def from_chain_id(cls, chain_id: str) -> "Network": return Network.testnet(chain_number) elif chain_type == NetworkType.LOCALNET.value: return Network.localnet() - else: - network_types: List[str] = [member.value for member in NetworkType] - raise ValueError(f"invalid chain type: {chain_type}. Available options: {network_types}") + else: + network_types: List[str] = [member.value for member in NetworkType] + raise ValueError( + f"invalid chain type: {chain_type}. Available options: {network_types}" + ) + class NetworkType(enum.Enum): """Enum class for the available network types. E.g. 'testnet' and 'devnet'.""" + DEVNET = "devnet" TESTNET = "testnet" - LOCALNET = "localnet" \ No newline at end of file + LOCALNET = "localnet" diff --git a/poetry.lock b/poetry.lock index 70fba507..1db2f3fd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -119,12 +119,10 @@ files = [ [package.dependencies] aiosignal = ">=1.1.2" async-timeout = ">=4.0.0a3,<5.0" -asynctest = {version = "0.13.0", markers = "python_version < \"3.8\""} attrs = ">=17.3.0" charset-normalizer = ">=2.0,<3.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} yarl = ">=1.0,<2.0" [package.extras] @@ -169,9 +167,6 @@ files = [ {file = "async_timeout-4.0.2-py3-none-any.whl", hash = "sha256:8ca1e4fcf50d07413d66d1a5e416e42cfdf5851c981d679a09851a6853383b3c"}, ] -[package.dependencies] -typing-extensions = {version = ">=3.6.5", markers = "python_version < \"3.8\""} - [[package]] name = "asyncio" version = "3.4.3" @@ -186,18 +181,6 @@ files = [ {file = "asyncio-3.4.3.tar.gz", hash = "sha256:83360ff8bc97980e4ff25c964c7bd3923d333d177aa4f7fb736b019f26c7cb41"}, ] -[[package]] -name = "asynctest" -version = "0.13.0" -description = "Enhance the standard unittest package with features for testing asyncio libraries" -category = "main" -optional = false -python-versions = ">=3.5" -files = [ - {file = "asynctest-0.13.0-py3-none-any.whl", hash = "sha256:5da6118a7e6d6b54d83a8f7197769d046922a44d2a99c21382f0a6e4fadae676"}, - {file = "asynctest-0.13.0.tar.gz", hash = "sha256:c27862842d15d83e6a34eb0b2866c323880eb3a75e4485b079ea11748fd77fac"}, -] - [[package]] name = "attrs" version = "22.2.0" @@ -317,7 +300,6 @@ mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} -typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] @@ -456,7 +438,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "coincurve" @@ -528,63 +509,63 @@ files = [ [[package]] name = "coverage" -version = "7.0.5" +version = "7.1.0" description = "Code coverage measurement for Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "coverage-7.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2a7f23bbaeb2a87f90f607730b45564076d870f1fb07b9318d0c21f36871932b"}, - {file = "coverage-7.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c18d47f314b950dbf24a41787ced1474e01ca816011925976d90a88b27c22b89"}, - {file = "coverage-7.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef14d75d86f104f03dea66c13188487151760ef25dd6b2dbd541885185f05f40"}, - {file = "coverage-7.0.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66e50680e888840c0995f2ad766e726ce71ca682e3c5f4eee82272c7671d38a2"}, - {file = "coverage-7.0.5-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9fed35ca8c6e946e877893bbac022e8563b94404a605af1d1e6accc7eb73289"}, - {file = "coverage-7.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d8d04e755934195bdc1db45ba9e040b8d20d046d04d6d77e71b3b34a8cc002d0"}, - {file = "coverage-7.0.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7e109f1c9a3ece676597831874126555997c48f62bddbcace6ed17be3e372de8"}, - {file = "coverage-7.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0a1890fca2962c4f1ad16551d660b46ea77291fba2cc21c024cd527b9d9c8809"}, - {file = "coverage-7.0.5-cp310-cp310-win32.whl", hash = "sha256:be9fcf32c010da0ba40bf4ee01889d6c737658f4ddff160bd7eb9cac8f094b21"}, - {file = "coverage-7.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:cbfcba14a3225b055a28b3199c3d81cd0ab37d2353ffd7f6fd64844cebab31ad"}, - {file = "coverage-7.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:30b5fec1d34cc932c1bc04017b538ce16bf84e239378b8f75220478645d11fca"}, - {file = "coverage-7.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1caed2367b32cc80a2b7f58a9f46658218a19c6cfe5bc234021966dc3daa01f0"}, - {file = "coverage-7.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d254666d29540a72d17cc0175746cfb03d5123db33e67d1020e42dae611dc196"}, - {file = "coverage-7.0.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19245c249aa711d954623d94f23cc94c0fd65865661f20b7781210cb97c471c0"}, - {file = "coverage-7.0.5-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b05ed4b35bf6ee790832f68932baf1f00caa32283d66cc4d455c9e9d115aafc"}, - {file = "coverage-7.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:29de916ba1099ba2aab76aca101580006adfac5646de9b7c010a0f13867cba45"}, - {file = "coverage-7.0.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:e057e74e53db78122a3979f908973e171909a58ac20df05c33998d52e6d35757"}, - {file = "coverage-7.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:411d4ff9d041be08fdfc02adf62e89c735b9468f6d8f6427f8a14b6bb0a85095"}, - {file = "coverage-7.0.5-cp311-cp311-win32.whl", hash = "sha256:52ab14b9e09ce052237dfe12d6892dd39b0401690856bcfe75d5baba4bfe2831"}, - {file = "coverage-7.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:1f66862d3a41674ebd8d1a7b6f5387fe5ce353f8719040a986551a545d7d83ea"}, - {file = "coverage-7.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b69522b168a6b64edf0c33ba53eac491c0a8f5cc94fa4337f9c6f4c8f2f5296c"}, - {file = "coverage-7.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:436e103950d05b7d7f55e39beeb4d5be298ca3e119e0589c0227e6d0b01ee8c7"}, - {file = "coverage-7.0.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b8c56bec53d6e3154eaff6ea941226e7bd7cc0d99f9b3756c2520fc7a94e6d96"}, - {file = "coverage-7.0.5-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a38362528a9115a4e276e65eeabf67dcfaf57698e17ae388599568a78dcb029"}, - {file = "coverage-7.0.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f67472c09a0c7486e27f3275f617c964d25e35727af952869dd496b9b5b7f6a3"}, - {file = "coverage-7.0.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:220e3fa77d14c8a507b2d951e463b57a1f7810a6443a26f9b7591ef39047b1b2"}, - {file = "coverage-7.0.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ecb0f73954892f98611e183f50acdc9e21a4653f294dfbe079da73c6378a6f47"}, - {file = "coverage-7.0.5-cp37-cp37m-win32.whl", hash = "sha256:d8f3e2e0a1d6777e58e834fd5a04657f66affa615dae61dd67c35d1568c38882"}, - {file = "coverage-7.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:9e662e6fc4f513b79da5d10a23edd2b87685815b337b1a30cd11307a6679148d"}, - {file = "coverage-7.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:790e4433962c9f454e213b21b0fd4b42310ade9c077e8edcb5113db0818450cb"}, - {file = "coverage-7.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:49640bda9bda35b057b0e65b7c43ba706fa2335c9a9896652aebe0fa399e80e6"}, - {file = "coverage-7.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d66187792bfe56f8c18ba986a0e4ae44856b1c645336bd2c776e3386da91e1dd"}, - {file = "coverage-7.0.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:276f4cd0001cd83b00817c8db76730938b1ee40f4993b6a905f40a7278103b3a"}, - {file = "coverage-7.0.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95304068686545aa368b35dfda1cdfbbdbe2f6fe43de4a2e9baa8ebd71be46e2"}, - {file = "coverage-7.0.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:17e01dd8666c445025c29684d4aabf5a90dc6ef1ab25328aa52bedaa95b65ad7"}, - {file = "coverage-7.0.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ea76dbcad0b7b0deb265d8c36e0801abcddf6cc1395940a24e3595288b405ca0"}, - {file = "coverage-7.0.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:50a6adc2be8edd7ee67d1abc3cd20678987c7b9d79cd265de55941e3d0d56499"}, - {file = "coverage-7.0.5-cp38-cp38-win32.whl", hash = "sha256:e4ce984133b888cc3a46867c8b4372c7dee9cee300335e2925e197bcd45b9e16"}, - {file = "coverage-7.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:4a950f83fd3f9bca23b77442f3a2b2ea4ac900944d8af9993743774c4fdc57af"}, - {file = "coverage-7.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3c2155943896ac78b9b0fd910fb381186d0c345911f5333ee46ac44c8f0e43ab"}, - {file = "coverage-7.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:54f7e9705e14b2c9f6abdeb127c390f679f6dbe64ba732788d3015f7f76ef637"}, - {file = "coverage-7.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ee30375b409d9a7ea0f30c50645d436b6f5dfee254edffd27e45a980ad2c7f4"}, - {file = "coverage-7.0.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b78729038abea6a5df0d2708dce21e82073463b2d79d10884d7d591e0f385ded"}, - {file = "coverage-7.0.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13250b1f0bd023e0c9f11838bdeb60214dd5b6aaf8e8d2f110c7e232a1bff83b"}, - {file = "coverage-7.0.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:2c407b1950b2d2ffa091f4e225ca19a66a9bd81222f27c56bd12658fc5ca1209"}, - {file = "coverage-7.0.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:c76a3075e96b9c9ff00df8b5f7f560f5634dffd1658bafb79eb2682867e94f78"}, - {file = "coverage-7.0.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f26648e1b3b03b6022b48a9b910d0ae209e2d51f50441db5dce5b530fad6d9b1"}, - {file = "coverage-7.0.5-cp39-cp39-win32.whl", hash = "sha256:ba3027deb7abf02859aca49c865ece538aee56dcb4871b4cced23ba4d5088904"}, - {file = "coverage-7.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:949844af60ee96a376aac1ded2a27e134b8c8d35cc006a52903fc06c24a3296f"}, - {file = "coverage-7.0.5-pp37.pp38.pp39-none-any.whl", hash = "sha256:b9727ac4f5cf2cbf87880a63870b5b9730a8ae3a4a360241a0fdaa2f71240ff0"}, - {file = "coverage-7.0.5.tar.gz", hash = "sha256:051afcbd6d2ac39298d62d340f94dbb6a1f31de06dfaf6fcef7b759dd3860c45"}, + {file = "coverage-7.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3b946bbcd5a8231383450b195cfb58cb01cbe7f8949f5758566b881df4b33baf"}, + {file = "coverage-7.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ec8e767f13be637d056f7e07e61d089e555f719b387a7070154ad80a0ff31801"}, + {file = "coverage-7.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4a5a5879a939cb84959d86869132b00176197ca561c664fc21478c1eee60d75"}, + {file = "coverage-7.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b643cb30821e7570c0aaf54feaf0bfb630b79059f85741843e9dc23f33aaca2c"}, + {file = "coverage-7.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32df215215f3af2c1617a55dbdfb403b772d463d54d219985ac7cd3bf124cada"}, + {file = "coverage-7.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:33d1ae9d4079e05ac4cc1ef9e20c648f5afabf1a92adfaf2ccf509c50b85717f"}, + {file = "coverage-7.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:29571503c37f2ef2138a306d23e7270687c0efb9cab4bd8038d609b5c2393a3a"}, + {file = "coverage-7.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:63ffd21aa133ff48c4dff7adcc46b7ec8b565491bfc371212122dd999812ea1c"}, + {file = "coverage-7.1.0-cp310-cp310-win32.whl", hash = "sha256:4b14d5e09c656de5038a3f9bfe5228f53439282abcab87317c9f7f1acb280352"}, + {file = "coverage-7.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:8361be1c2c073919500b6601220a6f2f98ea0b6d2fec5014c1d9cfa23dd07038"}, + {file = "coverage-7.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:da9b41d4539eefd408c46725fb76ecba3a50a3367cafb7dea5f250d0653c1040"}, + {file = "coverage-7.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5b15ed7644ae4bee0ecf74fee95808dcc34ba6ace87e8dfbf5cb0dc20eab45a"}, + {file = "coverage-7.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d12d076582507ea460ea2a89a8c85cb558f83406c8a41dd641d7be9a32e1274f"}, + {file = "coverage-7.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2617759031dae1bf183c16cef8fcfb3de7617f394c813fa5e8e46e9b82d4222"}, + {file = "coverage-7.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4e4881fa9e9667afcc742f0c244d9364d197490fbc91d12ac3b5de0bf2df146"}, + {file = "coverage-7.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9d58885215094ab4a86a6aef044e42994a2bd76a446dc59b352622655ba6621b"}, + {file = "coverage-7.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:ffeeb38ee4a80a30a6877c5c4c359e5498eec095878f1581453202bfacc8fbc2"}, + {file = "coverage-7.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3baf5f126f30781b5e93dbefcc8271cb2491647f8283f20ac54d12161dff080e"}, + {file = "coverage-7.1.0-cp311-cp311-win32.whl", hash = "sha256:ded59300d6330be27bc6cf0b74b89ada58069ced87c48eaf9344e5e84b0072f7"}, + {file = "coverage-7.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:6a43c7823cd7427b4ed763aa7fb63901ca8288591323b58c9cd6ec31ad910f3c"}, + {file = "coverage-7.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:7a726d742816cb3a8973c8c9a97539c734b3a309345236cd533c4883dda05b8d"}, + {file = "coverage-7.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc7c85a150501286f8b56bd8ed3aa4093f4b88fb68c0843d21ff9656f0009d6a"}, + {file = "coverage-7.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f5b4198d85a3755d27e64c52f8c95d6333119e49fd001ae5798dac872c95e0f8"}, + {file = "coverage-7.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ddb726cb861c3117a553f940372a495fe1078249ff5f8a5478c0576c7be12050"}, + {file = "coverage-7.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:51b236e764840a6df0661b67e50697aaa0e7d4124ca95e5058fa3d7cbc240b7c"}, + {file = "coverage-7.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:7ee5c9bb51695f80878faaa5598040dd6c9e172ddcf490382e8aedb8ec3fec8d"}, + {file = "coverage-7.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c31b75ae466c053a98bf26843563b3b3517b8f37da4d47b1c582fdc703112bc3"}, + {file = "coverage-7.1.0-cp37-cp37m-win32.whl", hash = "sha256:3b155caf3760408d1cb903b21e6a97ad4e2bdad43cbc265e3ce0afb8e0057e73"}, + {file = "coverage-7.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2a60d6513781e87047c3e630b33b4d1e89f39836dac6e069ffee28c4786715f5"}, + {file = "coverage-7.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f2cba5c6db29ce991029b5e4ac51eb36774458f0a3b8d3137241b32d1bb91f06"}, + {file = "coverage-7.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beeb129cacea34490ffd4d6153af70509aa3cda20fdda2ea1a2be870dfec8d52"}, + {file = "coverage-7.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c45948f613d5d18c9ec5eaa203ce06a653334cf1bd47c783a12d0dd4fd9c851"}, + {file = "coverage-7.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef382417db92ba23dfb5864a3fc9be27ea4894e86620d342a116b243ade5d35d"}, + {file = "coverage-7.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c7c0d0827e853315c9bbd43c1162c006dd808dbbe297db7ae66cd17b07830f0"}, + {file = "coverage-7.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e5cdbb5cafcedea04924568d990e20ce7f1945a1dd54b560f879ee2d57226912"}, + {file = "coverage-7.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9817733f0d3ea91bea80de0f79ef971ae94f81ca52f9b66500c6a2fea8e4b4f8"}, + {file = "coverage-7.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:218fe982371ac7387304153ecd51205f14e9d731b34fb0568181abaf7b443ba0"}, + {file = "coverage-7.1.0-cp38-cp38-win32.whl", hash = "sha256:04481245ef966fbd24ae9b9e537ce899ae584d521dfbe78f89cad003c38ca2ab"}, + {file = "coverage-7.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:8ae125d1134bf236acba8b83e74c603d1b30e207266121e76484562bc816344c"}, + {file = "coverage-7.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2bf1d5f2084c3932b56b962a683074a3692bce7cabd3aa023c987a2a8e7612f6"}, + {file = "coverage-7.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:98b85dd86514d889a2e3dd22ab3c18c9d0019e696478391d86708b805f4ea0fa"}, + {file = "coverage-7.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38da2db80cc505a611938d8624801158e409928b136c8916cd2e203970dde4dc"}, + {file = "coverage-7.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3164d31078fa9efe406e198aecd2a02d32a62fecbdef74f76dad6a46c7e48311"}, + {file = "coverage-7.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db61a79c07331e88b9a9974815c075fbd812bc9dbc4dc44b366b5368a2936063"}, + {file = "coverage-7.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9ccb092c9ede70b2517a57382a601619d20981f56f440eae7e4d7eaafd1d1d09"}, + {file = "coverage-7.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:33ff26d0f6cc3ca8de13d14fde1ff8efe1456b53e3f0273e63cc8b3c84a063d8"}, + {file = "coverage-7.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d47dd659a4ee952e90dc56c97d78132573dc5c7b09d61b416a9deef4ebe01a0c"}, + {file = "coverage-7.1.0-cp39-cp39-win32.whl", hash = "sha256:d248cd4a92065a4d4543b8331660121b31c4148dd00a691bfb7a5cdc7483cfa4"}, + {file = "coverage-7.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:7ed681b0f8e8bcbbffa58ba26fcf5dbc8f79e7997595bf071ed5430d8c08d6f3"}, + {file = "coverage-7.1.0-pp37.pp38.pp39-none-any.whl", hash = "sha256:755e89e32376c850f826c425ece2c35a4fc266c081490eb0a841e7c1cb0d3bda"}, + {file = "coverage-7.1.0.tar.gz", hash = "sha256:10188fe543560ec4874f974b5305cd1a8bdcfa885ee00ea3a03733464c4ca265"}, ] [package.dependencies] @@ -889,14 +870,14 @@ ecdsa = ">=0.14.0" [[package]] name = "identify" -version = "2.5.13" +version = "2.5.17" description = "File identification library for Python" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "identify-2.5.13-py2.py3-none-any.whl", hash = "sha256:8aa48ce56e38c28b6faa9f261075dea0a942dfbb42b341b4e711896cbb40f3f7"}, - {file = "identify-2.5.13.tar.gz", hash = "sha256:abb546bca6f470228785338a01b539de8a85bbf46491250ae03363956d8ebb10"}, + {file = "identify-2.5.17-py2.py3-none-any.whl", hash = "sha256:7d526dd1283555aafcc91539acc061d8f6f59adb0a7bba462735b0a318bff7ed"}, + {file = "identify-2.5.17.tar.gz", hash = "sha256:93cc61a861052de9d4c541a7acb7e3dcc9c11b398a2144f6e52ae5285f5f4f06"}, ] [package.extras] @@ -927,7 +908,6 @@ files = [ ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] @@ -960,7 +940,6 @@ files = [ ] [package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} MarkupSafe = ">=0.9.2" [package.extras] @@ -1223,14 +1202,14 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" [[package]] name = "pathspec" -version = "0.10.3" +version = "0.11.0" description = "Utility library for gitignore style pattern matching of file paths." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pathspec-0.10.3-py3-none-any.whl", hash = "sha256:3c95343af8b756205e2aba76e843ba9520a24dd84f68c22b9f93251507509dd6"}, - {file = "pathspec-0.10.3.tar.gz", hash = "sha256:56200de4077d9d0791465aa9095a01d421861e405b5096955051deefd697d6f6"}, + {file = "pathspec-0.11.0-py3-none-any.whl", hash = "sha256:3a66eb970cbac598f9e5ccb5b2cf58930cd8e3ed86d393d541eaf2d8b1705229"}, + {file = "pathspec-0.11.0.tar.gz", hash = "sha256:64d338d4e0914e91c1792321e6907b5a593f1ab1851de7fc269557a21b30ebbc"}, ] [[package]] @@ -1261,9 +1240,6 @@ files = [ {file = "platformdirs-2.6.2.tar.gz", hash = "sha256:e1fea1fe471b9ff8332e229df3cb7de4f53eeea4998d3b6bfff542115e998bd2"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.4", markers = "python_version < \"3.8\""} - [package.extras] docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] @@ -1280,9 +1256,6 @@ files = [ {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -1302,7 +1275,6 @@ files = [ [package.dependencies] cfgv = ">=2.0.0" identify = ">=1.0.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0" @@ -1374,7 +1346,6 @@ files = [ attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -1455,14 +1426,14 @@ six = ">=1.5" [[package]] name = "python-dotenv" -version = "0.21.0" +version = "0.21.1" description = "Read key-value pairs from a .env file and set them as environment variables" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "python-dotenv-0.21.0.tar.gz", hash = "sha256:b77d08274639e3d34145dfa6c7008e66df0f04b7be7a75fd0d5292c191d79045"}, - {file = "python_dotenv-0.21.0-py3-none-any.whl", hash = "sha256:1684eb44636dd462b66c3ee016599815514527ad99965de77f43e0944634a7e5"}, + {file = "python-dotenv-0.21.1.tar.gz", hash = "sha256:1c93de8f636cde3ce377292818d0e440b6e45a82f215c3744979151fa8151c49"}, + {file = "python_dotenv-0.21.1-py3-none-any.whl", hash = "sha256:41e12e0318bebc859fcc4d97d4db8d20ad21721a6aa5047dd59f090391cb549a"}, ] [package.extras] @@ -1558,14 +1529,14 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "setuptools" -version = "66.0.0" +version = "67.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-66.0.0-py3-none-any.whl", hash = "sha256:a78d01d1e2c175c474884671dde039962c9d74c7223db7369771fcf6e29ceeab"}, - {file = "setuptools-66.0.0.tar.gz", hash = "sha256:bd6eb2d6722568de6d14b87c44a96fac54b2a45ff5e940e639979a3d1792adb6"}, + {file = "setuptools-67.0.0-py3-none-any.whl", hash = "sha256:9d790961ba6219e9ff7d9557622d2fe136816a264dd01d5997cfc057d804853d"}, + {file = "setuptools-67.0.0.tar.gz", hash = "sha256:883131c5b6efa70b9101c7ef30b2b7b780a4283d5fc1616383cdf22c83cbefe6"}, ] [package.extras] @@ -1609,40 +1580,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "typed-ast" -version = "1.5.4" -description = "a fork of Python 2 and 3 ast modules with type comment support" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typed_ast-1.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:669dd0c4167f6f2cd9f57041e03c3c2ebf9063d0757dc89f79ba1daa2bfca9d4"}, - {file = "typed_ast-1.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:211260621ab1cd7324e0798d6be953d00b74e0428382991adfddb352252f1d62"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:267e3f78697a6c00c689c03db4876dd1efdfea2f251a5ad6555e82a26847b4ac"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c542eeda69212fa10a7ada75e668876fdec5f856cd3d06829e6aa64ad17c8dfe"}, - {file = "typed_ast-1.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:a9916d2bb8865f973824fb47436fa45e1ebf2efd920f2b9f99342cb7fab93f72"}, - {file = "typed_ast-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:79b1e0869db7c830ba6a981d58711c88b6677506e648496b1f64ac7d15633aec"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a94d55d142c9265f4ea46fab70977a1944ecae359ae867397757d836ea5a3f47"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:183afdf0ec5b1b211724dfef3d2cad2d767cbefac291f24d69b00546c1837fb6"}, - {file = "typed_ast-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:639c5f0b21776605dd6c9dbe592d5228f021404dafd377e2b7ac046b0349b1a1"}, - {file = "typed_ast-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cf4afcfac006ece570e32d6fa90ab74a17245b83dfd6655a6f68568098345ff6"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed855bbe3eb3715fca349c80174cfcfd699c2f9de574d40527b8429acae23a66"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6778e1b2f81dfc7bc58e4b259363b83d2e509a65198e85d5700dfae4c6c8ff1c"}, - {file = "typed_ast-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2efae9db7a8c05ad5547d522e7dbe62c83d838d3906a3716d1478b6c1d61388d"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7d5d014b7daa8b0bf2eaef684295acae12b036d79f54178b92a2b6a56f92278f"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:370788a63915e82fd6f212865a596a0fefcbb7d408bbbb13dea723d971ed8bdc"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4e964b4ff86550a7a7d56345c7864b18f403f5bd7380edf44a3c1fb4ee7ac6c6"}, - {file = "typed_ast-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:683407d92dc953c8a7347119596f0b0e6c55eb98ebebd9b23437501b28dcbb8e"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4879da6c9b73443f97e731b617184a596ac1235fe91f98d279a7af36c796da35"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3e123d878ba170397916557d31c8f589951e353cc95fb7f24f6bb69adc1a8a97"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebd9d7f80ccf7a82ac5f88c521115cc55d84e35bf8b446fcd7836eb6b98929a3"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98f80dee3c03455e92796b58b98ff6ca0b2a6f652120c263efdba4d6c5e58f72"}, - {file = "typed_ast-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1"}, - {file = "typed_ast-1.5.4.tar.gz", hash = "sha256:39e21ceb7388e4bb37f4c679d72707ed46c2fbf2a5609b8b8ebc4b067d977df2"}, -] - [[package]] name = "types-protobuf" version = "4.21.0.3" @@ -1659,7 +1596,7 @@ files = [ name = "typing-extensions" version = "4.4.0" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1732,7 +1669,6 @@ files = [ [package.dependencies] distlib = ">=0.3.6,<1" filelock = ">=3.4.1,<4" -importlib-metadata = {version = ">=4.8.3", markers = "python_version < \"3.8\""} platformdirs = ">=2.4,<3" [package.extras] @@ -1741,14 +1677,14 @@ testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7 [[package]] name = "websocket-client" -version = "1.4.2" +version = "1.5.0" description = "WebSocket client for Python with low level API options" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "websocket-client-1.4.2.tar.gz", hash = "sha256:d6e8f90ca8e2dd4e8027c4561adeb9456b54044312dba655e7cae652ceb9ae59"}, - {file = "websocket_client-1.4.2-py3-none-any.whl", hash = "sha256:d6b06432f184438d99ac1f456eaf22fe1ade524c3dd16e661142dc54e9cba574"}, + {file = "websocket-client-1.5.0.tar.gz", hash = "sha256:561ca949e5bbb5d33409a37235db55c279235c78ee407802f1d2314fff8a8536"}, + {file = "websocket_client-1.5.0-py3-none-any.whl", hash = "sha256:fb5d81b95d350f3a54838ebcb4c68a5353bbd1412ae8f068b1e5280faeb13074"}, ] [package.extras] @@ -1843,25 +1779,24 @@ files = [ [package.dependencies] idna = ">=2.0" multidict = ">=4.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} [[package]] name = "zipp" -version = "3.11.0" +version = "3.12.0" description = "Backport of pathlib-compatible object wrapper for zip files" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "zipp-3.11.0-py3-none-any.whl", hash = "sha256:83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa"}, - {file = "zipp-3.11.0.tar.gz", hash = "sha256:a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766"}, + {file = "zipp-3.12.0-py3-none-any.whl", hash = "sha256:9eb0a4c5feab9b08871db0d672745b53450d7f26992fd1e4653aa43345e97b86"}, + {file = "zipp-3.12.0.tar.gz", hash = "sha256:73efd63936398aac78fd92b6f4865190119d6c91b531532e798977ea8dd402eb"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "bc0bafb2b760d40dd0ee85f3e26963ae62b8de69e915b7e94779da97621eaad5" +python-versions = "^3.8" +content-hash = "933a681a4e353cd4a4b4320e2c3563f6cb370278e25dad3137bb2ad1df679890" diff --git a/pyproject.toml b/pyproject.toml index adaf26b8..5f64cc93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ maintainers = [ "Unique-Divine ", ] readme = "README.md" # similar to long_description in setuptools -repository = "https://github.com/NibiruChain/sdk-py" +repository = "https://github.com/NibiruChain/py-sdk" keywords = ["nibiru", "blockchain", "sdk", "python", "cosmos"] classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", @@ -20,7 +20,7 @@ classifiers = [ packages = [{ include = "nibiru" }] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" asyncio = "^3.4.3" bech32 = "^1.2.0" python-dotenv = "^0.21.0" diff --git a/tests/chain_info_test.py b/tests/chain_info_test.py index adb8a357..c88737a3 100644 --- a/tests/chain_info_test.py +++ b/tests/chain_info_test.py @@ -1,10 +1,12 @@ # chain_info_test.py +import dataclasses from typing import Any, Dict, List, Union import pytest import requests import nibiru +import tests from nibiru import pytypes @@ -105,3 +107,36 @@ def test_query(sdk_val: nibiru.Sdk): """ assert isinstance(sdk_val.query.get_latest_block_height(), int) assert isinstance(sdk_val.query.get_version(), str) + + +def test_Network_from_chain_id(): + @dataclasses.dataclass + class Case: + chain_id_in: str + expected_fail: bool = False + + def run_case(test_case: Case): + if test_case.expected_fail: + try: + _ = nibiru.Network.from_chain_id(test_case.chain_id_in) + except BaseException as err: + tests.raises(["invalid chain type", "invalid chain_id format"], err) + else: + network = nibiru.Network.from_chain_id(test_case.chain_id_in) + _, chain_type, _ = network.chain_id.split("-") + + if chain_type == "localnet": + return + + assert chain_type in network.tendermint_rpc_endpoint + assert chain_type in network.lcd_endpoint + assert chain_type in network.grpc_endpoint + + for test_case in [ + Case("nibiru-devnet-4"), + Case("nibiru-randnet-123", expected_fail=True), + Case("nibiru-testnet-685920"), + Case("xxx-yyy", expected_fail=True), + Case("nibiru-localnet-78"), + ]: + run_case(test_case=test_case) diff --git a/tests/conftest.py b/tests/conftest.py index 1908b006..f5c9b410 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,12 +16,12 @@ import dotenv import pytest -from nibiru import Network, Sdk +from nibiru import Network, NetworkType, Sdk from nibiru.pytypes import TxConfig, TxType -from tests.utils_test import can_ping, url_to_host PYTEST_GLOBALS_REQUIRED: Dict[str, str] = dict( VALIDATOR_MNEMONIC="", + CHAIN_ID="nibiru-localnet-0", ) PYTEST_GLOBALS_OPTIONAL: Dict[str, Any] = dict( USE_LOCALNET=False, @@ -29,8 +29,6 @@ GRPC_ENDPOINT="", TENDERMINT_RPC_ENDPOINT="", WEBSOCKET_ENDPOINT="", - DEVNET_NUMBER="1", - CHAIN_ID="", ) PYTEST_GLOBALS: Dict[str, Any] = { **PYTEST_GLOBALS_REQUIRED, # combines dictionaries @@ -70,43 +68,26 @@ def set_pytest_global(name: str, value: Any): def get_network() -> Network: if PYTEST_GLOBALS["use_localnet"]: return Network.customnet() - return Network.devnet(int(os.getenv("DEVNET_NUMBER", "1"))) + + # Use the chain_id to choose which Network to use + chain_id: str = os.getenv("CHAIN_ID", "nibiru-localnet-0") + chain_id_elements: List[str] = chain_id.split("-") + assert len(chain_id_elements) == 3 + prefix, chain_type, chain_number = chain_id_elements + chain_number = int(chain_number) + + chain_types: List[str] = [enum_member.value for enum_member in NetworkType] + if chain_type in chain_types: + return Network.from_chain_id(chain_id=chain_id) + else: + return Network.localnet() @pytest.fixture def network() -> Network: - """ - # TODO Use ping test like ts-sdk to check RPC and LCD connections - """ return get_network() -def pytest_sessionstart(session): - """ - Called after the Session object has been created and - before performing collection and entering the run test loop. - """ - network = get_network() - - if not can_ping("www.google.com"): - raise TimeoutError(f"Cannot ping google.com") - - if not can_ping(url_to_host(network.lcd_endpoint)): - raise TimeoutError( - f"Lcd Endpoint {url_to_host(network.lcd_endpoint)} timed out" - ) - - if not can_ping(url_to_host(network.grpc_endpoint)): - raise TimeoutError( - f"Grpc Endpoint {url_to_host(network.grpc_endpoint)} timed out" - ) - - if not can_ping(url_to_host(network.tendermint_rpc_endpoint)): - raise TimeoutError( - f"Tendermint Rpc Endpoint {url_to_host(network.tendermint_rpc_endpoint)} timed out" - ) - - TX_CONFIG: TxConfig = TxConfig( tx_type=TxType.BLOCK, gas_multiplier=1.25, diff --git a/tests/endpoint_test.py b/tests/endpoint_test.py new file mode 100644 index 00000000..20c6076a --- /dev/null +++ b/tests/endpoint_test.py @@ -0,0 +1,30 @@ +import requests + +import nibiru as nb + + +def query_chain_id_with_rest(chain: nb.Network) -> str: + resp: requests.Response = requests.get(f"{chain.lcd_endpoint}/node_info") + return resp.json()["node_info"]["network"] + + +def query_chain_id_with_rpc(chain: nb.Network) -> str: + resp: requests.Response = requests.get(f"{chain.tendermint_rpc_endpoint}/status") + return resp.json()["result"]["node_info"]["network"] + + +class TestEndpoints: + @staticmethod + def test_rpc(network: nb.Network) -> bool: + chain_id = query_chain_id_with_rpc(network) + assert chain_id == network.chain_id + + @staticmethod + def test_lcd_rest(network: nb.Network): + chain_id = query_chain_id_with_rest(network) + assert chain_id == network.chain_id + + @staticmethod + def test_grpc(sdk_val: nb.Sdk): + block_height = sdk_val.query.get_latest_block_height() + assert block_height > 0 From 20e46c49a333f5c669df5ed1363380d63f0cdd56 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Tue, 31 Jan 2023 00:11:35 -0600 Subject: [PATCH 3/8] try TX.SYNC again --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index f5c9b410..ba4cdf46 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -89,7 +89,7 @@ def network() -> Network: TX_CONFIG: TxConfig = TxConfig( - tx_type=TxType.BLOCK, + tx_type=TxType.SYNC, gas_multiplier=1.25, gas_price=0.25, ) From cd6f5b767ce867bd4a501a1c6c5c72a565efe08f Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Tue, 31 Jan 2023 00:15:33 -0600 Subject: [PATCH 4/8] revert: SYNC is troll --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index ba4cdf46..f5c9b410 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -89,7 +89,7 @@ def network() -> Network: TX_CONFIG: TxConfig = TxConfig( - tx_type=TxType.SYNC, + tx_type=TxType.BLOCK, gas_multiplier=1.25, gas_price=0.25, ) From 5e398f0fd2623f33fb9c75412a87256ba97a2e0f Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Tue, 31 Jan 2023 00:34:37 -0600 Subject: [PATCH 5/8] try using 'get_sequence_from_node' --- tests/staking_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/staking_test.py b/tests/staking_test.py index d5371c90..0908307c 100644 --- a/tests/staking_test.py +++ b/tests/staking_test.py @@ -23,7 +23,8 @@ def delegate(sdk_val: Sdk): validator_address=get_validator_operator_address(sdk_val), amount=1, ), - ] + ], + True, ) @@ -35,7 +36,8 @@ def undelegate(sdk_val: Sdk): validator_address=get_validator_operator_address(sdk_val), amount=1, ), - ] + ], + True, ) From 4e7eb5345790754c483d81dc6b702d6644c723a5 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Tue, 31 Jan 2023 00:38:14 -0600 Subject: [PATCH 6/8] try setting 'get_sequence_from_node=True' as the default --- nibiru/tx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nibiru/tx.py b/nibiru/tx.py index 57ccf460..2bd88565 100644 --- a/nibiru/tx.py +++ b/nibiru/tx.py @@ -45,7 +45,7 @@ def __init__( def execute_msgs( self, msgs: Union[pt.PythonMsg, List[pt.PythonMsg]], - get_sequence_from_node: bool = False, + get_sequence_from_node: bool = True, **kwargs, ) -> pt.RawTxResp: """ From d32607072bcedb7841918c6cd07ae62f836ae784 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Tue, 31 Jan 2023 00:45:39 -0600 Subject: [PATCH 7/8] try waiting a block between account sequence mismatch errors --- nibiru/tx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nibiru/tx.py b/nibiru/tx.py index 2bd88565..c8966ca2 100644 --- a/nibiru/tx.py +++ b/nibiru/tx.py @@ -100,6 +100,7 @@ def execute_msgs( ): if not isinstance(msgs, list): msgs = [msgs] + self.client.wait_for_next_block() return self.execute_msgs(*msgs, get_sequence_from_node=True, **kwargs) if address: From 8978c4395a5db6ce9d93bd5900a668c4d24dfffe Mon Sep 17 00:00:00 2001 From: Oleg Nikonychev Date: Tue, 31 Jan 2023 15:11:02 +0400 Subject: [PATCH 8/8] fix: recovered isort and updated deps versions --- .pre-commit-config.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2465ca69..5ea99daf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ repos: - repo: https://github.com/floatingpurr/sync_with_poetry - rev: "" # the revision or tag to clone at + rev: "0.4.0" # the revision or tag to clone at hooks: - id: sync_with_poetry args: [] # optional args - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 + rev: v4.4.0 hooks: - id: end-of-file-fixer exclude: nibiru/proto/.+ @@ -20,7 +20,15 @@ repos: files: \.py$ exclude: nibiru/proto/.+ + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + files: \.py$ + exclude: nibiru/proto/.+ + args: [ "--profile", "black" ] + - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 6.0.0 hooks: - id: flake8