diff --git a/raiden_installer/base.py b/raiden_installer/base.py index 8acf8382..d314bd47 100644 --- a/raiden_installer/base.py +++ b/raiden_installer/base.py @@ -22,9 +22,10 @@ from urllib.parse import urlparse from xml.etree import ElementTree -import psutil import requests import toml + +import psutil from eth_keyfile import create_keyfile_json, decode_keyfile_json from eth_utils import to_checksum_address from raiden_contracts.constants import CONTRACT_CUSTOM_TOKEN, CONTRACT_USER_DEPOSIT @@ -35,7 +36,6 @@ ) from web3 import HTTPProvider, Web3 from web3.middleware import construct_sign_and_send_raw_middleware, geth_poa_middleware - from xdg import XDG_DATA_HOME logger = logging.getLogger(__name__) @@ -349,6 +349,10 @@ def get_date(timestamp): if regex: release_date = get_date(release_data["published_at"]) major, minor, revision = regex["major"], regex["minor"], regex["revision"] + try: + extra = regex["extra"] + except IndexError: + extra = "" releases.append( cls( release=f"{major}.{minor}.{revision}", @@ -357,6 +361,7 @@ def get_date(timestamp): day=release_date.day, major=major, minor=minor, + extra=extra, revision=revision, browser_download_url=asset_data.get("browser_download_url"), ) @@ -378,7 +383,9 @@ class RaidenTestnetRelease(RaidenClient): @property def version(self): - return f"Raiden Preview {self.major}.{self.minor}.{self.revision} (Testnet only)" + return ( + f"Raiden Preview {self.major}.{self.minor}.{self.revision}-{self.extra} (Testnet only)" + ) class RaidenNightly(RaidenClient): diff --git a/requirements.txt b/requirements.txt index 1ac6c85e..06e1b47b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,7 +33,7 @@ pycodestyle==2.5.0 pycparser==2.19 pycryptodome==3.8.2 pytest==5.0.1 -raiden-contracts==0.29.0 +raiden-contracts==0.32.0 requests==2.22.0 rlp==1.1.0 semantic-version==2.6.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..02b43367 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,24 @@ +[flake8] +ignore = B011, C814, E203, E402, E731, W503, W504 +max-line-length = 99 +exclude = build,dist,.git, + +[pep8] +ignore = E731, E203, E402, W503, W504, C814 +max-line-length = 99 + +[isort] +line_length=99 +known_future_library=future +# black compatibility +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +use_parentheses=True + +[mypy] +ignore_missing_imports = True +check_untyped_defs = True +# disallow_untyped_defs = True +warn_unused_configs = True +warn_unused_ignores = True diff --git a/tests/integration.py b/tests/integration.py index c31334b6..1f902b04 100644 --- a/tests/integration.py +++ b/tests/integration.py @@ -1,10 +1,9 @@ import os -import unittest import tempfile +import unittest from pathlib import Path -from installer import base - +from raiden_installer import base ETHEREUM_RPC_ENDPOINT = os.getenv("TEST_RAIDEN_INSTALLER_ETH_RPC_URL") ETHEREUM_NETWORK_NAME = os.getenv("TEST_RAIDEN_INSTALLER_ETHEREUM_NETWORK") @@ -19,9 +18,7 @@ def setUp(self): base.Account.DEFAULT_KEYSTORE_FOLDER = Path(tempfile.gettempdir()).joinpath( "raiden", "installer", "integration" ) - self.ethereum_rpc_provider = base.EthereumRPCProvider.make_from_url( - ETHEREUM_RPC_ENDPOINT - ) + self.ethereum_rpc_provider = base.EthereumRPCProvider.make_from_url(ETHEREUM_RPC_ENDPOINT) self.account = base.Account.create("test_raiden_integration") self.network = base.Network.get_by_name(ETHEREUM_NETWORK_NAME) @@ -38,9 +35,7 @@ def test_can_fund_account(self): class TokenTestCase(IntegrationTestCase): def setUp(self): super().setUp() - self.token = base.Token( - ethereum_rpc_endppoint=ETHEREUM_RPC_ENDPOINT, account=self.account - ) + self.token = base.Token(ethereum_rpc_endppoint=ETHEREUM_RPC_ENDPOINT, account=self.account) def test_can_not_mint_tokens_without_gas(self): with self.assertRaises(ValueError): @@ -48,5 +43,4 @@ def test_can_not_mint_tokens_without_gas(self): def test_can_mint_tokens(self): self.network.fund(self.account) - self.token.mint(self.token.TOKEN_AMOUNT) diff --git a/tests/unit.py b/tests/unit.py index 731245bc..fa3fcff1 100644 --- a/tests/unit.py +++ b/tests/unit.py @@ -1,5 +1,5 @@ -import unittest import tempfile +import unittest from pathlib import Path from raiden_installer import base @@ -46,9 +46,7 @@ def setUp(self): token=self.token, ) - passphrase_file = base.PassphraseFile( - self.configuration_file.passphrase_file_path - ) + passphrase_file = base.PassphraseFile(self.configuration_file.passphrase_file_path) passphrase_file.store(self.account.passphrase) def test_can_save_configuration(self): @@ -64,3 +62,7 @@ def tearDown(self): for config in base.RaidenConfigurationFile.get_available_configurations(): config.passphrase_file_path.unlink() config.path.unlink() + + +if __name__ == "__main__": + unittest.main()