1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

build: reorganize requirements, mark hidapi as optional

This drops the command line options. `libusb` is now required
unconditionally (it's cffi so no harm there). hidapi is an extra.
You either need to install it manually, or specify it in your
requirements.txt like so:

trezor[hidapi] >= 0.9.2
This commit is contained in:
matejcik 2018-05-04 15:54:23 +02:00
parent ce7a434f2d
commit 41d99764c6
4 changed files with 9 additions and 12 deletions

4
requirements-dev.txt Normal file
View File

@ -0,0 +1,4 @@
-r requirements.txt
-r requirements-optional.txt
pytest>=3.5.0
mock>=2.0.0

View File

@ -0,0 +1 @@
hidapi >= 0.7.99.post20

View File

@ -3,6 +3,5 @@ mnemonic>=0.17
requests>=2.4.0
click>=6.2
pyblake2>=0.9.3
hidapi>=0.7.99.post20
libusb1>=1.6.4
rlp>=0.6.0

View File

@ -15,19 +15,9 @@ install_requires = [
'click>=6.2',
'pyblake2>=0.9.3',
'rlp>=0.6.0',
'libusb1>=1.6.4',
]
import sys
if '--disable-hidapi' in sys.argv:
sys.argv.remove('--disable-hidapi')
else:
install_requires.append('hidapi>=0.7.99.post20')
if '--disable-libusb' in sys.argv:
sys.argv.remove('--disable-libusb')
else:
install_requires.append('libusb1>=1.6.4')
from trezorlib import __version__ as VERSION
@ -97,6 +87,9 @@ setup(
},
scripts=['trezorctl'],
install_requires=install_requires,
extras_require={
'hidapi': ['hidapi>=0.7.99.post20'],
},
python_requires='>=3.3',
include_package_data=True,
zip_safe=False,