MCPcopy Create free account
hub / github.com/vercel/vercel / createPyprojectToml

Function createPyprojectToml

packages/python/src/install.ts:207–229  ·  view source on GitHub ↗
({
  projectName,
  pyprojectPath,
  dependencies,
  pythonVersion,
}: {
  projectName: string;
  pyprojectPath: string;
  dependencies: string[];
  pythonVersion?: string;
})

Source from the content-addressed store, hash-verified

205}
206
207export async function createPyprojectToml({
208 projectName,
209 pyprojectPath,
210 dependencies,
211 pythonVersion,
212}: {
213 projectName: string;
214 pyprojectPath: string;
215 dependencies: string[];
216 pythonVersion?: string;
217}) {
218 const version = pythonVersion ?? DEFAULT_PYTHON_VERSION_STRING;
219 const requiresPython = `~=${version}.0`;
220
221 const manifest = createMinimalManifest({
222 name: projectName,
223 requiresPython,
224 dependencies,
225 });
226
227 const content = stringifyManifest(manifest);
228 await fs.promises.writeFile(pyprojectPath, content);
229}
230
231export interface UvProjectInfo {
232 projectDir: string;

Callers 1

unit.test.tsFile · 0.90

Calls 2

createMinimalManifestFunction · 0.90
stringifyManifestFunction · 0.90

Tested by

no test coverage detected