Skip to content

Pydantic Validation Error with version_toml in 8.0.0 #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wizrds opened this issue Jul 16, 2023 · 5 comments
Closed

Pydantic Validation Error with version_toml in 8.0.0 #624

wizrds opened this issue Jul 16, 2023 · 5 comments
Labels
bug Something isn't working properly

Comments

@wizrds
Copy link

wizrds commented Jul 16, 2023

The problem

Beginning in version 8.0.0 I am receiving the following traceback:

  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for RawConfig
version_toml
  value is not a valid tuple (type=type_error.tuple)

Expected behavior

It should correctly bump the version.

Environment

python: 3.11.2
pip: 22.3.1
python-semantic-release: 8.0.0

Configuration

[tool.semantic_release]
version_toml = "pyproject.toml:tool.poetry.version"

Logs

Please provide debug logs for the command you are using with the -vv flag, e.g.

[14:02:49] DEBUG    [semantic_release.cli.commands.main] DEBUG main.main: logging level set to: DEBUG                                                                               main.py:106
           DEBUG    [semantic_release.cli.commands.main] DEBUG main.main: global cli options: GlobalCommandLineOptions(noop=False, verbosity=2, config_file='pyproject.toml',       main.py:124
                    strict=False)                                                                                                                                                              
           INFO     [semantic_release.cli.commands.main] INFO main.main: Loading TOML configuration from pyproject.toml
           <TRACEBACK>

Rolling back to 7.34.6 fixes the issue.

@wizrds wizrds added the bug Something isn't working properly label Jul 16, 2023
@bernardcooke53
Copy link
Contributor

Hey @wizrds - version_toml should be a list, try wrapping that value in []

@wizrds
Copy link
Author

wizrds commented Jul 16, 2023

Ah I see, so not being a list was the bug then?

@bernardcooke53
Copy link
Contributor

Yes, version_toml is a list in v8

@wizrds wizrds closed this as completed Jul 16, 2023
@css-optivoy
Copy link
Contributor

The fact that version_toml is now required to be a list in pyproject.toml could probably be better documented in the doc.

Currently it simply states that the value of version_toml can be something like pyproject.toml:tool.poetry.version.
The closest it gets to implying it must be a list is saying

[version_toml is s]imilar to version_variable [...]

where the doc for version_variable in turn says:

In pyproject.toml specifically, you can also use the TOML list syntax to specify multiple versions

(Emphasis mine.)

This makes it sounds like you can use either a list or a string for version_variable, and by extension, for version_toml.

@browniebroke
Copy link
Contributor

browniebroke commented Jul 17, 2023

The fact that version_toml is now required to be a list in pyproject.toml could probably be better documented in the doc.

It is much better in the source file of the docs . Unfortunately the docs are failing to build right now (RTD link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

4 participants