-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
113 lines (95 loc) · 2.83 KB
/
default.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{ pkgs ? import <nixpkgs> {}
, src ? builtins.filterSource (
path: type: !( baseNameOf path == "build" && type == "directory" ) &&
!( baseNameOf path == "dist" && type == "directory" ) &&
!( baseNameOf path == "result" )
) ./.
, litrepl
} :
let
python = pkgs.python3;
local = rec {
inherit (pkgs) atool curl wget git;
python-dev = pkgs.python3.withPackages (
pp: let
pylsp = pp.python-lsp-server;
pylsp-mypy = pp.pylsp-mypy.override { python-lsp-server=pylsp; };
in with pp; [
setuptools
setuptools_scm
ipython
hypothesis
pytest
pytest-mypy
pytest-cov
pytest_xdist
# Pweave
coverage
pylsp
pylsp-mypy
pyyaml
wheel
scipy
matplotlib
pyqt5
twine
# (pydoc-markdown pp)
codecov
]);
pylightnix = with python.pkgs; buildPythonPackage {
pname = "pylightnix";
version = "9999";
inherit src;
preConfigure = ''
export PATH="${atool}/bin:${curl}/bin:${wget}/bin:${git}/bin:$PATH"
if ! test -d /build/pylightnix/.git ; then
echo "Looks like Pylightnix is a submodule of some other repo."\
"\`nix-build\` is unable to detect its version, unfortunately."\
"Please checkout Pylightnix as a normal Git repository"\
"and retry." >&2
exit 1
fi
'';
buildInputs = [ setuptools_scm ];
checkInputs = [ pytest pytest-mypy hypothesis ];
checkPhase = ''
export PATH=\
"${pkgs.atool}/bin:${pkgs.curl}/bin:${pkgs.wget}/bin:"\
"${pkgs.zip}/bin:${pkgs.unzip}/bin:$PATH"
pytest
'';
doCheck = true;
};
shell = pkgs.mkShell {
name = "shell";
buildInputs = with pkgs; [
gnumake
cloc
python-dev
litrepl.litrepl-release
(let
mytexlive = texlive.override { python3=python-dev; };
in
mytexlive.combine {
scheme-medium = mytexlive.scheme-medium;
inherit (mytexlive) fvextra upquote xstring pgfopts currfile
collection-langcyrillic makecell ftnxtra minted catchfile framed
pdflscape environ trimspaces mdframed zref needspace import;
}
)
];
shellHook = with pkgs; ''
export PYTHONPATH=`pwd`/src:$PYTHONPATH
export MYPYPATH=`pwd`/src:`pwd`/tests
export QT_QPA_PLATFORM_PLUGIN_PATH=`echo ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms/`
# 1980 workaround https://github.com/NixOS/nixpkgs/issues/270#issuecomment-467583872
export SOURCE_DATE_EPOCH=315532800
alias ipython="sh $(pwd)/ipython.sh"
'';
};
collection = {
inherit pylightnix shell;
};
};
in
local.collection