Skip to content

FileNotFoundError, Failed to list the news fragment files #538

@jaraco

Description

@jaraco

After adopting towncrier for the hundreds of projects that depend on jaraco/skeleton, I've been pleased to say that it has helped streamline the changelog generation.

I've tried as much as possible to minimize the amount of config required (relying on towncrier to provide best practices by default). Unfortunately, if I try to cut a release when there are no newsfragments, the "finalize" step fails:

 pytest-checkdocs main @ tox -e finalize
finalize: commands[0]> python -m jaraco.develop.finalize
Loading template...
Finding news fragments...
Failed to list the news fragment files.
FileNotFoundError: [Errno 2] No such file or directory: '/Users/jaraco/code/jaraco/pytest-checkdocs/newsfragments'

I can work around the issue by first running mkdir -p newsfragments, but I'd rather not have to add that step. I know I can create a permanent newsfragments directory in every project, but that requires adding a sentinel file to keep it present. And given that towncrier already works well to create that directory when it doesn't exist, I'd like it to fall back to the degenerate behavior when running build.

Can you update towncrier build to treat a missing fragments directory as the same as an empty directory, same as towcrier create?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions