Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ repos:
args: [--exit-non-zero-on-fix]
- id: ruff-format
name: Run Ruff (format)
args: [--check]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-json
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
Expand Down
5 changes: 3 additions & 2 deletions _tools/generate_release_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import csv
import datetime as dt
import json
from urllib.request import urlopen

import jinja2

Expand Down Expand Up @@ -41,8 +42,8 @@ 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)
with urlopen("https://peps.python.org/api/release-cycle.json") as in_file:
self.versions = json.loads(in_file.read().decode("utf-8"))

# Generate a few additional fields
for key, version in self.versions.items():
Expand Down
5 changes: 3 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from urllib.request import urlopen

extensions = [
'notfound.extension',
Expand Down Expand Up @@ -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"))

_main_version = next(
version for version, data in _cycle.items() if data.get("branch") == "main"
Expand Down
146 changes: 0 additions & 146 deletions include/release-cycle.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break scripts that depend on this file, e.g. your GitHub tools.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, they also need updating to point to https://peps.python.org/api/release-cycle.json

Let's update/notify the ones we know about before merging.

This file was deleted.

Loading