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): add edx production details #430

Merged
merged 3 commits into from
Aug 17, 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
108 changes: 96 additions & 12 deletions barcalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,19 @@ def years_months(self):
sheet.setConditionalFormatRules(rules);
""")

def rawbar(self, istart, iend, name, color=None, text_color=None, current=False, indefinite=False, note=None):
def rawbar(
self,
istart,
iend,
name,
color=None,
text_color=None,
current=False,
alternate=False,
indefinite=False,
note=None,
):
text = name
formatting = ""
if color:
if current:
Expand All @@ -175,11 +187,15 @@ def rawbar(self, istart, iend, name, color=None, text_color=None, current=False,
if text_color:
formatting += f""".setFontColor({text_color!r})"""
if current:
formatting += f""".setBorder(true, true, true, true, null, null, "black", SpreadsheetApp.BorderStyle.SOLID_MEDIUM)"""
formatting += f""".setFontWeight("bold")"""
formatting += """.setBorder(true, true, true, true, null, null, "black", SpreadsheetApp.BorderStyle.SOLID_MEDIUM)"""
formatting += """.setFontWeight("bold")"""
elif alternate:
formatting += """.setBorder(true, true, true, true, null, null, "black", SpreadsheetApp.BorderStyle.SOLID)"""
formatting += """.setFontWeight("bold")"""
formatting += """.setFontStyle("italic")"""
text = f"** {text} **"
if indefinite:
iend = self.width - 24
text = name
if note:
self.footnotes.append(note)
text = f"{text} (note {len(self.footnotes)})"
Expand Down Expand Up @@ -319,6 +335,19 @@ def parse_version_name(line):
"Ruby": "3.0",
}

EDX = {
"Python": "3.8",
"Django": "3.2",
"Ubuntu": "20.04",
"Node": "16.x",
"Mongo": "4.2",
"MySQL": "5.7",
"Elasticsearch": "7.10",
"Redis": "5.6",
"Ruby": "3.0",
}


cal = GsheetCalendar(START_YEAR, END_YEAR)
cal.years_months()

Expand Down Expand Up @@ -401,6 +430,7 @@ def parse_version_name(line):
length=length,
color=color,
current=(name==CURRENT["Django"]),
alternate=(name==EDX["Django"]),
note=(more[0] if more else None),
)
cal.gap_line()
Expand All @@ -419,7 +449,14 @@ def parse_version_name(line):
('3.12', 2023, 10, 2028, 10), # https://peps.python.org/pep-0693/
]
for name, syear, smonth, eyear, emonth in python_releases:
cal.bar(f"Python {name}", start=(syear, smonth), end=(eyear, emonth), color="#ffd545", current=(name==CURRENT["Python"]))
cal.bar(
f"Python {name}",
start=(syear, smonth),
end=(eyear, emonth),
color="#ffd545",
current=(name==CURRENT["Python"]),
alternate=(name==EDX["Python"]),
)
cal.gap_line()

# Ubuntu releases
Expand All @@ -440,7 +477,15 @@ def parse_version_name(line):
nick = ubuntu_nicks.get(name, '')
if nick:
nick = f" {nick}"
cal.bar(f"Ubuntu {name}{nick}", (2000+year, month), length=length, color=color, text_color="white", current=(name==CURRENT["Ubuntu"]))
cal.bar(
f"Ubuntu {name}{nick}",
(2000+year, month),
length=length,
color=color,
text_color="white",
current=(name==CURRENT["Ubuntu"]),
alternate=(name==EDX["Ubuntu"]),
)
cal.gap_line()

# Node releases
Expand All @@ -455,7 +500,15 @@ def parse_version_name(line):
('18.x', 2022, 4, 2025, 4),
]
for name, syear, smonth, eyear, emonth in node_releases:
cal.bar(f"Node {name}", start=(syear, smonth), end=(eyear, emonth), color="#2f6c1b", text_color="white", current=(name==CURRENT["Node"]))
cal.bar(
f"Node {name}",
start=(syear, smonth),
end=(eyear, emonth),
color="#2f6c1b",
text_color="white",
current=(name==CURRENT["Node"]),
alternate=(name==EDX["Node"]),
)
cal.gap_line()

# Mongo releases
Expand All @@ -470,18 +523,33 @@ def parse_version_name(line):
('4.4', 2020, 7, 2024, 2),
]
for name, syear, smonth, eyear, emonth in mongo_releases:
cal.bar(f"Mongo {name}", start=(syear, smonth), end=(eyear, emonth), color="#4da65a", current=(name==CURRENT["Mongo"]))
cal.bar(
f"Mongo {name}",
start=(syear, smonth),
end=(eyear, emonth),
color="#4da65a",
current=(name==CURRENT["Mongo"]),
alternate=(name==EDX["Mongo"]),
)
cal.gap_line()

# MySQL releases
cal.section_note("https://endoflife.software/applications/databases/mysql")
cal.section_note("https://endoflife.date/mysql")
mysql_releases = [
('5.6', 2013, 2, 2021, 2),
('5.7', 2015, 10, 2023, 10),
('8.0', 2018, 4, 2026, 4),
('8.1', 2023, 6, 2024, 9), # Not sure of the real support dates.
]
for name, syear, smonth, eyear, emonth in mysql_releases:
cal.bar(f"MySQL {name}", start=(syear, smonth), end=(eyear, emonth), color="#b9dc48", current=(name==CURRENT["MySQL"]))
cal.bar(
f"MySQL {name}",
start=(syear, smonth),
end=(eyear, emonth),
color="#b9dc48",
current=(name==CURRENT["MySQL"]),
alternate=(name==EDX["MySQL"]),
)
cal.gap_line()

# elasticsearch releases
Expand All @@ -500,7 +568,14 @@ def parse_version_name(line):
('7.17', 2022, 2, 2023, 8),
]
for name, syear, smonth, eyear, emonth in es_releases:
cal.bar(f"Elasticsearch {name}", start=(syear, smonth), end=(eyear, emonth), color="#4595ba", current=(name==CURRENT["Elasticsearch"]))
cal.bar(
f"Elasticsearch {name}",
start=(syear, smonth),
end=(eyear, emonth),
color="#4595ba",
current=(name==CURRENT["Elasticsearch"]),
alternate=(name==EDX["Elasticsearch"]),
)
cal.gap_line()

# Redis
Expand All @@ -513,7 +588,15 @@ def parse_version_name(line):
('7.0', 2022, 4, 2025, 4),
]
for name, syear, smonth, eyear, emonth in redis_releases:
cal.bar(f"Redis {name}", start=(syear, smonth), end=(eyear, emonth), color="#963029", text_color="white", current=(name==CURRENT["Redis"]))
cal.bar(
f"Redis {name}",
start=(syear, smonth),
end=(eyear, emonth),
color="#963029",
text_color="white",
current=(name==CURRENT["Redis"]),
alternate=(name==EDX["Redis"]),
)
cal.gap_line()

# ruby
Expand All @@ -534,6 +617,7 @@ def parse_version_name(line):
end=(eyear, emonth),
color="#DE3F24",
current=(name==CURRENT["Ruby"]),
alternate=(name==EDX["Ruby"]),
note=(more[0] if more else None),
)
cal.gap_line()
Expand Down