forked from clan/clan-core
Merge pull request 'Removed python deal.' (#664) from Qubasa-main into main
This commit is contained in:
commit
c05d6f8e35
17
flake.lock
17
flake.lock
@ -92,29 +92,12 @@
|
||||
"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": {
|
||||
"inputs": {
|
||||
"disko": "disko",
|
||||
"flake-parts": "flake-parts",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-for-deal": "nixpkgs-for-deal",
|
||||
"sops-nix": "sops-nix",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
}
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
inputs = {
|
||||
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.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 typing import Any
|
||||
|
||||
from .deal import deal
|
||||
from .dirs import nixpkgs_flake, nixpkgs_source
|
||||
from .errors import ClanError
|
||||
|
||||
|
||||
def nix_command(flags: list[str]) -> list[str]:
|
||||
@ -85,7 +83,6 @@ def nix_metadata(flake_url: str | Path) -> dict[str, Any]:
|
||||
return data
|
||||
|
||||
|
||||
@deal.raises(ClanError)
|
||||
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
||||
# we cannot use nix-shell inside the nix sandbox
|
||||
# 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
|
||||
# if get_qemu_version() > [8, 1, 3]:
|
||||
common = ["-audio", "driver=pa,model=virtio"]
|
||||
# common = ["-audio", "driver=pa,model=virtio"]
|
||||
|
||||
if vm.wayland:
|
||||
# fmt: off
|
||||
|
@ -29,7 +29,6 @@
|
||||
, gnupg
|
||||
, e2fsprogs
|
||||
, mypy
|
||||
, deal
|
||||
, rope
|
||||
, clan-core-path
|
||||
, writeShellScriptBin
|
||||
@ -48,7 +47,6 @@ let
|
||||
pytest-subprocess
|
||||
pytest-xdist
|
||||
pytest-timeout
|
||||
deal
|
||||
remote-pdb
|
||||
ipdb
|
||||
openssh
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ inputs, self, lib, ... }:
|
||||
{
|
||||
perSystem = { self', pkgs, system, ... }:
|
||||
perSystem = { self', pkgs, ... }:
|
||||
let
|
||||
flakeLock = lib.importJSON (self + /flake.lock);
|
||||
flakeInputs = (builtins.removeAttrs inputs [ "self" ]);
|
||||
@ -35,9 +35,6 @@
|
||||
packages = {
|
||||
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {
|
||||
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;
|
||||
};
|
||||
default = self'.packages.clan-cli;
|
||||
|
@ -24,7 +24,6 @@ norecursedirs = "tests/helpers"
|
||||
markers = ["impure", "with_core"]
|
||||
|
||||
[tool.mypy]
|
||||
plugins = ["deal.mypy"]
|
||||
python_version = "3.11"
|
||||
warn_redundant_casts = 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