File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 153153 } ;
154154 } ;
155155
156+ # Test workspaceRoot passed as an attrset
157+ # This is analogous to using builtins.fetchGit & such which return an attrset with an outPath member.
158+ loadWorkspace . fetchedWorkspace =
159+ let
160+ mkTestSet =
161+ workspaceRoot :
162+ let
163+ ws = workspace . loadWorkspace { inherit workspaceRoot ; } ;
164+
165+ overlay = ws . mkPyprojectOverlay { sourcePreference = "wheel" ; } ;
166+
167+ pythonSet =
168+ ( pkgs . callPackage pyproject-nix . build . packages {
169+ python = pkgs . python312 ;
170+ } ) . overrideScope
171+ overlay ;
172+ in
173+ pythonSet ;
174+
175+ wsRoot = {
176+ outPath = "${ ./fixtures/workspace-flat } " ;
177+ } ;
178+ testSet = mkTestSet wsRoot ;
179+ in
180+ {
181+ # Test that the stringly src lookup is correct relative to the workspace root
182+ testOutpathSrc = {
183+ expr = testSet . "pkg-a" . src == "${ wsRoot } /packages/pkg-a" ;
184+ expected = true ;
185+ } ;
186+ } ;
187+
156188}
Original file line number Diff line number Diff line change @@ -95,7 +95,11 @@ fix (self: {
9595 # - A function taking the generated config as an argument, and returning the augmented config
9696 config ? { } ,
9797 } :
98- assert ( isPath workspaceRoot || ( isString workspaceRoot || hasContext workspaceRoot ) ) ;
98+ assert (
99+ isPath workspaceRoot
100+ || ( isString workspaceRoot && hasContext workspaceRoot )
101+ || ( isAttrs workspaceRoot && workspaceRoot ? outPath )
102+ ) ;
99103 assert isAttrs config || isFunction config ;
100104 let
101105 pyproject = importTOML ( workspaceRoot + "/pyproject.toml" ) ;
You can’t perform that action at this time.
0 commit comments