forked from clan/clan-core
Removed python deal.
This commit is contained in:
parent
b6b0ca7aa0
commit
330ef00a7c
17
flake.lock
17
flake.lock
@ -92,29 +92,12 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-for-deal": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1700490099,
|
|
||||||
"narHash": "sha256-IDZGtMvddtEdYr7BUtXsQNPhVXcLzWj6AC9s1wRkZlo=",
|
|
||||||
"owner": "Luis-Hebendanz",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "32ea44ece77a5bad662685acf4652cc984e2df3f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Luis-Hebendanz",
|
|
||||||
"ref": "fix_python_deal",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-for-deal": "nixpkgs-for-deal",
|
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
||||||
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/265872
|
|
||||||
nixpkgs-for-deal.url = "github:Luis-Hebendanz/nixpkgs/fix_python_deal";
|
|
||||||
|
|
||||||
disko.url = "github:nix-community/disko";
|
disko.url = "github:nix-community/disko";
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
from collections.abc import Callable
|
|
||||||
from types import ModuleType
|
|
||||||
from typing import Any, Protocol
|
|
||||||
|
|
||||||
|
|
||||||
class AnyCall(Protocol):
|
|
||||||
def __call__(self, *args: Any, **kwargs: Any) -> Any:
|
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
class FakeDeal:
|
|
||||||
def __getattr__(self, name: str) -> AnyCall:
|
|
||||||
return self.mock_call
|
|
||||||
|
|
||||||
def mock_call(self, *args: Any, **kwargs: Any) -> Callable[[AnyCall], AnyCall]:
|
|
||||||
def wrapper(func: AnyCall) -> AnyCall:
|
|
||||||
return func
|
|
||||||
|
|
||||||
return wrapper
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
import deal as real_deal
|
|
||||||
|
|
||||||
deal: ModuleType | FakeDeal = real_deal
|
|
||||||
except ImportError:
|
|
||||||
deal = FakeDeal()
|
|
@ -5,9 +5,7 @@ import tempfile
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from .deal import deal
|
|
||||||
from .dirs import nixpkgs_flake, nixpkgs_source
|
from .dirs import nixpkgs_flake, nixpkgs_source
|
||||||
from .errors import ClanError
|
|
||||||
|
|
||||||
|
|
||||||
def nix_command(flags: list[str]) -> list[str]:
|
def nix_command(flags: list[str]) -> list[str]:
|
||||||
@ -85,7 +83,6 @@ def nix_metadata(flake_url: str | Path) -> dict[str, Any]:
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
@deal.raises(ClanError)
|
|
||||||
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
||||||
# we cannot use nix-shell inside the nix sandbox
|
# we cannot use nix-shell inside the nix sandbox
|
||||||
# in our tests we just make sure we have all the packages
|
# in our tests we just make sure we have all the packages
|
||||||
|
@ -39,7 +39,7 @@ def graphics_options(vm: VmConfig) -> list[str]:
|
|||||||
|
|
||||||
# Check if the version is greater than 8.1.3 to enable virtio audio
|
# Check if the version is greater than 8.1.3 to enable virtio audio
|
||||||
# if get_qemu_version() > [8, 1, 3]:
|
# if get_qemu_version() > [8, 1, 3]:
|
||||||
common = ["-audio", "driver=pa,model=virtio"]
|
# common = ["-audio", "driver=pa,model=virtio"]
|
||||||
|
|
||||||
if vm.wayland:
|
if vm.wayland:
|
||||||
# fmt: off
|
# fmt: off
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
, gnupg
|
, gnupg
|
||||||
, e2fsprogs
|
, e2fsprogs
|
||||||
, mypy
|
, mypy
|
||||||
, deal
|
|
||||||
, rope
|
, rope
|
||||||
, clan-core-path
|
, clan-core-path
|
||||||
, writeShellScriptBin
|
, writeShellScriptBin
|
||||||
@ -48,7 +47,6 @@ let
|
|||||||
pytest-subprocess
|
pytest-subprocess
|
||||||
pytest-xdist
|
pytest-xdist
|
||||||
pytest-timeout
|
pytest-timeout
|
||||||
deal
|
|
||||||
remote-pdb
|
remote-pdb
|
||||||
ipdb
|
ipdb
|
||||||
openssh
|
openssh
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ inputs, self, lib, ... }:
|
{ inputs, self, lib, ... }:
|
||||||
{
|
{
|
||||||
perSystem = { self', pkgs, system, ... }:
|
perSystem = { self', pkgs, ... }:
|
||||||
let
|
let
|
||||||
flakeLock = lib.importJSON (self + /flake.lock);
|
flakeLock = lib.importJSON (self + /flake.lock);
|
||||||
flakeInputs = (builtins.removeAttrs inputs [ "self" ]);
|
flakeInputs = (builtins.removeAttrs inputs [ "self" ]);
|
||||||
@ -35,9 +35,6 @@
|
|||||||
packages = {
|
packages = {
|
||||||
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {
|
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {
|
||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
# inherit (inputs) democlan;
|
|
||||||
inherit (inputs.nixpkgs-for-deal.legacyPackages.${system}.python3Packages) deal;
|
|
||||||
#inherit (inputs.nixpkgs-for-deal.legacyPackages.${system}.python3Packages) schemathesis;
|
|
||||||
clan-core-path = clanCoreWithVendoredDeps;
|
clan-core-path = clanCoreWithVendoredDeps;
|
||||||
};
|
};
|
||||||
default = self'.packages.clan-cli;
|
default = self'.packages.clan-cli;
|
||||||
|
@ -24,7 +24,6 @@ norecursedirs = "tests/helpers"
|
|||||||
markers = ["impure", "with_core"]
|
markers = ["impure", "with_core"]
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
plugins = ["deal.mypy"]
|
|
||||||
python_version = "3.11"
|
python_version = "3.11"
|
||||||
warn_redundant_casts = true
|
warn_redundant_casts = true
|
||||||
disallow_untyped_calls = true
|
disallow_untyped_calls = true
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
import deal
|
|
||||||
|
|
||||||
from clan_cli import nix
|
|
||||||
|
|
||||||
|
|
||||||
@deal.cases(nix.nix_shell)
|
|
||||||
def test_nix_shell(case: deal.TestCase) -> None:
|
|
||||||
case()
|
|
Loading…
Reference in New Issue
Block a user