mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-24 23:14:12 +03:00
5a729cb75a
Use `lib.importTOML`, clearer than the previous implementation. Reuse more information from `pyproject`.
36 lines
650 B
Nix
36 lines
650 B
Nix
# An example package with dependencies defined via pyproject.toml
|
|
{
|
|
config,
|
|
lib,
|
|
dream2nix,
|
|
...
|
|
}: let
|
|
pyproject = lib.importTOML (config.mkDerivation.src + /pyproject.toml);
|
|
in {
|
|
imports = [
|
|
dream2nix.modules.dream2nix.pip
|
|
];
|
|
|
|
inherit (pyproject.project) name version;
|
|
|
|
mkDerivation = {
|
|
src = ./.;
|
|
};
|
|
|
|
buildPythonPackage = {
|
|
format = lib.mkForce "pyproject";
|
|
pythonImportsCheck = [
|
|
"my_tool"
|
|
];
|
|
};
|
|
|
|
pip = {
|
|
pypiSnapshotDate = "2023-08-27";
|
|
requirementsList =
|
|
pyproject.build-system.requires
|
|
or []
|
|
++ pyproject.project.dependencies;
|
|
flattenDependencies = true;
|
|
};
|
|
}
|