-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeku.nix
35 lines (29 loc) · 960 Bytes
/
beku.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ python3, runCommand, lib }:
let
# I wish there was a better way. If the command fails, it is very hard to see
# that the problem is here. Perhaps there is some way to evaluate it in python
# and reference __version__ directly?
version = builtins.readFile (runCommand "foo" { src = [ ./src ]; } ''
PYTHONPATH=$src ${python3}/bin/python -c 'import beku.version; print(beku.version.__version__)' > $out
'');
manifest = (lib.importTOML ./pyproject.toml).project;
in
python3.pkgs.buildPythonApplication {
pname = manifest.name;
# The version is no longer set in pyproject.toml, so we have to jump through
# hoops to extract it from a python script.
# version = manifest.version;
inherit version;
format = "pyproject";
src = builtins.path {
path = ./.;
name = manifest.name;
};
nativeBuildInputs = with python3.pkgs; [
setuptools
];
propagatedBuildInputs = with python3.pkgs; [
jinja2
pyyaml
];
}