Skip to content

Commit

Permalink
Merge pull request #33 from vlaci/nix-python-overlay
Browse files Browse the repository at this point in the history
nix: inject pyperscan in python3Packages
  • Loading branch information
vlaci authored Dec 15, 2023
2 parents 9711a96 + 611acfc commit ea38e07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
14 changes: 9 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@
rustPlatform = final.makeRustPlatform { inherit stdenv; inherit (final) rustc cargo; };
in
{
pyperscan = final.callPackage (import ./pyperscan.nix inputs) { inherit stdenv rustPlatform; };
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(python-final: python-prev: {
pyperscan = final.callPackage (import ./pyperscan.nix inputs) { inherit stdenv rustPlatform; python3 = python-final.python; };
})
];
vectorscan = prev.vectorscan.override { inherit stdenv; };
};
checks = forAllSystems (system:
let
inherit (nixpkgsFor.${system}) pyperscan rustPlatform;
inherit (nixpkgsFor.${system}) rustPlatform;
inherit (nixpkgsFor.${system}.python3Packages) pyperscan;
nativeBuildInputs = with rustPlatform; [
bindgenHook
];
Expand Down Expand Up @@ -79,8 +84,7 @@

packages = forAllSystems (system:
let

inherit (nixpkgsFor.${system}) pyperscan;
inherit (nixpkgsFor.${system}.python3Packages) pyperscan;
in
{
inherit pyperscan;
Expand All @@ -93,7 +97,7 @@
in
{
default = with pkgs; mkShell {
inputsFrom = [ pyperscan.libpyperscan ];
inputsFrom = [ python3Packages.pyperscan.libpyperscan ];
buildInputs = [
just
maturin
Expand Down
3 changes: 1 addition & 2 deletions pyperscan.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ inputs:
, vendorHyperscan ? false
, vendorVectorscan ? false
, coverage ? false
, pyperscan
}:

assert vendorHyperscan -> !vendorVectorscan;
Expand Down Expand Up @@ -117,7 +116,7 @@ let
vectorscan = drv.override { vendorVectorscan = true; };

tests = import ./tests.nix {
inherit lib stdenv system makeRustPlatform rustPlatform pyFilter testFilter cargo-llvm-cov python3 ruff pyperscan;
inherit lib stdenv system makeRustPlatform rustPlatform pyFilter testFilter cargo-llvm-cov python3 ruff;
inherit (inputs) fenix;
};
};
Expand Down
4 changes: 3 additions & 1 deletion tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
, testFilter
, cargo-llvm-cov
, python3
, pyperscan
, ruff
}:

let
inherit (python3.pkgs) pyperscan;
in
{
checks = with python3.pkgs; buildPythonPackage {
inherit (pyperscan) version;
Expand Down

0 comments on commit ea38e07

Please sign in to comment.