1
0
forked from clan/clan-core

schemathesis: Add as runnable application instead of library to resolve httpx dependency collision issue

This commit is contained in:
Luis Hebendanz 2023-11-20 17:14:12 +01:00
parent 9af58c7bac
commit 48f0381fb5
5 changed files with 13 additions and 15 deletions

View File

@ -29,7 +29,7 @@
]}"
ROOT=$(git rev-parse --show-toplevel)
cd "$ROOT/pkgs/clan-cli"
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp python -m clan_cli webui --no-open --port 2979'
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp clan webui --no-open --port 5757'
'';
@ -42,7 +42,7 @@
echo "Started mock api with pid $MOCK_API_PID"
function cleanup {
echo "Stopping server..."
pkill -9 -f "python -m clan_cli webui"
pkill -9 -f "python -m clan webui --no-open --port 5757"
}
trap cleanup EXIT
@ -59,7 +59,7 @@
ROOT=$(git rev-parse --show-toplevel)
cd "$ROOT/pkgs/clan-cli"
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp st auth login RHtr8nLtz77tqRP8yUGyf-Flv_9SLI'
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp st run http://localhost:2979/openapi.json --experimental=openapi-3.1 --report --workers 8 --max-response-time=50 --request-timeout=1000 -M GET'
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp st run http://localhost:5757/openapi.json --experimental=openapi-3.1 --report --workers 8 --max-response-time=50 --request-timeout=1000 -M GET'
'';
};
};

View File

@ -98,11 +98,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1700044047,
"narHash": "sha256-L7sCQsyETMknCztejhFCb7QXoa7k92Pv/e8X7OudAuk=",
"lastModified": 1700463343,
"narHash": "sha256-6HpM0MP3V6jYsnAklIkjw6Wa+L0Zgokq+OBduVBR3n4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "68baab123fc4f898ebb6191eca8ae9383604f5f5",
"rev": "3fb937a1e9f4157f57011965b99fcb7f4139d9ad",
"type": "github"
},
"original": {
@ -114,11 +114,11 @@
},
"nixpkgs-for-deal": {
"locked": {
"lastModified": 1699470058,
"narHash": "sha256-//c1SEENoNFEDtp8x5lokNxsU9lZjyNkEf5k3OJADTs=",
"lastModified": 1700490099,
"narHash": "sha256-IDZGtMvddtEdYr7BUtXsQNPhVXcLzWj6AC9s1wRkZlo=",
"owner": "Luis-Hebendanz",
"repo": "nixpkgs",
"rev": "842a157b727ad9712d41a80d1e1564e4e6bbe697",
"rev": "32ea44ece77a5bad662685acf4652cc984e2df3f",
"type": "github"
},
"original": {

View File

@ -37,6 +37,7 @@
, deal
, rope
, clan-core-path
, schemathesis
}:
let
@ -47,14 +48,13 @@ let
];
pytestDependencies = runtimeDependencies ++ dependencies ++ [
#schemathesis # optional for http fuzzing
pytest
pytest-cov
pytest-subprocess
pytest-xdist
pytest-timeout
deal
# commented out because it injects an incompatible httpx version into our python env
#schemathesis
remote-pdb
ipdb
openssh

View File

@ -31,12 +31,14 @@
{
devShells.clan-cli = pkgs.callPackage ./shell.nix {
inherit (self'.packages) clan-cli ui-assets nix-unit;
};
packages = {
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {
inherit (self'.packages) ui-assets;
inherit (inputs) nixpkgs;
inherit (inputs.nixpkgs-for-deal.legacyPackages.${system}.python3Packages) deal;
inherit (inputs.nixpkgs-for-deal.legacyPackages.${system}.python3Packages) schemathesis;
clan-core-path = clanCoreWithVendoredDeps;
};
inherit (self'.packages.clan-cli) clan-openapi;

View File

@ -54,9 +54,5 @@ mkShell {
$tmp_path/share/zsh/site-functions
register-python-argcomplete --shell fish clan > $tmp_path/share/fish/vendor_completions.d/clan.fish
register-python-argcomplete --shell bash clan > $tmp_path/share/bash-completion/completions/clan
./bin/clan flakes create example_clan
./bin/clan machines create examplemachine example_clan
'';
}