Add compat hacks, make python version constraints a warning
This commit is contained in:
parent
509e3da4d9
commit
4a88b31471
15
python.nix
15
python.nix
|
@ -3,14 +3,19 @@
|
||||||
, pyproject-nix
|
, pyproject-nix
|
||||||
, clang-tools
|
, clang-tools
|
||||||
, gitlint
|
, gitlint
|
||||||
|
, lib
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
python = python3.override {
|
python = python3.override {
|
||||||
self = python;
|
self = python;
|
||||||
packageOverrides = self: super: {
|
packageOverrides = self: super: {
|
||||||
|
# HACK: Zephyr uses pypi to install non-Python deps
|
||||||
clang-format = clang-tools;
|
clang-format = clang-tools;
|
||||||
inherit gitlint;
|
inherit gitlint;
|
||||||
|
|
||||||
|
# HACK: Older Zephyr depends on these missing dependencies
|
||||||
|
sphinxcontrib-svg2pdfconverter = super.sphinxcontrib-svg2pdfconverter or null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,9 +23,13 @@ let
|
||||||
requirements = zephyr-src + "/scripts/requirements.txt";
|
requirements = zephyr-src + "/scripts/requirements.txt";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
invalidConstraints = project.validators.validateVersionConstraints { inherit python; };
|
||||||
|
|
||||||
in
|
in
|
||||||
assert project.validators.validateVersionConstraints { inherit python; } == { };
|
lib.warnIf
|
||||||
python.withPackages (project.renderers.withPackages {
|
(invalidConstraints != { })
|
||||||
|
"zephyr-pythonEnv: Found invalid Python constraints for: ${builtins.toJSON (lib.attrNames invalidConstraints)}"
|
||||||
|
(python.withPackages (project.renderers.withPackages {
|
||||||
inherit python;
|
inherit python;
|
||||||
extraPackages = ps: [ ps.west ];
|
extraPackages = ps: [ ps.west ];
|
||||||
})
|
}))
|
||||||
|
|
Loading…
Reference in New Issue