Skip to content

Commit 21d4bbf

Browse files
authored
python313Packages.pyproject-parser: specify optional-dependencies (#380497)
2 parents 3c003fc + 1f2234d commit 21d4bbf

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

pkgs/development/python-modules/pyproject-parser/default.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
setuptools,
66
apeye-core,
77
attrs,
8+
click,
9+
consolekit,
10+
docutils,
811
dom-toml,
912
domdf-python-tools,
1013
natsort,
1114
packaging,
15+
readme-renderer,
16+
sdjson,
1217
shippinglabel,
1318
typing-extensions,
1419
}:
@@ -34,6 +39,20 @@ buildPythonPackage rec {
3439
shippinglabel
3540
typing-extensions
3641
];
42+
43+
optional-dependencies = {
44+
all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies));
45+
cli = [
46+
click
47+
consolekit
48+
sdjson
49+
];
50+
readme = [
51+
docutils
52+
readme-renderer
53+
] ++ readme-renderer.optional-dependencies.md;
54+
};
55+
3756
postPatch = ''
3857
substituteInPlace pyproject.toml \
3958
--replace-fail '"setuptools!=61.*,<=67.1.0,>=40.6.0"' '"setuptools"'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
buildPythonPackage,
3+
domdf-python-tools,
4+
fetchFromGitHub,
5+
lib,
6+
typing-extensions,
7+
whey,
8+
}:
9+
10+
buildPythonPackage rec {
11+
pname = "sdjson";
12+
version = "0.5.0";
13+
pyproject = true;
14+
15+
src = fetchFromGitHub {
16+
owner = "domdfcoding";
17+
repo = "singledispatch-json";
18+
tag = "v${version}";
19+
hash = "sha256-7qwmPhij2X2GLtjeaoMCoOyT0qzYt9oFccWrQOq6LXw=";
20+
};
21+
22+
build-system = [ whey ];
23+
24+
dependencies = [
25+
domdf-python-tools
26+
typing-extensions
27+
];
28+
29+
pythonImportsCheck = [ "sdjson" ];
30+
31+
# missing dependency coincidence
32+
doCheck = false;
33+
34+
meta = {
35+
description = "Custom JSON Encoder for Python utilising functools.singledispatch";
36+
homepage = "https://github.com/domdfcoding/singledispatch-json";
37+
license = lib.licenses.mit;
38+
maintainers = with lib.maintainers; [ dotlambda ];
39+
};
40+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14727,6 +14727,8 @@ self: super: with self; {
1472714727

1472814728
sdds = callPackage ../development/python-modules/sdds { };
1472914729

14730+
sdjson = callPackage ../development/python-modules/sdjson { };
14731+
1473014732
sdkmanager = callPackage ../development/python-modules/sdkmanager { };
1473114733

1473214734
sdnotify = callPackage ../development/python-modules/sdnotify { };

0 commit comments

Comments
 (0)