Skip to content

Commit 32742da

Browse files
committed
fixes
1 parent e2cf880 commit 32742da

File tree

2 files changed

+4
-430
lines changed

2 files changed

+4
-430
lines changed

.jenkins/insert_last_verified.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from bs4 import BeautifulSoup
88

9+
910
json_file_path = "tutorials-review-data.json"
1011

1112
# paths to skip from the post-processing script
@@ -30,7 +31,6 @@
3031
"": "", # root dir for index.rst
3132
}
3233

33-
3434
def get_git_log_date(file_path, git_log_args):
3535
try:
3636
result = subprocess.run(
@@ -46,17 +46,13 @@ def get_git_log_date(file_path, git_log_args):
4646
pass
4747
raise ValueError(f"Could not find date for {file_path}")
4848

49-
5049
def get_creation_date(file_path):
51-
return get_git_log_date(file_path, ["--diff-filter=A", "--format=%aD"]).strftime(
52-
"%b %d, %Y"
53-
)
50+
return get_git_log_date(file_path, ["--diff-filter=A", "--format=%aD"]).strftime("%b %d, %Y")
5451

5552

5653
def get_last_updated_date(file_path):
5754
return get_git_log_date(file_path, ["-1", "--format=%aD"]).strftime("%b %d, %Y")
5855

59-
6056
# Try to find the source file with the given base path and the extensions .rst and .py
6157
def find_source_file(base_path):
6258
for ext in [".rst", ".py"]:
@@ -67,7 +63,7 @@ def find_source_file(base_path):
6763

6864

6965
# Function to process a JSON file and insert the "Last Verified" information into the HTML files
70-
def process_json_file(build_dir, json_file_path):
66+
def process_json_file(build_dir , json_file_path):
7167
with open(json_file_path, "r", encoding="utf-8") as json_file:
7268
json_data = json.load(json_file)
7369

@@ -152,14 +148,13 @@ def main():
152148
exit(1)
153149
build_dir = sys.argv[1]
154150
print(f"Build directory: {build_dir}")
155-
process_json_file(build_dir, json_file_path)
151+
process_json_file(build_dir , json_file_path)
156152
print(
157153
"Finished processing JSON file. Please check the output for any warnings. "
158154
"Pages like `nlp/index.html` are generated only during the full `make docs` "
159155
"or `make html` build. Warnings about these files when you run `make html-noplot` "
160156
"can be ignored."
161157
)
162158

163-
164159
if __name__ == "__main__":
165160
main()

0 commit comments

Comments
 (0)