You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot parse version number from TOML 1.0.0 pyproject.toml file #897
Description:
When providing a pyproject.toml that uses TOML 1.0.0 entries as python-version-file the action fails due to an error within the TOML parser.
Action version: v5.1.0
Platform:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Tools version:
Python 3.10 (the one installed by default)
Python 3.12 (the target version)
Repro steps:
Create a pyproject.toml file using a mixed list (here is the default value for Poetry Dynamic Versioning):
Run the action using the file as "Python version file".
Expected behavior:
The action installs Python >=3.12 in the job's container.
Actual behavior:
The action fails with the following error:
Error: Inline lists must be a single type, not a mix of string and inline-table at row 27, col 84, pos 757:
26: "(^release\\s*(?::.*?)?=\\s*['\"])[^'\"]*(['\"])",
27> { value = "(^__version_tuple__\\s*(?::.*?)?=\\s*\\()[^)]*(\\))", mode = "tuple" },
^
28: ]
This tool must pull the previous version from NPM that's 4 years old. v2.2.5 must enforce Toml 0.5.0 rules, which forbid mixed types in an Array, as the error says.
I don't know if the builder or typescript compiler can pull in packages from Github instead of npm. But if so, fixing this should just need a version bump here and elsewhere:
Hello @Jazzinghen 👋,
We have bumped the version of the @iarna/toml library from 2.2.5 to 3.0.0, which now includes support for TOML 1.0.0. The changes have been merged into the main branch and will be reflected in the upcoming release. In the meantime, could you please try using setup-python@main and confirm if the issue is resolved? We appreciate your patience and understanding.
Thanks @JamesParrott for the insights!
Hello @Jazzinghen 👋,
Just a gentle reminder to see if you had a chance to test the changes with setup-python@main. Has the issue been fixed?Your response is greatly appreciated. Thank you in advance :)
Hello @Jazzinghen 👋,
As previously mentioned, the updates to the @iarna/toml library have been merged into the main branch and will be included in the upcoming release of setup-python. Therefore, I am closing this issue. If you encounter any further problems, please feel free to reopen or create a new issue.
@priya-kinthali sorry I haven't replied earlier. I have been swamped by work, so I couldn't check this.
I'll test it out asap and let you know if there are any issues.
Activity
JamesParrott commentedon Jun 19, 2024
The dev version of the toml library used by this tool has supported Toml 1.0.0-rc1 (that allows mixed types in arrays) since 2019.
It's currently on v3.0.0 https://github.com/iarna/iarna-toml/releases/tag/v3.0.0
This tool must pull the previous version from NPM that's 4 years old. v2.2.5 must enforce Toml 0.5.0 rules, which forbid mixed types in an Array, as the error says.
https://www.npmjs.com/package/@iarna/toml
I don't know if the builder or typescript compiler can pull in packages from Github instead of npm. But if so, fixing this should just need a version bump here and elsewhere:
setup-python/package-lock.json
Line 19 in 82c7e63
v-aparnajyothi-y commentedon Jun 20, 2024
Hello @Jazzinghen, Thank you for creating this issue and we will look into it :)
Jazzinghen commentedon Jun 21, 2024
@aparnajyothi-y
Thank you for letting me know.
v-priya-kinthali commentedon Jul 25, 2024
Hello @Jazzinghen 👋,
We have bumped the version of the
@iarna/tomllibrary from 2.2.5 to 3.0.0, which now includes support forTOML1.0.0. The changes have been merged into themainbranch and will be reflected in the upcoming release. In the meantime, could you please try usingsetup-python@mainand confirm if the issue is resolved? We appreciate your patience and understanding.Thanks @JamesParrott for the insights!
v-priya-kinthali commentedon Aug 6, 2024
Hello @Jazzinghen 👋,
Just a gentle reminder to see if you had a chance to test the changes with
setup-python@main. Has the issue been fixed?Your response is greatly appreciated. Thank you in advance :)v-priya-kinthali commentedon Aug 20, 2024
Hello @Jazzinghen 👋,
As previously mentioned, the updates to the
@iarna/tomllibrary have been merged into themainbranch and will be included in the upcoming release ofsetup-python. Therefore, I am closing this issue. If you encounter any further problems, please feel free to reopen or create a new issue.Thank you for your understanding and cooperation.
Jazzinghen commentedon Aug 22, 2024
@priya-kinthali sorry I haven't replied earlier. I have been swamped by work, so I couldn't check this.
I'll test it out asap and let you know if there are any issues.