diff --git a/examples/_d2n-extended-new-subsystem/discoverers.nix b/examples/_d2n-extended-new-subsystem/discoverers.nix index 35249634..f580512d 100644 --- a/examples/_d2n-extended-new-subsystem/discoverers.nix +++ b/examples/_d2n-extended-new-subsystem/discoverers.nix @@ -1,9 +1,9 @@ -{dlib, ...}: { +{config, ...}: { discoverers.dummy = rec { name = "dummy"; subsystem = "hello"; discover = {tree}: [ - (dlib.construct.discoveredProject { + (config.dlib.construct.discoveredProject { inherit subsystem name; inherit (tree) relPath; translators = ["dummy"]; diff --git a/examples/_d2n-extended/flake.nix b/examples/_d2n-extended/flake.nix index 73814f08..a32a625a 100644 --- a/examples/_d2n-extended/flake.nix +++ b/examples/_d2n-extended/flake.nix @@ -42,8 +42,8 @@ } '') (builtins.toFile "crates-io-new.nix" '' - {lib, ...}: { - fetchers.crates-io = lib.mkForce { + {config, ...}: { + fetchers.crates-io = config.lib.mkForce { imports = ["${inp.dream2nix}/src/fetchers/crates-io"]; }; } diff --git a/src/default.nix b/src/default.nix index 83599c65..a3c0e4e9 100644 --- a/src/default.nix +++ b/src/default.nix @@ -71,7 +71,6 @@ in let inherit dlib; inherit externals; inherit externalSources; - inherit fetchers; inherit framework; inherit indexers; inherit dream2nixWithExternals; @@ -97,9 +96,6 @@ in let # apps for CLI and installation apps = callPackageDream ./apps {}; - # fetcher implementations - fetchers = callPackageDream ./fetchers {}; - # indexer implementations indexers = callPackageDream ./indexers {}; diff --git a/tests/unit/test_pure_translators.py b/tests/unit/test_pure_translators.py index cdd5c202..e1be637d 100644 --- a/tests/unit/test_pure_translators.py +++ b/tests/unit/test_pure_translators.py @@ -5,7 +5,7 @@ import pytest def get_projects_to_test(): tests = nix_ffi.eval( - 'subsystems.allTranslators', + 'framework.translators', wrapper_code = ''' {result, ...}: let lib = (import {}).lib; @@ -23,7 +23,7 @@ def get_projects_to_test(): }) (translator.generateUnitTestsForProjects or []) ) - result + (l.attrValues result) ) ''', ) @@ -65,7 +65,7 @@ def check_format_sourceSpec(sourceSpec): @pytest.mark.parametrize("p", projects) def test_packageName(p): defaultPackage = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -81,7 +81,7 @@ def test_packageName(p): @pytest.mark.parametrize("p", projects) def test_exportedPackages(p): exportedPackages = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateınstanced", params=dict( project=p['project'], source=p['source'], @@ -97,7 +97,7 @@ def test_exportedPackages(p): @pytest.mark.parametrize("p", projects) def test_extraObjects(p): extraObjects = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -121,7 +121,7 @@ def test_extraObjects(p): @pytest.mark.parametrize("p", projects) def test_location(p): location = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -136,7 +136,7 @@ def test_location(p): @pytest.mark.parametrize("p", projects) def test_serializedRawObjects(p): serializedRawObjects = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -159,7 +159,7 @@ def test_serializedRawObjects(p): @pytest.mark.parametrize("p", projects) def test_subsystemName(p): subsystemName = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -175,7 +175,7 @@ def test_subsystemName(p): @pytest.mark.parametrize("p", projects) def test_subsystemAttrs(p): subsystemAttrs = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -191,7 +191,7 @@ def test_subsystemAttrs(p): @pytest.mark.parametrize("p", projects) def test_translatorName(p): translatorName = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -207,7 +207,7 @@ def test_translatorName(p): @pytest.mark.parametrize("p", projects) def test_extractors(p): finalObjects = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], @@ -241,7 +241,7 @@ def test_extractors(p): @pytest.mark.parametrize("p", projects) def test_keys(p): objectsByKey = nix_ffi.eval( - f"subsystems.{p['subsystem']}.translators.{p['translator']}.translate", + f"framework.translatorsBySubsystem.{p['subsystem']}.{p['translator']}.translateInstanced", params=dict( project=p['project'], source=p['source'], diff --git a/tests/unit/test_source_shortcuts.py b/tests/unit/test_source_shortcuts.py index 48c5dc89..6c11b7b0 100644 --- a/tests/unit/test_source_shortcuts.py +++ b/tests/unit/test_source_shortcuts.py @@ -68,7 +68,7 @@ import nix_ffi ]) def test_translateShortcut(shortcut, expected): result = nix_ffi.callNixFunction( - 'fetchers.translateShortcut', + 'framework.functions.fetchers.translateShortcut', shortcut=shortcut, computeHash=False, )