2021-01-01 20:00:51 +01:00
|
|
|
{ depot, pkgs, python3, python3Lib }:
|
2021-01-01 18:55:33 +01:00
|
|
|
|
|
|
|
let
|
2021-01-01 20:00:51 +01:00
|
|
|
transitiveLib = python3Lib {
|
|
|
|
name = "transitive";
|
|
|
|
} ''
|
|
|
|
def transitive(s):
|
|
|
|
return s + " 1 2 3"
|
|
|
|
'';
|
|
|
|
|
2021-01-01 18:55:33 +01:00
|
|
|
testLib = python3Lib {
|
|
|
|
name = "test_lib";
|
2021-01-01 20:00:51 +01:00
|
|
|
libraries = _: [ transitiveLib ];
|
2021-01-01 18:55:33 +01:00
|
|
|
} ''
|
2021-01-01 20:00:51 +01:00
|
|
|
import transitive
|
2021-01-01 18:55:33 +01:00
|
|
|
def test():
|
2021-01-01 20:00:51 +01:00
|
|
|
return transitive.transitive("test")
|
2021-01-01 18:55:33 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-01 20:00:51 +01:00
|
|
|
pythonWithLib = python3 "python-with-lib" {
|
|
|
|
libraries = _: [ testLib ];
|
2021-01-01 18:55:33 +01:00
|
|
|
} ''
|
|
|
|
import test_lib
|
|
|
|
|
2021-01-01 20:00:51 +01:00
|
|
|
assert(test_lib.test() == "test 1 2 3")
|
2021-01-01 18:55:33 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
in {
|
|
|
|
inherit
|
|
|
|
pythonWithLib;
|
|
|
|
}
|