e0816431a2
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.
42 lines
954 B
Nix
42 lines
954 B
Nix
{ python3
|
|
, fetchFromGitHub
|
|
}:
|
|
|
|
let
|
|
python = python3.override {
|
|
self = python;
|
|
packageOverrides = self: super: {
|
|
# https://github.com/domainaware/parsedmarc/issues/464
|
|
msgraph-core = super.msgraph-core.overridePythonAttrs (old: rec {
|
|
version = "0.2.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "microsoftgraph";
|
|
repo = "msgraph-sdk-python-core";
|
|
rev = "v${version}";
|
|
hash = "sha256-eRRlG3GJX3WeKTNJVWgNTTHY56qiUGOlxtvEZ2xObLA=";
|
|
};
|
|
|
|
nativeBuildInputs = with self; [
|
|
flit-core
|
|
];
|
|
|
|
propagatedBuildInputs = with self; [
|
|
requests
|
|
];
|
|
|
|
nativeCheckInputs = with self; [
|
|
pytestCheckHook
|
|
responses
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
"tests/integration"
|
|
];
|
|
|
|
pythonImportsCheck = [ "msgraph.core" ];
|
|
});
|
|
};
|
|
};
|
|
in with python.pkgs; toPythonApplication parsedmarc
|