blob: 5a2272c668c3ea029274875880c1e3c6028f83f5 (
plain) (
blame)
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
|
{ lib
, fetchPypi
, buildPythonPackage
, pytestCheckHook
, pycparser
, psutil
, dotnet-sdk
, buildDotnetModule
, clr-loader
, setuptools
}:
let
pname = "pythonnet";
version = "3.0.3";
src = fetchPypi {
pname = "pythonnet";
inherit version;
hash = "sha256-jUsulxWKAjh1+GR0WKWPOIF/T+Oa9gq91rDYrfHXfnU=";
};
# This buildDotnetModule is used only to get nuget sources, the actual
# build is done in `buildPythonPackage` below.
dotnet-build = buildDotnetModule {
inherit pname version src;
nugetDeps = ./deps.nix;
};
in
buildPythonPackage {
inherit pname version src;
format = "pyproject";
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'dynamic = ["version"]' 'version = "${version}"'
'';
nativeBuildInputs = [
setuptools
dotnet-sdk
];
propagatedBuildInputs = [
pycparser
clr-loader
];
pytestFlagsArray = [
# Run tests using .NET Core, Mono is unsupported for now due to find_library problem in clr-loader
"--runtime coreclr"
];
nativeCheckInputs = [
pytestCheckHook
psutil # needed for memory leak tests
];
# Perform dotnet restore based on the nuget-source
preConfigure = ''
dotnet restore \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--source ${dotnet-build.nuget-source}
'';
# Rerun this when updating to refresh Nuget dependencies
passthru.fetch-deps = dotnet-build.fetch-deps;
meta = with lib; {
description = ".NET integration for Python";
homepage = "https://pythonnet.github.io";
changelog = "https://github.com/pythonnet/pythonnet/releases/tag/v${version}";
license = licenses.mit;
# <https://github.com/pythonnet/pythonnet/issues/898>
badPlatforms = [ "aarch64-linux" ];
maintainers = with maintainers; [ jraygauthier mdarocha ];
};
}
|