mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-27 06:25:23 +00:00

Otherwise references to the Python interpreter inside the set are wrong, as demonstrated by: ``` nix with import <nixpkgs> { }; let python' = python3.override { packageOverrides = final: prev: { requests = prev.requests.overridePythonAttrs(old: { version = "1337"; }); }; }; in python'.pkgs.python.pkgs.requests ``` which returns the _non_ overriden requests. And the same with `self`: ``` with import <nixpkgs> { }; let python' = python3.override { self = python'; packageOverrides = final: prev: { requests = prev.requests.overridePythonAttrs(old: { version = "1337"; }); }; }; in python'.pkgs.python.pkgs.requests ``` which returns the overriden requests. This can manifest itself as file collisions when constructing environments or as subtly incorrect dependency graphs.
31 lines
803 B
Nix
31 lines
803 B
Nix
{ lib
|
|
, python3
|
|
}:
|
|
|
|
let python = python3.override {
|
|
self = python;
|
|
packageOverrides = self: super: {
|
|
# see https://github.com/devicetree-org/dt-schema/issues/108
|
|
jsonschema = super.jsonschema.overridePythonAttrs (old: rec {
|
|
version = "4.17.3";
|
|
disabled = self.pythonOlder "3.7";
|
|
|
|
src = old.src.override {
|
|
inherit version;
|
|
hash = "sha256-D4ZEN6uLYHa6ZwdFPvj5imoNUSqA6T+KvbZ29zfstg0=";
|
|
};
|
|
|
|
propagatedBuildInputs = with self; ([
|
|
attrs
|
|
pyrsistent
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
importlib-metadata
|
|
typing-extensions
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
importlib-resources
|
|
pkgutil-resolve-name
|
|
]);
|
|
});
|
|
};
|
|
}; in python.pkgs.toPythonApplication python.pkgs.dtschema
|