From 47017708a1491f440294a4e6c765c85f34dbb917 Mon Sep 17 00:00:00 2001 From: neko-design Date: Fri, 5 Jul 2024 11:08:18 +1000 Subject: [PATCH 1/2] Handle additional tables --- .gitignore | 4 +++- lambdaruntimes/__init__.py | 2 +- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6769e21..733311b 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,6 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +#.idea/ + +test.py \ No newline at end of file diff --git a/lambdaruntimes/__init__.py b/lambdaruntimes/__init__.py index 7b21287..533737a 100644 --- a/lambdaruntimes/__init__.py +++ b/lambdaruntimes/__init__.py @@ -114,7 +114,7 @@ def __populate_lambda_runtime_lists(self): tables = soup.find_all('table') for table in tables: - table_title = table.css.select_one('.title').get_text() + table_title = table.css.select_one('.title').get_text() if table.css.select_one('.title') else "Unknown" if table_title == self.current_runtimes_title: self.runtimes.extend(self.__process_current_runtimes(table)) elif table_title == self.expired_runtimes_title: diff --git a/pyproject.toml b/pyproject.toml index c3b24db..3497a63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "lambda-runtimes" -version = "0.0.1" +version = "0.0.2" authors = [ { name="Ewen McCahon", email="hi@ewenmccahon.me" }, From 597a99ec8357e034335c893970477abe167aa832 Mon Sep 17 00:00:00 2001 From: neko-design Date: Fri, 5 Jul 2024 11:11:42 +1000 Subject: [PATCH 2/2] Support runtimes with no expiry --- lambdaruntimes/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lambdaruntimes/__init__.py b/lambdaruntimes/__init__.py index 533737a..1d55845 100644 --- a/lambdaruntimes/__init__.py +++ b/lambdaruntimes/__init__.py @@ -89,8 +89,8 @@ def __process_expired_runtimes(self, table): sdk=None, os=row[2], arch=None, - deprecation_phase_1=parser.parse(row[3]) if row[3] else parser.parse(row[4]), - deprecation_phase_2=parser.parse(row[4]), + deprecation_phase_1=parser.parse(row[3]) if row[3] else None, + deprecation_phase_2=parser.parse(row[4]) if row[4] else None, runtime_is_expiring=True, runtime_is_expired=True))