mirror of
https://github.com/actions/setup-python.git
synced 2025-07-19 03:58:21 +02:00
Extract python version from explicit main group (poetry)
As documented here https://python-poetry.org/docs/managing-dependencies/#dependency-groups ```toml [tool.poetry.dependencies] ``` and ```toml [tool.poetry.group.main.dependencies] ``` Are equivalent
This commit is contained in:
parent
b64ffcaf5b
commit
2eb6c43547
2 changed files with 25 additions and 5 deletions
|
@ -126,6 +126,18 @@ describe('Version from file test', () => {
|
|||
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]);
|
||||
}
|
||||
);
|
||||
it.each([getVersionInputFromTomlFile, getVersionInputFromFile])(
|
||||
'Version from poetry with explicit main group pyproject.toml test',
|
||||
async _fn => {
|
||||
await io.mkdirP(tempDir);
|
||||
const pythonVersionFileName = 'pyproject.toml';
|
||||
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
|
||||
const pythonVersion = '>=3.7.0';
|
||||
const pythonVersionFileContent = `[tool.poetry.group.main.dependencies]\npython = "${pythonVersion}"`;
|
||||
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
|
||||
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]);
|
||||
}
|
||||
);
|
||||
it.each([getVersionInputFromTomlFile, getVersionInputFromFile])(
|
||||
'Version undefined',
|
||||
async _fn => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue