@renovatebot/detect-tools
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -10,9 +10,34 @@ "use strict"; | ||
.object({ | ||
requires: zod_1.z.object({ | ||
requires: zod_1.z | ||
.object({ | ||
python_version: zod_1.z.string().nullable().catch(null), | ||
python_full_version: zod_1.z.string().nullable().catch(null), | ||
}) | ||
.catch({ | ||
python_version: null, | ||
python_full_version: null, | ||
}), | ||
packages: zod_1.z | ||
.object({ | ||
pipenv: zod_1.z.string().nullable(), | ||
}) | ||
.catch({ pipenv: null }), | ||
'dev-packages': zod_1.z | ||
.object({ | ||
pipenv: zod_1.z.string().nullable(), | ||
}) | ||
.catch({ pipenv: null }), | ||
}) | ||
.transform(({ requires: { python_version: pythonVersion, python_full_version: pythonFullVersion, }, }) => ({ pythonVersion, pythonFullVersion })) | ||
.catch({ pythonVersion: null, pythonFullVersion: null }); | ||
.transform(({ requires: { python_version: pythonVersion, python_full_version: pythonFullVersion, }, packages: { pipenv: pipenvDefault }, 'dev-packages': { pipenv: pipenvDevelop }, }) => ({ | ||
pythonVersion, | ||
pythonFullVersion, | ||
pipenvDefault, | ||
pipenvDevelop, | ||
})) | ||
.catch({ | ||
pythonVersion: null, | ||
pythonFullVersion: null, | ||
pipenvDefault: null, | ||
pipenvDevelop: null, | ||
}); | ||
const PythonConstraint = zod_1.z | ||
@@ -98,5 +123,9 @@ .object({ | ||
} | ||
return ''; | ||
return null; | ||
}) | ||
.catch(''); | ||
.nullable() | ||
.catch(null); | ||
const PipfilePipenvConstraint = schema_1.Toml.pipe(PythonConstraintObject) | ||
.pipe(PipenvConstraint) | ||
.catch(null); | ||
async function getPythonConstraint(path) { | ||
@@ -125,5 +154,13 @@ const pipfileContent = await (0, fs_1.readFile)(path, 'Pipfile'); | ||
async function getPipenvConstraint(path) { | ||
const pipfileContent = await (0, fs_1.readFile)(path, 'Pipfile'); | ||
const pipenvConstraint = PipfilePipenvConstraint.parse(pipfileContent); | ||
if (pipenvConstraint) { | ||
return pipenvConstraint; | ||
} | ||
const lockfileContent = await (0, fs_1.readFile)(path, 'Pipfile.lock'); | ||
const pipenvConstraint = PipfileLock.pipe(PipenvConstraint).parse(lockfileContent); | ||
return pipenvConstraint; | ||
const pipenvLockfileConstraint = PipfileLock.pipe(PipenvConstraint).parse(lockfileContent); | ||
if (pipenvLockfileConstraint) { | ||
return pipenvLockfileConstraint; | ||
} | ||
return ''; | ||
} |
{ | ||
"name": "@renovatebot/detect-tools", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -38,5 +38,5 @@ "type": "commonjs", | ||
"typescript": "5.5.4", | ||
"typescript-eslint": "8.0.0" | ||
"typescript-eslint": "8.0.1" | ||
}, | ||
"packageManager": "pnpm@9.6.0" | ||
} | ||
} |
43298
214