maturin: format with nixfmt

This commit is contained in:
seth
2024-07-11 23:57:14 -04:00
parent 7dd53c5e66
commit 929a0f4bd1
3 changed files with 34 additions and 25 deletions
+17 -10
View File
@@ -1,10 +1,11 @@
{ callPackage
, lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
, libiconv
{
callPackage,
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
darwin,
libiconv,
}:
rustPlatform.buildRustPackage rec {
@@ -20,12 +21,15 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-EuMPcJAGz564cC9UWrlihBxRUJCtqw4jvP/SQgx2L/0=";
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security libiconv ];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
libiconv
];
# Requires network access, fails in sandbox.
doCheck = false;
passthru.tests.pyo3 = callPackage ./pyo3-test {};
passthru.tests.pyo3 = callPackage ./pyo3-test { };
meta = with lib; {
description = "Build and publish Rust crates Python packages";
@@ -40,7 +44,10 @@ rustPlatform.buildRustPackage rec {
'';
homepage = "https://github.com/PyO3/maturin";
changelog = "https://github.com/PyO3/maturin/blob/v${version}/Changelog.md";
license = with licenses; [ asl20 /* or */ mit ];
license = with licenses; [
asl20 # or
mit
];
maintainers = [ ];
};
}
@@ -1,6 +1,4 @@
{ python3
, rustPlatform
}:
{ python3, rustPlatform }:
python3.pkgs.callPackage ./generic.nix {
buildAndTestSubdir = "examples/word-count";
+16 -12
View File
@@ -1,16 +1,17 @@
# Derivation prototype, used by maturin and setuptools-rust
# passthrough tests.
{ lib
, fetchFromGitHub
, python
, rustPlatform
{
lib,
fetchFromGitHub,
python,
rustPlatform,
, nativeBuildInputs
nativeBuildInputs,
, buildAndTestSubdir ? null
, format ? "pyproject"
, preConfigure ? ""
buildAndTestSubdir ? null,
format ? "pyproject",
preConfigure ? "",
}:
python.pkgs.buildPythonPackage rec {
@@ -24,15 +25,18 @@ python.pkgs.buildPythonPackage rec {
hash = "sha256-NOMrrfo8WjlPhtGxWUOPJS/UDDdbLQRCXR++Zd6JmIA=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
inherit buildAndTestSubdir format nativeBuildInputs preConfigure;
inherit
buildAndTestSubdir
format
nativeBuildInputs
preConfigure
;
pythonImportsCheck = [ "word_count" ];