File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,19 +87,20 @@ async def start_server(configs: Config):
8787 f"Starting bundled ChromaDB server at { configs .host } :{ configs .port } ."
8888 )
8989 env .update ({"ANONYMIZED_TELEMETRY" : "False" })
90+ exe = os .path .join (sys .prefix , "bin" , "chroma" )
91+ if not os .path .isfile (exe ):
92+ exe = os .path .join (sys .prefix , "Scripts" , "chroma" )
9093 process = await asyncio .create_subprocess_exec (
91- sys .executable ,
92- "-m" ,
93- "chromadb.cli.cli" ,
94+ exe ,
9495 "run" ,
9596 "--host" ,
9697 "localhost" ,
9798 "--port" ,
9899 str (configs .port ),
99100 "--path" ,
100101 db_path ,
101- "--log-path" ,
102- os .path .join (str (configs .db_log_path ), "chroma.log" ),
102+ # "--log-path",
103+ # os.path.join(str(configs.db_log_path), "chroma.log"),
103104 stdout = subprocess .DEVNULL ,
104105 stderr = sys .stderr ,
105106 env = env ,
Original file line number Diff line number Diff line change @@ -428,21 +428,20 @@ def _new_isdir(path):
428428 MockCreateProcess .assert_called_once ()
429429 args , kwargs = MockCreateProcess .call_args
430430 expected_args = [
431- sys .executable ,
432- "-m" ,
433- "chromadb.cli.cli" ,
434431 "run" ,
435432 "--host" ,
436433 "localhost" ,
437434 "--port" ,
438435 str (12345 ), # Check the mocked port
439436 "--path" ,
440437 temp_dir ,
441- "--log-path" ,
442- os .path .join (str (config .db_log_path ), "chroma.log" ),
438+ # "--log-path",
439+ # os.path.join(str(config.db_log_path), "chroma.log"),
443440 ]
444- assert args [0 ] == sys .executable
445- assert tuple (args [1 :]) == tuple (expected_args [1 :])
441+ assert os .path .isfile (args [0 ]) and "chroma" in args [0 ], (
442+ f"{ args [0 ]} should be the path to the `chroma` executable."
443+ )
444+ assert tuple (args [1 :]) == tuple (expected_args )
446445 assert kwargs ["stdout" ] == subprocess .DEVNULL
447446 assert kwargs ["stderr" ] == sys .stderr
448447 assert "ANONYMIZED_TELEMETRY" in kwargs ["env" ]
You can’t perform that action at this time.
0 commit comments