2023-05-03 11:16:25 +02:00
|
|
|
{ lib, poetry2nix, python3 }:
|
|
|
|
|
|
|
|
poetry2nix.mkPoetryApplication {
|
|
|
|
python = python3;
|
|
|
|
pyproject = ./pyproject.toml;
|
|
|
|
poetrylock = ./poetry.lock;
|
|
|
|
src = lib.cleanSource ./.;
|
2023-05-03 15:36:31 +02:00
|
|
|
# Workaround `ModuleNotFoundError: No module named 'poetry'`
|
|
|
|
# cf. https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#modulenotfounderror-no-module-named-packagename
|
|
|
|
overrides =
|
|
|
|
let
|
|
|
|
pypkgs-build-requirements = {
|
|
|
|
pytest-metadata = [ "poetry" ];
|
|
|
|
pytest-select = [ "poetry" ];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
poetry2nix.defaultPoetryOverrides.extend (self: super:
|
|
|
|
builtins.mapAttrs
|
|
|
|
(package: build-requirements:
|
|
|
|
(builtins.getAttr package super).overridePythonAttrs (old: {
|
|
|
|
buildInputs = (old.buildInputs or [ ]) ++ (builtins.map (pkg: if builtins.isString pkg then builtins.getAttr pkg super else pkg) build-requirements);
|
|
|
|
})
|
|
|
|
)
|
|
|
|
pypkgs-build-requirements
|
|
|
|
);
|
2023-05-03 11:16:25 +02:00
|
|
|
}
|