1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 rustPlatform,
7 cargo,
8 rustc,
9 libiconv,
10}:
11
12buildPythonPackage rec {
13 pname = "pdoc-pyo3-sample-library";
14 version = "1.0.11";
15 pyproject = true;
16
17 src = fetchPypi {
18 pname = "pdoc_pyo3_sample_library";
19 inherit version;
20 hash = "sha256-ZGMo7WgymkSDQu8tc4rTfWNsIWO0AlDPG0OzpKRq3oA=";
21 };
22
23 cargoDeps = rustPlatform.fetchCargoVendor {
24 inherit src;
25 hash = "sha256-XqXkheK8OEzlLEbq09KMRFxrjJBnFaxvj4rIL2gmydA=";
26 };
27
28 nativeBuildInputs = [
29 rustPlatform.cargoSetupHook
30 rustPlatform.maturinBuildHook
31 cargo
32 rustc
33 ];
34
35 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
36
37 pythonImportsCheck = [ "pdoc_pyo3_sample_library" ];
38
39 # no tests
40 doCheck = false;
41
42 meta = {
43 description = "Sample PyO3 library used in pdoc tests";
44 homepage = "https://github.com/mitmproxy/pdoc-pyo3-sample-library";
45 license = lib.licenses.mit;
46 maintainers = [ lib.maintainers.pbsds ];
47 };
48}