Skip to content

Commit 34d0fa2

Browse files
authored
feat: support reading mise.toml
1 parent 19e4675 commit 34d0fa2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/utils.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,21 @@ export function getVersionInputFromTomlFile(versionFile: string): string[] {
235235
pyprojectFile = pyprojectFile.replace(/\r\n/g, '\n');
236236

237237
const pyprojectConfig = toml.parse(pyprojectFile);
238-
let keys = [];
238+
let keys: string[] = [];
239239

240240
if ('project' in pyprojectConfig) {
241241
// standard project metadata (PEP 621)
242242
keys = ['project', 'requires-python'];
243-
} else {
243+
}
244+
else if ('tool' in pyprojectConfig) {
244245
// python poetry
245246
keys = ['tool', 'poetry', 'dependencies', 'python'];
246247
}
248+
else if ('tools' in pyprojectConfig){
249+
// mise
250+
keys = ['tools', 'python']
251+
}
252+
247253
const versions = [];
248254
const version = extractValue(pyprojectConfig, keys);
249255
if (version !== undefined) {

0 commit comments

Comments
 (0)