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

traceback on missing configuration #441

Open
glyph opened this issue Oct 4, 2022 · 5 comments
Open

traceback on missing configuration #441

glyph opened this issue Oct 4, 2022 · 5 comments

Comments

@glyph
Copy link
Member

glyph commented Oct 4, 2022

I think Incremental moved from towncrier.ini to pyproject.toml and now I get this when I run it

Traceback (most recent call last):
  File "/Users/glyph/.virtualenvs/incremental/bin/towncrier", line 8, in <module>
    sys.exit(cli())
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/towncrier/build.py", line 89, in _main
    return __main(
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/towncrier/build.py", line 115, in __main
    base_directory, config = load_config_from_options(directory, config_file)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/towncrier/_settings/load.py", line 32, in load_config_from_options
    config = load_config(base_directory)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/towncrier/_settings/load.py", line 59, in load_config
    return load_config_from_file(directory, config_file)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/towncrier/_settings/load.py", line 66, in load_config_from_file
    return parse_toml(directory, config)
  File "/Users/glyph/.virtualenvs/incremental/lib/python3.10/site-packages/towncrier/_settings/load.py", line 73, in parse_toml
    config = config["tool"]["towncrier"]
KeyError: 'towncrier'
glyph added a commit to twisted/incremental that referenced this issue Oct 4, 2022
@glyph
Copy link
Member Author

glyph commented Oct 4, 2022

(The config is moved in the incremental release candidate branch, but it would be nice to fix this for others upgrading.)

@hynek
Copy link
Member

hynek commented Oct 6, 2022

I don’t get it, what exactly would you like to have fixed? Do you want a better error message on missing config?

@adiroiban
Copy link
Member

Note that I was planning to remove incremental from towncrier - #398 :) while still supporting projects using incremental.

@SmileyChris
Copy link
Contributor

I've got an updated version of removing incremental here #491.

But the issue here is load.py shouldn't be assuming that config['tool'] has a towncrier section. This is fixed in my rewrite of parse_toml in #483

@SmileyChris
Copy link
Contributor

Fixed now #483 is merged 🎉

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

4 participants