core/pkgs/by-name/ma/maturin/pyo3-test/generic.nix

38 lines
887 B
Nix
Raw Normal View History

2024-05-02 00:46:19 +00:00
# Derivation prototype, used by maturin and setuptools-rust
# passthrough tests.
2024-05-13 21:24:10 +00:00
{ lib, fetchFromGitHub, python, rustPlatform
2024-05-02 00:46:19 +00:00
, nativeBuildInputs
2024-05-13 21:24:10 +00:00
, buildAndTestSubdir ? null, format ? "pyproject", preConfigure ? "" }:
2024-05-02 00:46:19 +00:00
python.pkgs.buildPythonPackage rec {
pname = "word-count";
version = "0.13.2";
src = fetchFromGitHub {
owner = "PyO3";
repo = "pyo3";
rev = "v${version}";
hash = "sha256-NOMrrfo8WjlPhtGxWUOPJS/UDDdbLQRCXR++Zd6JmIA=";
};
2024-05-13 21:24:10 +00:00
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
2024-05-02 00:46:19 +00:00
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
inherit buildAndTestSubdir format nativeBuildInputs preConfigure;
pythonImportsCheck = [ "word_count" ];
meta = with lib; {
description = "PyO3 word count example";
homepage = "https://github.com/PyO3/pyo3";
license = licenses.asl20;
maintainers = [ ];
};
}