drop requirements: mock, requests. merge [server] into the main requirement section

This commit is contained in:
Lex Berezhny 2018-11-20 22:57:59 -05:00
parent ed880be3e5
commit 10c1f8e1cf
3 changed files with 13 additions and 20 deletions

View file

@ -39,31 +39,25 @@ setup(
'aiorpcx==0.9.0', 'aiorpcx==0.9.0',
'coincurve', 'coincurve',
'pbkdf2', 'pbkdf2',
'cryptography' 'cryptography',
'attrs',
'plyvel',
'pylru'
), ),
extras_require={ extras_require={
'test': ( 'gui': (
'mock',
'requests',
),
'server': (
'attrs',
'plyvel',
'pylru'
),
'ui': (
'pyside2', 'pyside2',
) )
}, },
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'torba-client=torba.client.cli:main', 'torba-client=torba.client.cli:main',
'torba-server=torba.server.cli:main [server]', 'torba-server=torba.server.cli:main',
'orchstr8=torba.orchstr8.cli:main [server]', 'orchstr8=torba.orchstr8.cli:main',
], ],
'gui_scripts': [ 'gui_scripts': [
'torba=torba.ui:main [ui]', 'torba=torba.ui:main [gui]',
'torba-workbench=torba.workbench:main [ui]', 'torba-workbench=torba.workbench:main [gui]',
] ]
} }
) )

View file

@ -9,8 +9,7 @@ import subprocess
import importlib import importlib
from binascii import hexlify from binascii import hexlify
from typing import Type, Optional from typing import Type, Optional
import urllib.request
import requests
from torba.server.server import Server from torba.server.server import Server
from torba.server.env import Env from torba.server.env import Env
@ -256,9 +255,9 @@ class BlockchainNode:
if not os.path.exists(downloaded_file): if not os.path.exists(downloaded_file):
self.log.info('Downloading: %s', self.latest_release_url) self.log.info('Downloading: %s', self.latest_release_url)
response = requests.get(self.latest_release_url, stream=True) with urllib.request.urlopen(self.latest_release_url) as response:
with open(downloaded_file, 'wb') as f: with open(downloaded_file, 'wb') as out_file:
shutil.copyfileobj(response.raw, f) shutil.copyfileobj(response, out_file)
self.log.info('Extracting: %s', downloaded_file) self.log.info('Extracting: %s', downloaded_file)