1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 maturin,
6 pythonOlder,
7 rustPlatform,
8 rustc,
9 cargo,
10 semantic-version,
11 setuptools,
12 setuptools-rust,
13 setuptools-scm,
14 tomli,
15 typing-extensions,
16}:
17
18buildPythonPackage rec {
19 pname = "setuptools-rust";
20 version = "1.11.0";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.6";
24
25 src = fetchPypi {
26 pname = "setuptools_rust";
27 inherit version;
28 hash = "sha256-92XWbz3vb9yF4ebYicaoEq6hQwyNrc8ce2d5tF+HT7I=";
29 };
30
31 build-system = [
32 setuptools
33 setuptools-scm
34 ];
35
36 dependencies = [
37 semantic-version
38 setuptools
39 ];
40
41 pythonImportsCheck = [ "setuptools_rust" ];
42
43 doCheck = false;
44
45 passthru.tests = {
46 pyo3 = maturin.tests.pyo3.override {
47 format = "setuptools";
48 buildAndTestSubdir = null;
49
50 nativeBuildInputs =
51 [ setuptools-rust ]
52 ++ [
53 rustPlatform.cargoSetupHook
54 cargo
55 rustc
56 ];
57
58 preConfigure = ''
59 # sourceRoot puts Cargo.lock in the wrong place due to the
60 # example setup.
61 cd examples/word-count
62 '';
63 };
64 };
65
66 meta = with lib; {
67 description = "Setuptools plugin for Rust support";
68 homepage = "https://github.com/PyO3/setuptools-rust";
69 changelog = "https://github.com/PyO3/setuptools-rust/releases/tag/v${version}";
70 license = licenses.mit;
71 maintainers = [ ];
72 };
73}