Skip to content

Commit

Permalink
🚑 Implement compatibility with Towncrier 24.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Dec 23, 2024
1 parent 73ad036 commit 240b3c9
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/sphinxcontrib/towncrier/_fragment_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,21 @@ def lookup_towncrier_fragments( # noqa: WPS210
else:
fragment_directory = None

_fragments, fragment_filenames = find_fragments(
str(fragment_base_directory),
towncrier_config.sections,
fragment_directory,
towncrier_config.types,
)
try:

Check warning on line 70 in src/sphinxcontrib/towncrier/_fragment_discovery.py

View check run for this annotation

Codecov / codecov/patch

src/sphinxcontrib/towncrier/_fragment_discovery.py#L70

Added line #L70 was not covered by tests
# Towncrier < 24.7.0rc1
# pylint: disable-next=too-many-function-args
_fragments, fragment_filenames = find_fragments(

Check warning on line 73 in src/sphinxcontrib/towncrier/_fragment_discovery.py

View check run for this annotation

Codecov / codecov/patch

src/sphinxcontrib/towncrier/_fragment_discovery.py#L73

Added line #L73 was not covered by tests
str(fragment_base_directory),
towncrier_config.sections,
fragment_directory,
towncrier_config.types,
)
except TypeError:

Check warning on line 79 in src/sphinxcontrib/towncrier/_fragment_discovery.py

View check run for this annotation

Codecov / codecov/patch

src/sphinxcontrib/towncrier/_fragment_discovery.py#L79

Added line #L79 was not covered by tests
# Towncrier >= 24.7.0rc1
_fragments, fragment_filenames = find_fragments( # noqa: WPS121

Check warning on line 81 in src/sphinxcontrib/towncrier/_fragment_discovery.py

View check run for this annotation

Codecov / codecov/patch

src/sphinxcontrib/towncrier/_fragment_discovery.py#L81

Added line #L81 was not covered by tests
str(fragment_base_directory),
towncrier_config,
strict=False,
)

return set(fragment_filenames)

0 comments on commit 240b3c9

Please sign in to comment.