159e378cbb
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
73 lines
1.4 KiB
Nix
73 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
maturin,
|
|
pythonOlder,
|
|
rustPlatform,
|
|
rustc,
|
|
cargo,
|
|
semantic-version,
|
|
setuptools,
|
|
setuptools-rust,
|
|
setuptools-scm,
|
|
tomli,
|
|
typing-extensions,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "setuptools-rust";
|
|
version = "1.9.0";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-cE3wlI8uTMYMJZatboQOpnn09D5Y7UrQwYV4ByQOq5Y=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
setuptools
|
|
setuptools-scm
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
semantic-version
|
|
setuptools
|
|
typing-extensions
|
|
] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
|
|
|
pythonImportsCheck = [ "setuptools_rust" ];
|
|
|
|
doCheck = false;
|
|
|
|
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
|
|
'';
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Setuptools plugin for Rust support";
|
|
homepage = "https://github.com/PyO3/setuptools-rust";
|
|
changelog = "https://github.com/PyO3/setuptools-rust/releases/tag/v${version}";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
};
|
|
}
|