1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

python: clarify requirements, enable tox in CI

This commit is contained in:
matejcik 2019-08-09 18:08:35 +02:00 committed by matejcik
parent 946a322a93
commit d521903963
9 changed files with 53 additions and 18 deletions

View File

@ -35,6 +35,6 @@ include:
- ci/prebuild.yml # common, style
- ci/core.yml
- ci/legacy.yml
# - ci/python.yml TODO
- ci/python.yml
- ci/crypto.yml
- ci/storage.yml

View File

@ -10,12 +10,16 @@ scons = "*"
protobuf = "==3.4.0"
pyblake2 = "*"
## tests
## test tools
pytest = "*"
mock = "*"
coverage = "==4.5.3" # coverage 5+ uses binary format
flaky = ">=3.6.1" # https://github.com/box/flaky/issues/156
pytest-random-order = "*"
tox = "*"
## test requirements
shamir-mnemonic = "*"
## typing
mypy = "*"

25
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "dcb322f20cb35e8779f1667304894d51dcc8bdaab0ed613502cd4acd356b21ab"
"sha256": "79f117b15c6ca077e6304f4f99517da7c880ba84832ebf8034807996e2c337bd"
},
"pipfile-spec": 6,
"requires": {},
@ -220,6 +220,13 @@
],
"version": "==0.3"
},
"filelock": {
"hashes": [
"sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59",
"sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"
],
"version": "==3.0.12"
},
"flake8": {
"hashes": [
"sha256:19241c1cbc971b9962473e4438a2ca19749a7dd002dd1a946eaba171b4114548",
@ -538,6 +545,7 @@
"sha256:1cc08d276e05b13cd32bd3b0c5d1cb6c30254e0086e0f6857ec106d4cceff121",
"sha256:5e7cc1354697e304b7868fc01085bcd4b30bb2020b77b6cc5ceeb0c032d513a7"
],
"index": "pypi",
"version": "==0.1.0"
},
"six": {
@ -561,6 +569,14 @@
],
"version": "==0.10.0"
},
"tox": {
"hashes": [
"sha256:dab0b0160dd187b654fc33d690ee1d7bf328bd5b8dc6ef3bb3cc468969c659ba",
"sha256:ee35ffce74933a6c6ac10c9a0182e41763140a5a5070e21b114feca56eaccdcd"
],
"index": "pypi",
"version": "==3.13.2"
},
"trezor": {
"editable": true,
"path": "./python"
@ -610,6 +626,13 @@
],
"version": "==1.25.3"
},
"virtualenv": {
"hashes": [
"sha256:6cb2e4c18d22dbbe283d0a0c31bb7d90771a606b2cb3415323eea008eaee6a9d",
"sha256:909fe0d3f7c9151b2df0a2cb53e55bdb7b0d61469353ff7a49fd47b0f0ab9285"
],
"version": "==16.7.2"
},
"wcwidth": {
"hashes": [
"sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e",

View File

@ -17,6 +17,14 @@ RUN echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/so
RUN apt-get update && apt-get install -t stretch-backports -y clang-format-6.0
RUN ln -s clang-format-6.0 /usr/bin/clang-format
# install python versions from deadsnakes
# assuming our installed Python is 3.7
RUN apt-add-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get install -y \
python3.5 python3.5-dev \
python3.6 python3.6-dev \
python3.8 python3.8-dev python3.8-distutils
# TODO are all apt packages actually needed?
# install dependencies from toolchain source build

7
ci/python.yml Normal file
View File

@ -0,0 +1,7 @@
image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment
test python:
stage: test
script:
- cd python
- pipenv run tox

View File

@ -1,8 +0,0 @@
-r requirements.txt
-r requirements-optional.txt
pytest>=3.6
flake8
protobuf
isort>=4.3.14
black; python_version >= "3.6"
autoflake>=1.2

View File

@ -1,6 +1,5 @@
ecdsa>=0.9
mnemonic>=0.17
shamir-mnemonic>=0.1.0
requests>=2.4.0
click>=7,<8
libusb1>=1.6.4

View File

@ -9,7 +9,6 @@ install_requires = [
"setuptools>=19.0",
"ecdsa>=0.9",
"mnemonic>=0.17",
"shamir-mnemonic>=0.1.0",
"requests>=2.4.0",
"click>=7,<8",
"libusb1>=1.6.4",

View File

@ -3,16 +3,19 @@ envlist =
py35,
py36,
py37,
py38,
[testenv]
deps =
-rrequirements-dev.txt
-rrequirements.txt
pytest>=3.6
pytest-random-order
commands =
# Generate local files
python setup.py build
# Working in the local directory, try to compile all bytecode
python -m compileall trezorlib/
# From installed version, smoke-test trezorctl
python -m compileall src tests
# Smoke-test trezorctl
trezorctl --help
# Run non-device-dependent tests from installed version
python -E -m pytest --pyargs trezorlib.tests.unit_tests
# Run test suite
pytest --random-order tests