Skip to content

Commit 09abfbd

Browse files
committed
Dont tie derivation to python version 3.11
1 parent 5755659 commit 09abfbd

File tree

2 files changed

+49
-38
lines changed

2 files changed

+49
-38
lines changed

default.nix

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,4 @@
33
sha256 = "1lr1h35prqkd1mkmzriwlpvxcb34kmhc9dnr48gkm8hh089hifmx";
44
}) {} ) }:
55

6-
let
7-
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
8-
project = pyproject.project;
9-
in
10-
pkgs.python311Packages.buildPythonPackage rec {
11-
pname = project.name;
12-
inherit (project) version;
13-
14-
src = ./.;
15-
16-
format = "pyproject";
17-
18-
nativeCheckInputs = with pkgs.python311Packages; [
19-
setuptools
20-
21-
pytest
22-
pytest-cov
23-
24-
pkgs.git
25-
];
26-
27-
propagatedBuildInputs = with pkgs.python311Packages; [
28-
pkgs.git
29-
maya
30-
colorama
31-
dateparser
32-
];
33-
34-
checkPhase = ''
35-
runHook preCheck
36-
pytest
37-
runHook postCheck
38-
'';
39-
40-
postInstall = ''
41-
install -Dm755 ${./aux/git_add_ssh_remote.sh} $out/bin/git_add_ssh_remote.sh
42-
'';
43-
}
6+
pkgs.python3Packages.callPackage ./derivation.nix {}

derivation.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
buildPythonPackage,
3+
setuptools,
4+
pytest,
5+
pytest-cov,
6+
git,
7+
maya,
8+
colorama,
9+
dateparser
10+
}:
11+
let
12+
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
13+
project = pyproject.project;
14+
in
15+
buildPythonPackage rec {
16+
pname = project.name;
17+
inherit (project) version;
18+
19+
src = ./.;
20+
21+
format = "pyproject";
22+
23+
nativeCheckInputs = [
24+
setuptools
25+
26+
pytest
27+
pytest-cov
28+
29+
git
30+
];
31+
32+
propagatedBuildInputs = [
33+
git
34+
maya
35+
colorama
36+
dateparser
37+
];
38+
39+
checkPhase = ''
40+
runHook preCheck
41+
pytest
42+
runHook postCheck
43+
'';
44+
45+
postInstall = ''
46+
install -Dm755 ${./aux/git_add_ssh_remote.sh} $out/bin/git_add_ssh_remote.sh
47+
'';
48+
}

0 commit comments

Comments
 (0)