Move the Python package into a variable

This commit is contained in:
Andreas Zweili 2024-04-22 10:23:36 +02:00
parent a82a8d00c7
commit 12414da5a8
1 changed files with 7 additions and 6 deletions

View File

@ -22,11 +22,7 @@
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }; poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { inherit pkgs; };
application = poetry2nix.mkPoetryApplication { python = pkgs.python312;
projectDir = ./.;
python = pkgs.python312;
inherit overrides;
};
overrides = poetry2nix.defaultPoetryOverrides.extend ( overrides = poetry2nix.defaultPoetryOverrides.extend (
self: super: { self: super: {
cryptography = super.cryptography.overridePythonAttrs (old: rec { cryptography = super.cryptography.overridePythonAttrs (old: rec {
@ -40,14 +36,19 @@
}); });
} }
); );
application = poetry2nix.mkPoetryApplication {
projectDir = ./.;
inherit overrides;
inherit python;
};
env = poetry2nix.mkPoetryEnv { env = poetry2nix.mkPoetryEnv {
projectDir = ./.; projectDir = ./.;
python = pkgs.python312;
groups = [ "dev" ]; groups = [ "dev" ];
editablePackageSources = { editablePackageSources = {
snapbin = ./snapbin; snapbin = ./snapbin;
}; };
inherit overrides; inherit overrides;
inherit python;
}; };
tests = pkgs.writeShellScriptBin "python-test" '' tests = pkgs.writeShellScriptBin "python-test" ''
trap "process-compose down &> /dev/null" EXIT trap "process-compose down &> /dev/null" EXIT