Skip to content
Snippets Groups Projects
Commit ce06c30f authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

[wip]

parent 9641b255
No related branches found
No related tags found
1 merge request!277Refactor the Nix packaging for reduced duplication and to provide a more useful shell environment
......@@ -37,6 +37,8 @@ in
};
in
rec {
inherit pkgs mach-nix;
tahoe-lafs = mach-nix.buildPythonPackage rec {
inherit python providers;
name = "tahoe-lafs";
......
# Note: Passing arguments through here to customize the environment does not
# work on Nix 2.3. It works with Nix 2.5. I'm not sure about 2.4.
{ ... }@args:
let
sources = import nix/sources.nix;
tests = import ./tests.nix args;
inherit (tests) pkgs;
in
{ pkgs ? import sources.release2105 {}
, tahoe-lafs-source ? "tahoe-lafs"
}:
let
tests = pkgs.callPackage ./tests.nix {
inherit tahoe-lafs-source;
};
in
pkgs.mkShell {
packages = [
tests.python
pkgs.niv
];
}
pkgs.mkShell {
buildInputs = [
tests.python
tests.lint-python
pkgs.niv
];
}
let
sources = import nix/sources.nix;
in
{ pkgs ? import sources.release2105 {}
, pypiData ? sources.pypi-deps-db
, mach-nix ? import sources.mach-nix { inherit pkgs pypiData; }
, tahoe-lafs-source ? "tahoe-lafs"
, tahoe-lafs-repo ? sources.${tahoe-lafs-source}
, privatestorage ? import ./. {
inherit pkgs pypiData mach-nix;
inherit tahoe-lafs-repo;
}
{ privatestorage ? import ./. args
, hypothesisProfile ? null
, collectCoverage ? false
, testSuite ? null
, trialArgs ? null
,
}:
let
, ...
}@args:
let
inherit (privatestorage) pkgs mach-nix zkapauthorizer;
inherit (pkgs) lib;
inherit (privatestorage) zkapauthorizer;
hypothesisProfile' = if hypothesisProfile == null then "default" else hypothesisProfile;
defaultTrialArgs = [ "--rterrors" ] ++ (lib.optional (! collectCoverage) "--jobs=$(($NIX_BUILD_CORES > 8 ? 8 : $NIX_BUILD_CORES))");
trialArgs' = if trialArgs == null then defaultTrialArgs else trialArgs;
......@@ -38,10 +27,11 @@ in
requirements = ''
isort
black
flake8
'';
};
in
pkgs.runCommand "zkapauthorizer-tests" {
tests = pkgs.runCommand "zkapauthorizer-tests" {
passthru = {
inherit python;
};
......@@ -65,4 +55,8 @@ in
cp -v .coverage.* "$out/coverage"
''
}
''
'';
in
{
inherit pkgs python lint-python tests;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment