diff --git a/src/apple.py b/src/apple.py index f12e8ff8..74c35833 100644 --- a/src/apple.py +++ b/src/apple.py @@ -36,16 +36,16 @@ VERSION_PATTERNS = { ], "ios": [ re.compile(r"iOS\s+(?P\d+)", re.MULTILINE), - re.compile(r"iOS\s+(?P\d+(?:)(?:\.\d+)+)", re.MULTILINE), - re.compile(r"iPhone\s+v?(?P\d+(?:)(?:\.\d+)+)", re.MULTILINE), + re.compile(r"iOS\s+(?P\d+(?:\.\d+)+)", re.MULTILINE), + re.compile(r"iPhone\s+v?(?P\d+(?:\.\d+)+)", re.MULTILINE), ], "ipados": [ re.compile(r"iPadOS\s+(?P\d+)", re.MULTILINE), - re.compile(r"iPadOS\s+(?P\d+(?:)(?:\.\d+)+)", re.MULTILINE), + re.compile(r"iPadOS\s+(?P\d+(?:\.\d+)+)", re.MULTILINE), ], "watchos": [ re.compile(r"watchOS\s+(?P\d+)", re.MULTILINE), - re.compile(r"watchOS\s+(?P\d+(?:)(?:\.\d+)+)", re.MULTILINE), + re.compile(r"watchOS\s+(?P\d+(?:\.\d+)+)", re.MULTILINE), ], } diff --git a/src/common/endoflife.py b/src/common/endoflife.py index fe3d1457..952b7da5 100644 --- a/src/common/endoflife.py +++ b/src/common/endoflife.py @@ -102,7 +102,7 @@ class Product: if self.versions[version] != date: logging.warning(f"overwriting version {version} ({self.versions[version]} -> {date}) for {self.name}") else: - return # already declared + return # already declared logging.info(f"adding version {version} ({date}) to {self.name}") self.versions[version] = date diff --git a/src/debian.py b/src/debian.py index 942c0545..fb8f68f7 100644 --- a/src/debian.py +++ b/src/debian.py @@ -7,7 +7,7 @@ from common.git import Git """Fetch Debian versions by parsing news in www.debian.org source repository.""" -def extract_major_versions(product: endoflife.Product, repo_dir: Path) -> None: +def extract_major_versions(p: endoflife.Product, repo_dir: Path) -> None: child = run( f"grep -RhE -A 1 'Debian [0-9]+.+ released' {repo_dir}/english/News " f"| cut -d '<' -f 2 " @@ -22,11 +22,11 @@ def extract_major_versions(product: endoflife.Product, repo_dir: Path) -> None: version = line.split(" ")[1] is_release_line = False else: - product.declare_version(version, dates.parse_date(line)) + p.declare_version(version, dates.parse_date(line)) is_release_line = True -def extract_point_versions(product: endoflife.Product, repo_dir: Path) -> None: +def extract_point_versions(p: endoflife.Product, repo_dir: Path) -> None: child = run( f"grep -Rh -B 10 '' {repo_dir}/english/News " "| grep -Eo '(release_date>(.*)<|revision>(.*)<)' " @@ -38,7 +38,7 @@ def extract_point_versions(product: endoflife.Product, repo_dir: Path) -> None: for line in child.stdout.decode("utf-8").strip().split("\n"): (date, version) = line.split(' ') - product.declare_version(version, dates.parse_date(date)) + p.declare_version(version, dates.parse_date(date)) product = endoflife.Product("debian") diff --git a/src/docker_hub.py b/src/docker_hub.py index 67a417b0..d506448f 100644 --- a/src/docker_hub.py +++ b/src/docker_hub.py @@ -9,17 +9,17 @@ Unfortunately images creation date cannot be retrieved, so we had to use the tag METHOD = "docker_hub" -def fetch_releases(product: endoflife.Product, config: endoflife.AutoConfig, url: str) -> None: +def fetch_releases(p: endoflife.Product, c: endoflife.AutoConfig, url: str) -> None: data = http.fetch_url(url).json() for result in data["results"]: version_str = result["name"] - if config.first_match(version_str): + if c.first_match(version_str): date = dates.parse_datetime(result["tag_last_pushed"]) - product.declare_version(version_str, date) + p.declare_version(version_str, date) if data["next"]: - fetch_releases(product, config, data["next"]) + fetch_releases(p, c, data["next"]) p_filter = sys.argv[1] if len(sys.argv) > 1 else None @@ -29,8 +29,7 @@ for product_name in endoflife.list_products(METHOD, p_filter): product_frontmatter = endoflife.ProductFrontmatter(product.name) for config in product_frontmatter.get_auto_configs(METHOD): - url = f"https://hub.docker.com/v2/repositories/{config.url}/tags?page_size=100&page=1" - fetch_releases(product, config, url) + fetch_releases(product, config, f"https://hub.docker.com/v2/repositories/{config.url}/tags?page_size=100&page=1") product.write() print("::endgroup::") diff --git a/src/plesk.py b/src/plesk.py index 05c4c812..fffe31d0 100644 --- a/src/plesk.py +++ b/src/plesk.py @@ -9,7 +9,7 @@ there is no entry for GA of version 18.0.18 and older.""" product = endoflife.Product("plesk") print(f"::group::{product.name}") response = http.fetch_url("https://docs.plesk.com/release-notes/obsidian/change-log") -soup = BeautifulSoup(response.text, features="html5lib") +soup = BeautifulSoup(response.text, features="html5lib") for release in soup.find_all("div", class_="changelog-entry--obsidian"): version = release.h2.text.strip() diff --git a/src/splunk.py b/src/splunk.py index 8f88e4cf..07b9159e 100644 --- a/src/splunk.py +++ b/src/splunk.py @@ -42,10 +42,10 @@ all_versions = list(map(lambda option: option.attrs['value'], soup.select("selec latest_minor_versions = get_latest_minor_versions(all_versions) latest_minor_versions_urls = [f"https://docs.splunk.com/Documentation/Splunk/{v}/ReleaseNotes/MeetSplunk" for v in latest_minor_versions] for response in http.fetch_urls(latest_minor_versions_urls): - for (version, date_str) in VERSION_DATE_PATTERN.findall(response.text): - version = f"{version}.0" if len(version.split(".")) == 2 else version # convert x.y to x.y.0 + for (version_str, date_str) in VERSION_DATE_PATTERN.findall(response.text): + version_str = f"{version_str}.0" if len(version_str.split(".")) == 2 else version_str # convert x.y to x.y.0 date = dates.parse_date(date_str) - product.declare_version(version, date) + product.declare_version(version_str, date) product.write() print("::endgroup::") diff --git a/src/typo3.py b/src/typo3.py index e4e1eea2..467d94da 100644 --- a/src/typo3.py +++ b/src/typo3.py @@ -8,7 +8,7 @@ for v in data: continue version = v["version"] - date = dates.parse_datetime(v["date"], to_utc=False) # utc kept for now for backwards compatibility + date = dates.parse_datetime(v["date"], to_utc=False) # utc kept for now for backwards compatibility product.declare_version(version, date) product.write()