PropagatedBuild inputs workaround
This commit is contained in:
@@ -54,9 +54,11 @@
|
||||
module-docs =
|
||||
pkgs.runCommand "rendered"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
buildInputs = [
|
||||
pkgs.python3
|
||||
self'.packages.clan-cli
|
||||
# TODO: see postFixup clan-cli/default.nix:L188
|
||||
self'.packages.clan-cli.propagatedBuildInputs
|
||||
];
|
||||
}
|
||||
''
|
||||
|
||||
@@ -94,7 +94,14 @@ python3.pkgs.buildPythonApplication rec {
|
||||
# that all necessary dependencies are consistently available both
|
||||
# at build time and runtime,
|
||||
buildInputs = allPythonDeps ++ runtimeDependencies;
|
||||
propagatedBuildInputs = allPythonDeps ++ runtimeDependencies;
|
||||
propagatedBuildInputs =
|
||||
allPythonDeps
|
||||
++ runtimeDependencies
|
||||
++ [
|
||||
|
||||
# TODO: see postFixup clan-cli/default.nix:L188
|
||||
clan-cli.propagatedBuildInputs
|
||||
];
|
||||
|
||||
# also re-expose dependencies so we test them in CI
|
||||
passthru = {
|
||||
|
||||
@@ -153,7 +153,7 @@ class ServiceSingleDisk:
|
||||
class Service:
|
||||
borgbackup: dict[str, ServiceBorgbackup] = field(default_factory = dict)
|
||||
packages: dict[str, ServicePackage] = field(default_factory = dict)
|
||||
single_disk: dict[str, ServiceSingleDisk] = field(default_factory = dict, metadata = {"original_name": "single-disk"})
|
||||
single_disk: dict[str, ServiceSingleDisk] = field(default_factory = dict, metadata = {"alias": "single-disk"})
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
let
|
||||
pythonDependencies = [
|
||||
argcomplete # Enables shell completions
|
||||
pydantic
|
||||
pydantic # Dataclass deserialisation / validation / schemas
|
||||
];
|
||||
|
||||
# load nixpkgs runtime dependencies from a json file
|
||||
@@ -183,6 +183,7 @@ python3.pkgs.buildPythonApplication {
|
||||
'';
|
||||
|
||||
# Clean up after the package to avoid leaking python packages into a devshell
|
||||
# TODO: factor seperate cli / API packages
|
||||
postFixup = ''
|
||||
rm $out/nix-support/propagated-build-inputs
|
||||
'';
|
||||
|
||||
@@ -62,7 +62,12 @@
|
||||
name = "clan-cli-docs";
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [ pkgs.python3 ];
|
||||
buildInputs = [
|
||||
|
||||
# TODO: see postFixup clan-cli/default.nix:L188
|
||||
pkgs.python3
|
||||
self'.packages.clan-cli.propagatedBuildInputs
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
${self'.packages.classgen}/bin/classgen ${self'.packages.inventory-schema}/schema.json ./clan_cli/inventory/classes.py
|
||||
@@ -77,7 +82,12 @@
|
||||
name = "clan-ts-api";
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [ pkgs.python3 ];
|
||||
buildInputs = [
|
||||
pkgs.python3
|
||||
|
||||
# TODO: see postFixup clan-cli/default.nix:L188
|
||||
self'.packages.clan-cli.propagatedBuildInputs
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
${self'.packages.classgen}/bin/classgen ${self'.packages.inventory-schema}/schema.json ./clan_cli/inventory/classes.py
|
||||
|
||||
@@ -93,7 +93,14 @@ python3.pkgs.buildPythonApplication rec {
|
||||
# that all necessary dependencies are consistently available both
|
||||
# at build time and runtime,
|
||||
buildInputs = allPythonDeps ++ runtimeDependencies;
|
||||
propagatedBuildInputs = allPythonDeps ++ runtimeDependencies;
|
||||
propagatedBuildInputs =
|
||||
allPythonDeps
|
||||
++ runtimeDependencies
|
||||
++ [
|
||||
|
||||
# TODO: see postFixup clan-cli/default.nix:L188
|
||||
clan-cli.propagatedBuildInputs
|
||||
];
|
||||
|
||||
# also re-expose dependencies so we test them in CI
|
||||
passthru = {
|
||||
|
||||
@@ -245,7 +245,7 @@ def generate_dataclass(schema: dict[str, Any], class_name: str = root_class) ->
|
||||
|
||||
field_meta = None
|
||||
if field_name != prop:
|
||||
field_meta = f"""{{"original_name": "{prop}"}}"""
|
||||
field_meta = f"""{{"alias": "{prop}"}}"""
|
||||
|
||||
finalize_field = partial(get_field_def, field_name, field_meta)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user