/
interface.nix
149 lines (143 loc) · 3.97 KB
/
interface.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{
config,
lib,
dream2nix,
packageSets,
specialArgs,
...
}: let
l = lib // builtins;
t = l.types;
mkSubmodule = import ../../../lib/internal/mkSubmodule.nix {inherit lib specialArgs;};
in {
options.pip = mkSubmodule {
imports = [
../overrides
];
config.overrideType = {
imports = [
dream2nix.modules.dream2nix.buildPythonPackage
];
};
options = {
# internal options to pass data between pip-hotfixes and pip
targets = l.mkOption {
type = t.raw;
internal = true;
description = "the targets of the lock file to build";
};
rootDependencies = l.mkOption {
type = t.attrsOf t.bool;
internal = true;
description = "the names of the selected top-level dependencies";
};
# user interface
env = l.mkOption {
type = t.attrsOf t.str;
default = {};
description = ''
environment variables exported while locking
'';
example = lib.literalExpression ''
{
PIP_FIND_LINKS = "''${config.deps.setuptools.dist}";
}
'';
};
pypiSnapshotDate = l.mkOption {
type = t.nullOr t.str;
description = ''
maximum release date for packages
Choose any date from the past.
'';
example = "2023-01-01";
default = null;
};
pipFlags = l.mkOption {
type = t.listOf t.str;
description = ''
list of flags for pip install
'';
default = [];
};
pipVersion = l.mkOption {
type = t.str;
description = ''
pip version to use to generate the report
'';
default = "23.1";
};
requirementsList = l.mkOption {
type = t.listOf t.str;
default = [];
description = ''
list of strings of requirements.txt entries
'';
};
requirementsFiles = l.mkOption {
type = t.listOf t.str;
default = [];
description = ''
list of requirements.txt files
'';
};
buildDependencies = l.mkOption {
type = t.attrsOf t.bool;
default = {
cython = true;
flit-core = true;
flit-scm = true;
hatch-fancy-pypi-readme = true;
hatch-nodejs-version = true;
hatch-vcs = true;
hatchling = true;
pbr = true;
pdm-pep517 = true;
poetry-core = true;
poetry-dynamic-versioning = true;
setuptools = true;
setuptools-odoo = true;
setuptools-scm = true;
versioneer = true;
wheel = true;
};
description = ''
python packages to be added only as buildInputs.
These should be somehow installable from `requirementsList` or
`requirementsFiles` too; listing them here doesn't do that automatically.
'';
example = lib.literalExpression ''
{
setuptools-scm = false; # To disable the default
easy_install = true; # To select easy_install as a buildInput
}
'';
};
buildExtras = l.mkOption {
type = t.listOf t.str;
default = [];
description = ''
list of python "extras" to build with. This can be a subset of the
extras in your lock file.
'';
};
nativeBuildInputs = l.mkOption {
type = t.listOf t.package;
default = [];
description = ''
list of native packages to include during metadata generation
'';
};
drvs = l.mkOption {
internal = true;
# hack because internal=true doesn't propagate to the submodule options
visible = "shallow";
type = t.lazyAttrsOf (t.submoduleWith {
inherit specialArgs;
modules = [dream2nix.modules.dream2nix.core];
});
description = "drv-parts modules that define python dependencies";
};
};
};
}