Skip to content

Instantly share code, notes, and snippets.

@mmahut
Created January 2, 2020 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmahut/c754cfd67ed96f8ae0de0dae29c0abce to your computer and use it in GitHub Desktop.
Save mmahut/c754cfd67ed96f8ae0de0dae29c0abce to your computer and use it in GitHub Desktop.
$ cat default.nix
with import <nixpkgs> {};
let
python = let
packageOverrides = self: super: {
trezor = super.trezor.overridePythonAttrs(old: rec {
version = "master";
src = ./.;
});
};
in pkgs.python3.override {inherit packageOverrides; self = python;};
in python.withPackages(ps:[ps.trezor])
mmahut@highhopes ~/repo/trezor-firmware/python (master) $ nix-build
these derivations will be built:
/nix/store/nmp53lmjhjbmsy6dkq83dyxf5ds112ab-python3.7-trezor-master.drv
/nix/store/ja3f0gf4ys23pm0i509fnybb20gwm5cv-python3-3.7.5-env.drv
building '/nix/store/nmp53lmjhjbmsy6dkq83dyxf5ds112ab-python3.7-trezor-master.drv'...
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing setuptools-check-hook
unpacking sources
unpacking source archive /nix/store/shaxg7z5qnxf0a05z6yjvqi0wibqkvxk-python
source root is python
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file python/tox.ini
patching sources
configuring
no configure script, doing nothing
building
Executing setuptoolsBuildPhase
running bdist_wheel
running build
running build_py
(...)
Requirement already satisfied: certifi>=2017.4.17 in /nix/store/jc7ilfiyw2nwj5c7cs5zrd7rms3r8yl1-python3.7-certifi-2019.6.16/lib/python3.7/site-packages (from requests>=2.4.0->trezor==0.11.6) (2019.6.16)
Requirement already satisfied: idna<2.9,>=2.5 in /nix/store/hhcm6q72rl3km2gala7cgkavakdl0s08-python3.7-idna-2.8/lib/python3.7/site-packages (from requests>=2.4.0->trezor==0.11.6) (2.8)
Installing collected packages: trezor
WARNING: The script trezorctl is installed in '/nix/store/flmjm6jcfv612wg9dg7drd8hsxrpamj1-python3.7-trezor-master/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed trezor-0.11.6
/build/python
Finished executing pipInstallPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/flmjm6jcfv612wg9dg7drd8hsxrpamj1-python3.7-trezor-master
strip is /nix/store/ajrrkivdfvp8dp4vdg5hp1h5hblmanc9-binutils-2.31.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/flmjm6jcfv612wg9dg7drd8hsxrpamj1-python3.7-trezor-master/lib /nix/store/flmjm6jcfv612wg9dg7drd8hsxrpamj1-python3.7-trezor-master/bin
patching script interpreter paths in /nix/store/flmjm6jcfv612wg9dg7drd8hsxrpamj1-python3.7-trezor-master
checking for references to /build/ in /nix/store/flmjm6jcfv612wg9dg7drd8hsxrpamj1-python3.7-trezor-master...
Rewriting #!/nix/store/k5rdcbcwwpvj7l9f1yvd5mfggcfz16kk-python3-3.7.5/bin/python3.7 to #!/nix/store/k5rdcbcwwpvj7l9f1yvd5mfggcfz16kk-python3-3.7.5
wrapping `/nix/store/flmjm6jcfv612wg9dg7drd8hsxrpamj1-python3.7-trezor-master/bin/trezorctl'...
running install tests
============================= test session starts ==============================
platform linux -- Python 3.7.5, pytest-5.1.0, py-1.8.0, pluggy-0.12.0
rootdir: /build/python
collected 0 items
============================ no tests ran in 0.00s =============================
ERROR: file or package not found: trezorlib.tests.unit_tests (missing __init__.py?)
builder for '/nix/store/nmp53lmjhjbmsy6dkq83dyxf5ds112ab-python3.7-trezor-master.drv' failed with exit code 4
cannot build derivation '/nix/store/ja3f0gf4ys23pm0i509fnybb20gwm5cv-python3-3.7.5-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/ja3f0gf4ys23pm0i509fnybb20gwm5cv-python3-3.7.5-env.drv' failed
mmahut@highhopes ~/repo/trezor-firmware/python (master) $
mmahut@highhopes ~/repo/trezor-firmware/python (master) $ cat default.nix
with import <nixpkgs> {};
let
python = let
packageOverrides = self: super: {
trezor = super.trezor.overridePythonAttrs(old: rec {
version = "master";
src = ./.;
doCheck = true; # set to false if you want to skip tests
checkPhase = ''
runHook preCheck
pytest tests/ --ignore tests/test_tx_api.py
runHook postCheck
'';
});
};
in pkgs.python3.override {inherit packageOverrides; self = python;};
in python.withPackages(ps:[ps.trezor])
mmahut@highhopes ~/repo/trezor-firmware/python (master) $ nix-build
these derivations will be built:
/nix/store/1d18x4h6bm9rpb984gwcicmzxg8661bc-python3.7-trezor-master.drv
/nix/store/k9v89hpk1pai5dv19byshklzlyw4mkb0-python3-3.7.5-env.drv
building '/nix/store/1d18x4h6bm9rpb984gwcicmzxg8661bc-python3.7-trezor-master.drv'...
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
(...)
Requirement already satisfied: certifi>=2017.4.17 in /nix/store/jc7ilfiyw2nwj5c7cs5zrd7rms3r8yl1-python3.7-certifi-2019.6.16/lib/python3.7/site-packages (from requests>=2.4.0->trezor==0.11.6) (2019.6.16)
Requirement already satisfied: idna<2.9,>=2.5 in /nix/store/hhcm6q72rl3km2gala7cgkavakdl0s08-python3.7-idna-2.8/lib/python3.7/site-packages (from requests>=2.4.0->trezor==0.11.6) (2.8)
Installing collected packages: trezor
WARNING: The script trezorctl is installed in '/nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed trezor-0.11.6
/build/python
Finished executing pipInstallPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master
strip is /nix/store/ajrrkivdfvp8dp4vdg5hp1h5hblmanc9-binutils-2.31.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master/lib /nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master/bin
patching script interpreter paths in /nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master
checking for references to /build/ in /nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master...
Rewriting #!/nix/store/k5rdcbcwwpvj7l9f1yvd5mfggcfz16kk-python3-3.7.5/bin/python3.7 to #!/nix/store/k5rdcbcwwpvj7l9f1yvd5mfggcfz16kk-python3-3.7.5
wrapping `/nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master/bin/trezorctl'...
running install tests
============================= test session starts ==============================
platform linux -- Python 3.7.5, pytest-5.1.0, py-1.8.0, pluggy-0.12.0
rootdir: /build/python
collected 54 items
tests/test_ckd_public.py . [ 1%]
tests/test_cosi.py ........... [ 22%]
tests/test_nem.py . [ 24%]
tests/test_protobuf_encoding.py .......... [ 42%]
tests/test_protobuf_misc.py ......... [ 59%]
tests/test_stellar.py ................... [ 94%]
tests/test_transport.py ... [100%]
=============================== warnings summary ===============================
/nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master/lib/python3.7/site-packages/trezorlib/ckd_public.py:29
/nix/store/zq3q9h4v693qk58gfajlam37a8az2ghj-python3.7-trezor-master/lib/python3.7/site-packages/trezorlib/ckd_public.py:29: DeprecationWarning: ckd_public module is deprecated and will be removed
warnings.warn("ckd_public module is deprecated and will be removed", DeprecationWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================== 54 passed, 1 warnings in 1.05s ========================
pythonCatchConflictsPhase
pythonRemoveBinBytecodePhase
pythonImportsCheckPhase
Executing pythonImportsCheckPhase
pytestcachePhase
building '/nix/store/k9v89hpk1pai5dv19byshklzlyw4mkb0-python3-3.7.5-env.drv'...
created 356 symlinks in user environment
/nix/store/d5gqk815kixvdy861icwvsfhnp09pc4g-python3-3.7.5-env
mmahut@highhopes ~/repo/trezor-firmware/python (master) $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment