File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1717import time
1818from importlib .metadata import version
1919from pathlib import Path
20+
2021import requests
22+
2123# If extensions (or modules to document with autodoc) are in another directory,
2224# add these directories to sys.path here. If the directory is relative to the
2325# documentation root, use Path().resolve() to make it absolute, like shown here.
6870# |version| and |release|, also used in various other places throughout the
6971# built documents.
7072
73+
7174def _get_latest_release_from_github (org : str , repo_name : str ) -> str :
72- """Get the highest version release (including prereleases) from GitHub repository."""
75+ """Get the highest version release (including prereleases) from GitHub
76+ repository."""
7377 url = f"https://api.github.com/repos/{ org } /{ repo_name } /releases"
7478 response = requests .get (url )
7579 releases = response .json ()
@@ -79,6 +83,7 @@ def _get_latest_release_from_github(org: str, repo_name: str) -> str:
7983 latest_version_release = valid_releases [0 ]["tag_name" ]
8084 return latest_version_release
8185
86+
8287# Get the latest release version from GitHub repository
8388org = "diffpy"
8489repo_name = "diffpy.utils"
You can’t perform that action at this time.
0 commit comments