MCPcopy Index your code
hub / github.com/praw-dev/praw / fetch_versions

Function fetch_versions

tools/set_active_docs.py:15–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14
15def fetch_versions():
16 response = requests.get(
17 f"https://readthedocs.org/api/v3/projects/{PROJECT}/versions?active=true",
18 headers=HEADERS,
19 )
20 versions = None
21 if response.status_code == 200:
22 active_versions = response.json()
23 versions = [
24 packaging.version.parse(slug["slug"].strip("v"))
25 for slug in active_versions["results"]
26 if not slug["hidden"] and slug["slug"] not in ["stable", "latest"]
27 ]
28 if versions is None:
29 sys.stderr.write("Failed to get current active versions\n")
30 return versions
31
32
33def main():

Callers 1

mainFunction · 0.85

Calls 2

getMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…