clan-vm-manager: devshell doesn't require clan-cli derivation
All checks were successful
checks / check-links (pull_request) Successful in 14s
checks / checks-impure (pull_request) Successful in 1m50s
checks / checks (pull_request) Successful in 4m8s

This commit is contained in:
Luis Hebendanz 2024-03-24 23:52:30 +01:00
parent 5fd4a63e17
commit 9dbc71e446
5 changed files with 21 additions and 14 deletions

View File

@ -1,7 +1,7 @@
# BUG: If this is enabled the devshell depends on clan_cli building successfully
# source_up
watch_file flake-module.nix default.nix
watch_file flake-module.nix shell.nix default.nix
# Because we depend on nixpkgs sources, uploading to builders takes a long time
use flake .#clan-cli --builders ''

View File

@ -24,6 +24,7 @@ mkShell {
shellHook = ''
export PATH=$(pwd)/bin:$PATH
# Needed for impure tests
ln -sfT ${clan-cli.nixpkgs} clan_cli/nixpkgs
'';
}

View File

@ -1,7 +1,7 @@
# See comment in clan-cli/.envrc
# source_up
watch_file flake-module.nix default.nix
watch_file flake-module.nix shell.nix default.nix
# Because we depend on nixpkgs sources, uploading to builders takes a long time
use flake .#clan-vm-manager --builders ''

View File

@ -45,16 +45,16 @@ let
runtimeDependencies = [ ];
# Dependencies required for running tests
testDependencies =
runtimeDependencies
++ allPythonDeps
++ [
pytest # Testing framework
pytest-cov # Generate coverage reports
pytest-subprocess # fake the real subprocess behavior to make your tests more independent.
pytest-xdist # Run tests in parallel on multiple cores
pytest-timeout # Add timeouts to your tests
];
externalTestDeps = [
pytest # Testing framework
pytest-cov # Generate coverage reports
pytest-subprocess # fake the real subprocess behavior to make your tests more independent.
pytest-xdist # Run tests in parallel on multiple cores
pytest-timeout # Add timeouts to your tests
];
# Dependencies required for running tests
testDependencies = runtimeDependencies ++ allPythonDeps ++ externalTestDeps;
# Setup Python environment with all dependencies for running tests
pythonWithTestDeps = python3.withPackages (_ps: testDependencies);
@ -114,8 +114,9 @@ python3.pkgs.buildPythonApplication rec {
# Additional pass-through attributes
passthru.desktop-file = desktop-file;
passthru.externalPythonDeps = externalPythonDeps;
passthru.testDependencies = testDependencies;
passthru.externalTestDeps = externalTestDeps;
passthru.runtimeDependencies = runtimeDependencies;
passthru.testDependencies = testDependencies;
# Don't leak python packages into a devshell.
# It can be very confusing if you `nix run` than load the cli from the devshell instead.

View File

@ -14,7 +14,9 @@
let
devshellTestDeps =
clan-vm-manager.testDependencies
clan-vm-manager.externalPythonDeps
++ clan-vm-manager.externalTestDeps
++ clan-vm-manager.runtimeDependencies
++ (with python3.pkgs; [
rope
mypy
@ -42,5 +44,8 @@ mkShell {
shellHook = ''
export PATH=$(pwd)/bin:$PATH
# Add clan-cli to the python path so that we can import it without building it in nix first
export PYTHONPATH=$(pwd)/../clan-cli:$PYTHONPATH
'';
}