Skip to content
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

Error: Invalid config: Key 'file' error using pyproject.toml #103

Closed
tomvothecoder opened this issue Jun 2, 2021 · 2 comments
Closed

Error: Invalid config: Key 'file' error using pyproject.toml #103

tomvothecoder opened this issue Jun 2, 2021 · 2 comments

Comments

@tomvothecoder
Copy link

tomvothecoder commented Jun 2, 2021

I am attempting to use the existing pyproject.toml file instead of a separate tbump config file.

However, I am getting the following error:

Error: Invalid config: Key 'file' error:
Or(Schema({'src': <class 'str'>, Optional('search'): <class 'str'>, Optional('version_template'): <class 'str'>})) did not validate {'src': '...'}
Schema({'src': <class 'str'>, Optional('search'): <class 'str'>, Optional('version_template'): <class 'str'>}).validate({'src': '...'}) raised TypeError("__init__() missing 3 required positional arguments: 'value', 'trivia', and 'is_aot_element'")

Steps to reproduce:

  1. tbump init --pyproject <current_version>
  2. tbump <new_version>

The same config works fine in tbump.toml file.

Also, thanks for the work on this project. It helps with release candidates that use the PEP format.

@dmerejkowsky
Copy link
Collaborator

It looks like an issue with latest version of tomlkit and schema ...

import schema
import tomlkit


foo_schema = schema.Schema({"foo": str})
table = tomlkit.table()
table.add("foo", 42)
foo_schema.validate(table)
Traceback (most recent call last):
  File "/mnt/data/dmerej/src/tbump/toml_validation.py", line 8, in <module>
    foo_schema.validate(table)
  File "/home/dmerej/.cache/pypoetry/virtualenvs/tbump-AVGABPqS-py3.9/lib/python3.9/site-packages/schema.py", line 361, in validate
    new = type(data)()  # new - is a dict of the validated values
TypeError: __init__() missing 3 required positional arguments: 'value', 'trivia', and 'is_aot_element'

@dmerejkowsky
Copy link
Collaborator

Fixed in 1edcf06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants