MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / main

Function main

scripts/update_docfx.py:101–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99
100
101def main():
102 parser = argparse.ArgumentParser()
103 parser.add_argument(
104 "--version",
105 help="Use this DocFX version instead of the latest stable.",
106 )
107 parser.add_argument(
108 "--allow-prerelease",
109 action="store_true",
110 help="Allow prerelease versions when selecting latest.",
111 )
112 parser.add_argument(
113 "--output",
114 default="dotnet/private/docfx_repo.bzl",
115 help="Output file path (default: dotnet/private/docfx_repo.bzl)",
116 )
117 args = parser.parse_args()
118
119 index = fetch_json(NUGET_INDEX_URL)
120 versions = index.get("versions", [])
121 if not versions:
122 raise ValueError("NuGet index returned no versions for DocFX")
123
124 version = choose_version(versions, args.allow_prerelease, args.version)
125 nupkg_url = NUGET_NUPKG_URL.format(version=version)
126 sha256 = sha256_of_url(nupkg_url)
127
128 output_path = Path(args.output)
129 if not output_path.is_absolute():
130 workspace_dir = os.environ.get("BUILD_WORKSPACE_DIRECTORY")
131 if workspace_dir:
132 output_path = Path(workspace_dir) / output_path
133 output_path.write_text(render_docfx_repo(version, sha256))
134
135 print(f"Updated {output_path} to DocFX {version}")
136
137
138if __name__ == "__main__":

Callers 1

update_docfx.pyFile · 0.70

Calls 8

fetch_jsonFunction · 0.85
choose_versionFunction · 0.85
sha256_of_urlFunction · 0.85
PathClass · 0.85
render_docfx_repoFunction · 0.85
getMethod · 0.65
add_argumentMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected