Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1k
Replace local release-cycle.json with PEPs repo version#1685
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9edafb0bf47e6d0dec2140e5cb8451829e3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,6 +7,9 @@ | ||
| import csv | ||
| import datetime as dt | ||
| import json | ||
| from functools import cache | ||
| from pathlib import Path | ||
| from urllib.request import urlopen | ||
| import jinja2 | ||
| @@ -37,12 +40,17 @@ def parse_version(ver: str) -> list[int]: | ||
| return [int(i) for i in ver["key"].split(".")] | ||
| @cache | ||
| def get_versions() -> dict[str, dict[str, str | int]]: | ||
| with urlopen("https://peps.python.org/api/release-cycle.json") as in_file: | ||
| return json.loads(in_file.read().decode("utf-8")) | ||
hugovk marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| class Versions: | ||
| """For converting JSON to CSV and SVG.""" | ||
| def __init__(self, *, limit_to_active=False, special_py27=False) -> None: | ||
| with open("include/release-cycle.json", encoding="UTF-8") as in_file: | ||
| self.versions = json.load(in_file) | ||
| self.versions = get_versions() | ||
| # Generate a few additional fields | ||
| for key, version in self.versions.items(): | ||
| @@ -197,6 +205,8 @@ def main() -> None: | ||
| versions = Versions() | ||
| assert len(versions.versions) > 10 | ||
| Path("include").mkdir(exist_ok=True) | ||
| versions.write_csv() | ||
| versions.write_svg(args.today, "include/release-cycle-all.svg") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import json | ||
| from urllib.request import urlopen | ||
hugovk marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| extensions = [ | ||
| 'notfound.extension', | ||
| @@ -178,8 +179,8 @@ | ||
| # Dynamically expose the Python version associated with the "main" branch. | ||
| # Exactly one entry in ``release-cycle.json`` should have ``"branch": "main"``. | ||
| with open("include/release-cycle.json", encoding="UTF-8") as _f: | ||
| _cycle = json.load(_f) | ||
| with urlopen("https://peps.python.org/api/release-cycle.json") as _f: | ||
| _cycle = json.loads(_f.read().decode("utf-8")) | ||
hugovk marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. hugovk marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| _main_version = next( | ||
| version for version, data in _cycle.items() if data.get("branch") == "main" | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.