Skip to content

Commit

Permalink
Refactor _release_file function
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Nov 26, 2024
1 parent 3f2a6cd commit f1ec350
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions galaxy_release_util/bootstrap_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
RELEASE_DELTA_MONTHS = 4 # Number of months between releases.
MINOR_TO_MONTH = {0: 2, 1: 6, 2: 10}
FREEZE_TO_RELEASE_DELTA_DAYS = 21 # Default number of days from freeze to release
OLDER_RELEASES_FILENAME = "older_releases.rst"


TEMPLATE = """
Expand Down Expand Up @@ -660,12 +661,10 @@ def _get_release_notes_filenames(galaxy_root):
return sorted(os.listdir(releases_path))


def _release_file(galaxy_root: Path, release: Optional[str]) -> str: # TODO: check this!
def _release_file(galaxy_root: Path, filename: Optional[str]) -> str:
"""Construct and return path to a release documentation file."""
releases_path = galaxy_root / "doc" / "source" / "releases"
if release is None:
release = sorted(os.listdir(releases_path))[-1]
history_path = os.path.join(releases_path, release)
return history_path
return os.path.join(releases_path, filename or OLDER_RELEASES_FILENAME)


def process_sentence(message): # TODO: check this!
Expand Down

0 comments on commit f1ec350

Please sign in to comment.