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

provide a shell where we can run tests, not just linters

parent 890e67dd
No related branches found
No related tags found
1 merge request!278Port to Python 3
...@@ -2,13 +2,55 @@ ...@@ -2,13 +2,55 @@
# work on Nix 2.3. It works with Nix 2.5. I'm not sure about 2.4. # work on Nix 2.3. It works with Nix 2.5. I'm not sure about 2.4.
{ ... }@args: { ... }@args:
let let
tests = import ./tests.nix args; privatestorage = import ./. args;
inherit (tests) pkgs; inherit (privatestorage) pkgs mach-nix tahoe-lafs zkapauthorizer;
pythonVersion = zkapauthorizer.meta.mach-nix.python;
python = mach-nix.mkPython {
inherit (zkapauthorizer.meta.mach-nix) providers;
python = pythonVersion;
overridesPre = [
(
self: super: {
inherit tahoe-lafs;
}
)
];
requirements = let
py3 = pythonVersion > "python3";
lint = pkgs.lib.optionalString (builtins.trace py3 py3) ''
# lint
black
isort
flake8
'';
workarounds = ''
# Mitigate for undetected cryptography dependency
setuptools_rust
# And for tomli
flit_core
'';
testing = ''
coverage
fixtures
testtools
hypothesis
'';
in
''
${lint}
${workarounds}
${testing}
${zkapauthorizer.requirements}
'';
};
in in
pkgs.mkShell { pkgs.mkShell {
PYTHONDONTWRITEBYTECODE = "1";
buildInputs = [ buildInputs = [
tests.python python
tests.lint-python
pkgs.niv
]; ];
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment