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 f4c77e2
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/sphinxcontrib/towncrier/_fragment_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,20 @@ 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
_fragments, fragment_filenames = find_fragments(

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

View check run for this annotation

Codecov / codecov/patch

src/sphinxcontrib/towncrier/_fragment_discovery.py#L72

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

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

View check run for this annotation

Codecov / codecov/patch

src/sphinxcontrib/towncrier/_fragment_discovery.py#L78

Added line #L78 was not covered by tests
# Towncrier >= 24.7.0rc1
_fragments, fragment_filenames = find_fragments(

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

View check run for this annotation

Codecov / codecov/patch

src/sphinxcontrib/towncrier/_fragment_discovery.py#L80

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

return set(fragment_filenames)

0 comments on commit f4c77e2

Please sign in to comment.