2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
2024-09-19 14:19:46 +00:00
|
|
|
maturin,
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonOlder,
|
2024-09-19 14:19:46 +00:00
|
|
|
rustPlatform,
|
|
|
|
rustc,
|
|
|
|
cargo,
|
2024-06-05 15:53:02 +00:00
|
|
|
semantic-version,
|
|
|
|
setuptools,
|
2024-09-19 14:19:46 +00:00
|
|
|
setuptools-rust,
|
2024-06-05 15:53:02 +00:00
|
|
|
setuptools-scm,
|
|
|
|
tomli,
|
|
|
|
typing-extensions,
|
2020-11-03 02:18:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "setuptools-rust";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.9.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-cE3wlI8uTMYMJZatboQOpnn09D5Y7UrQwYV4ByQOq5Y=";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
semantic-version
|
|
|
|
setuptools
|
|
|
|
typing-extensions
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "setuptools_rust" ];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
passthru.tests = {
|
|
|
|
pyo3 = maturin.tests.pyo3.override {
|
|
|
|
format = "setuptools";
|
|
|
|
buildAndTestSubdir = null;
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
|
|
|
[ setuptools-rust ]
|
|
|
|
++ [
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
cargo
|
|
|
|
rustc
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# sourceRoot puts Cargo.lock in the wrong place due to the
|
|
|
|
# example setup.
|
|
|
|
cd examples/word-count
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2021-03-19 17:17:44 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "Setuptools plugin for Rust support";
|
|
|
|
homepage = "https://github.com/PyO3/setuptools-rust";
|
2020-12-25 13:55:36 +00:00
|
|
|
changelog = "https://github.com/PyO3/setuptools-rust/releases/tag/v${version}";
|
2020-11-03 02:18:15 +00:00
|
|
|
license = licenses.mit;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
}
|