apply treefmt
parent
cc78160e6e
commit
16ab6ae069
@ -1,22 +1,23 @@
|
|||||||
{
|
{ writeShellScript
|
||||||
writeShellScript,
|
, python3
|
||||||
python3,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, coreutils
|
||||||
coreutils,
|
,
|
||||||
}: let
|
}:
|
||||||
systemd-vaultd = pkgs.callPackage ../../default.nix {};
|
let
|
||||||
systemd = pkgs.callPackage ../pkgs/systemd.nix {};
|
systemd-vaultd = pkgs.callPackage ../../default.nix { };
|
||||||
|
systemd = pkgs.callPackage ../pkgs/systemd.nix { };
|
||||||
in
|
in
|
||||||
writeShellScript "unittests" ''
|
writeShellScript "unittests" ''
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
export PATH=${lib.makeBinPath [python3.pkgs.pytest coreutils systemd]}
|
export PATH=${lib.makeBinPath [python3.pkgs.pytest coreutils systemd]}
|
||||||
export SYSTEMD_VAULTD_BIN=${systemd-vaultd}/bin/systemd-vaultd
|
export SYSTEMD_VAULTD_BIN=${systemd-vaultd}/bin/systemd-vaultd
|
||||||
export TMPDIR=$(mktemp -d)
|
export TMPDIR=$(mktemp -d)
|
||||||
trap 'rm -rf $TMPDIR' EXIT
|
trap 'rm -rf $TMPDIR' EXIT
|
||||||
cp --no-preserve=mode --preserve=timestamps -r ${../..} "$TMPDIR/source"
|
cp --no-preserve=mode --preserve=timestamps -r ${../..} "$TMPDIR/source"
|
||||||
cd "$TMPDIR/source"
|
cd "$TMPDIR/source"
|
||||||
pytest -s ./tests
|
pytest -s ./tests
|
||||||
# we need this in our nixos tests
|
# we need this in our nixos tests
|
||||||
touch /tmp/success
|
touch /tmp/success
|
||||||
''
|
''
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
[tool.ruff]
|
||||||
|
line-length = 88
|
||||||
|
|
||||||
|
select = ["E", "F", "I"]
|
||||||
|
ignore = [ "E501" ]
|
||||||
|
|
||||||
|
[tool.mypy]
|
||||||
|
python_version = "3.10"
|
||||||
|
warn_redundant_casts = true
|
||||||
|
disallow_untyped_calls = true
|
||||||
|
disallow_untyped_defs = true
|
||||||
|
no_implicit_optional = true
|
||||||
|
|
||||||
|
[[tool.mypy.overrides]]
|
||||||
|
module = "setuptools.*"
|
||||||
|
ignore_missing_imports = true
|
||||||
|
|
||||||
|
[[tool.mypy.overrides]]
|
||||||
|
module = "pytest.*"
|
||||||
|
ignore_missing_imports = true
|
@ -1,15 +1,15 @@
|
|||||||
{pkgs ? import <nixpkgs> {}}:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
mkShellNoCC {
|
mkShellNoCC {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
python3.pkgs.pytest
|
python3.pkgs.pytest
|
||||||
python3.pkgs.mypy
|
python3.pkgs.mypy
|
||||||
|
|
||||||
golangci-lint
|
golangci-lint
|
||||||
vault
|
vault
|
||||||
systemd
|
systemd
|
||||||
hivemind
|
hivemind
|
||||||
go
|
go
|
||||||
just
|
just
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue