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

feat(barcalendar): Sumac and Teak #464

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions barcalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def validate_version_date(project, version, year, month, check_start=False):
"""
Validates the end-of-life(EOL) or release date for a project version.
Returns the correct EOL/releaseDate in case of a conflict with api value.

Parameters:
project (str): The name of the project.
version (str): The version of the project.
Expand All @@ -79,22 +79,22 @@ def validate_version_date(project, version, year, month, check_start=False):
url=f"https://endoflife.date/api/{project}/{version}.json",
headers={'Accept': 'application/json'}
)

if response.status_code != 200:
eol_logger.error(f"Project not Found: {project}/{version} not found on endoflife.date")
return (year, month)

version_info = response.json()
if check_start:
eol_year, eol_month, _ = version_info['releaseDate'].split("-")
date_type = "releaseDate"
else:
if version_info['eol'] == False:
eol_logger.warning(f"No EOL found for {project} {version}")
return (year, month)
return (year, month)
eol_year, eol_month, _ = version_info['eol'].split("-")
date_type = "eol"

if (year, month) == (int(eol_year), int(eol_month)):
return (year, month)
else:
Expand Down Expand Up @@ -449,9 +449,13 @@ def parse_version_name(line):
('Juniper', 2020, 6),
("Koa", 2020, 12),
("Lilac", 2021, 6),
("Maple", 2021, 12),
("Nutmeg", 2022, 6),
("Olive", 2022, 12),
("Palm", 2023, 6),
]
# https://www.treenames.net/common_tree_names.html
future = ["Maple", "Nutmeg", "Olive", "Palm", "Quince", "Redwood"] + list("STUVWXYZ")
future = ["Quince", "Redwood", "Sumac", "Teak"] + list("UVWXYZ")
target_length = 6 # months per release

releases = list(itertools.chain(names, [(name, None, None) for name in future]))
Expand Down