clan-vm-manager: devshell doesn't require clan-cli derivation
This commit is contained in:
parent
5fd4a63e17
commit
9dbc71e446
@ -1,7 +1,7 @@
|
|||||||
# BUG: If this is enabled the devshell depends on clan_cli building successfully
|
# BUG: If this is enabled the devshell depends on clan_cli building successfully
|
||||||
# source_up
|
# 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
|
# Because we depend on nixpkgs sources, uploading to builders takes a long time
|
||||||
use flake .#clan-cli --builders ''
|
use flake .#clan-cli --builders ''
|
||||||
|
@ -24,6 +24,7 @@ mkShell {
|
|||||||
shellHook = ''
|
shellHook = ''
|
||||||
export PATH=$(pwd)/bin:$PATH
|
export PATH=$(pwd)/bin:$PATH
|
||||||
|
|
||||||
|
# Needed for impure tests
|
||||||
ln -sfT ${clan-cli.nixpkgs} clan_cli/nixpkgs
|
ln -sfT ${clan-cli.nixpkgs} clan_cli/nixpkgs
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# See comment in clan-cli/.envrc
|
# See comment in clan-cli/.envrc
|
||||||
# source_up
|
# 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
|
# Because we depend on nixpkgs sources, uploading to builders takes a long time
|
||||||
use flake .#clan-vm-manager --builders ''
|
use flake .#clan-vm-manager --builders ''
|
||||||
|
@ -45,10 +45,7 @@ let
|
|||||||
runtimeDependencies = [ ];
|
runtimeDependencies = [ ];
|
||||||
|
|
||||||
# Dependencies required for running tests
|
# Dependencies required for running tests
|
||||||
testDependencies =
|
externalTestDeps = [
|
||||||
runtimeDependencies
|
|
||||||
++ allPythonDeps
|
|
||||||
++ [
|
|
||||||
pytest # Testing framework
|
pytest # Testing framework
|
||||||
pytest-cov # Generate coverage reports
|
pytest-cov # Generate coverage reports
|
||||||
pytest-subprocess # fake the real subprocess behavior to make your tests more independent.
|
pytest-subprocess # fake the real subprocess behavior to make your tests more independent.
|
||||||
@ -56,6 +53,9 @@ let
|
|||||||
pytest-timeout # Add timeouts to your tests
|
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
|
# Setup Python environment with all dependencies for running tests
|
||||||
pythonWithTestDeps = python3.withPackages (_ps: testDependencies);
|
pythonWithTestDeps = python3.withPackages (_ps: testDependencies);
|
||||||
in
|
in
|
||||||
@ -114,8 +114,9 @@ python3.pkgs.buildPythonApplication rec {
|
|||||||
# Additional pass-through attributes
|
# Additional pass-through attributes
|
||||||
passthru.desktop-file = desktop-file;
|
passthru.desktop-file = desktop-file;
|
||||||
passthru.externalPythonDeps = externalPythonDeps;
|
passthru.externalPythonDeps = externalPythonDeps;
|
||||||
passthru.testDependencies = testDependencies;
|
passthru.externalTestDeps = externalTestDeps;
|
||||||
passthru.runtimeDependencies = runtimeDependencies;
|
passthru.runtimeDependencies = runtimeDependencies;
|
||||||
|
passthru.testDependencies = testDependencies;
|
||||||
|
|
||||||
# Don't leak python packages into a devshell.
|
# 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.
|
# It can be very confusing if you `nix run` than load the cli from the devshell instead.
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
devshellTestDeps =
|
devshellTestDeps =
|
||||||
clan-vm-manager.testDependencies
|
clan-vm-manager.externalPythonDeps
|
||||||
|
++ clan-vm-manager.externalTestDeps
|
||||||
|
++ clan-vm-manager.runtimeDependencies
|
||||||
++ (with python3.pkgs; [
|
++ (with python3.pkgs; [
|
||||||
rope
|
rope
|
||||||
mypy
|
mypy
|
||||||
@ -42,5 +44,8 @@ mkShell {
|
|||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export PATH=$(pwd)/bin:$PATH
|
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
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user