chore: Suggestions from review
- Filter out non-source files from llama-scripts flake derivation - Clean up unused closure - Remove scripts devShell
This commit is contained in:
parent
4a71d86d85
commit
03b2afea24
3 changed files with 32 additions and 14 deletions
|
@ -2,8 +2,13 @@
|
|||
perSystem =
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
devShells = lib.concatMapAttrs (name: package: {
|
||||
${name} = package.passthru.shell;
|
||||
}) config.packages;
|
||||
devShells = lib.pipe (config.packages) [
|
||||
(lib.concatMapAttrs
|
||||
(name: package: {
|
||||
${name} = package.passthru.shell or null;
|
||||
}))
|
||||
(lib.filterAttrs (name: value: value != null))
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,6 @@ let
|
|||
) ", accelerated with ${strings.concatStringsSep ", " suffices}";
|
||||
|
||||
executableSuffix = effectiveStdenv.hostPlatform.extensions.executable;
|
||||
mapToPythonPackages = ps: packages: map (package: ps.${package}) packages;
|
||||
|
||||
xcrunHost = runCommand "xcrunHost" { } ''
|
||||
mkdir -p $out/bin
|
||||
|
@ -121,14 +120,13 @@ effectiveStdenv.mkDerivation (finalAttrs: {
|
|||
filter =
|
||||
name: type:
|
||||
let
|
||||
noneOf = builtins.all (x: !x);
|
||||
baseName = baseNameOf name;
|
||||
any = builtins.any (x: x);
|
||||
baseName = builtins.baseNameOf name;
|
||||
in
|
||||
noneOf [
|
||||
(lib.hasSuffix ".nix" name) # Ignore *.nix files when computing outPaths
|
||||
(lib.hasSuffix ".md" name) # Ignore *.md changes whe computing outPaths
|
||||
(lib.hasPrefix "." baseName) # Skip hidden files and directories
|
||||
(baseName == "flake.lock")
|
||||
any [
|
||||
(lib.hasSuffix ".py" name)
|
||||
(baseName == "README.md")
|
||||
(baseName == "pyproject.toml")
|
||||
];
|
||||
src = lib.cleanSource ../../.;
|
||||
};
|
||||
|
|
|
@ -23,12 +23,27 @@ in
|
|||
|
||||
buildPythonPackage ({
|
||||
pname = "llama-scripts";
|
||||
src = ../../.;
|
||||
version = "0.0.0";
|
||||
pyproject = true;
|
||||
|
||||
# NOTE: The files filtered out here are not visible in the build sandbox, neither
|
||||
# do they affect the output hash. They can be modified without triggering a rebuild.
|
||||
src = lib.cleanSourceWith {
|
||||
filter =
|
||||
name: type:
|
||||
let
|
||||
any = builtins.any (x: x);
|
||||
baseName = builtins.baseNameOf name;
|
||||
in
|
||||
any [
|
||||
(lib.hasSuffix ".py" name)
|
||||
(baseName == "README.md")
|
||||
(baseName == "pyproject.toml")
|
||||
];
|
||||
src = lib.cleanSource ../../.;
|
||||
};
|
||||
nativeBuildInputs = [ poetry-core ];
|
||||
projectDir = ../../.;
|
||||
propagatedBuildInputs = llama-python-deps;
|
||||
dependencies = llama-python-deps;
|
||||
|
||||
passthru = {
|
||||
shell = mkShell {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue