Skip to content

Commit 9c666d6

Browse files
new version
1 parent 4bb7bb0 commit 9c666d6

File tree

6 files changed

+25
-49
lines changed

6 files changed

+25
-49
lines changed

doc/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,9 @@
7979
"accent_color": "grass",
8080
}
8181
# -- Configure link checking behavior ----------------------------------------
82-
linkcheck_rate_limit_timeout = 15
82+
linkcheck_rate_limit_timeout = 20
83+
linkcheck_timeout = 10
84+
linkcheck_anchors = False
85+
linkcheck_ignore = [
86+
"https://github.com/exasol/python-toolbox/issues/new?assignees=&labels=documentation&projects=&template=documentation.md&title=%F0%9F%93%9A+%3CInsert+Title%3E"
87+
]

doc/developer_guide/modules/sphinx/sphinx.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sphinx
44
sphinx-multiversion
55
+++++++++++++++++++
66

7-
The `sphinx-multiversion` extension is a modified copy of `Holzhaus/sphinx-multiversion <https://github.com/Holzhaus/sphinx-multiversion>`_. This copy was taken from version :code:`0.24.0`.
7+
The `sphinx-multiversion` extension is a modified copy of `Holzhaus/sphinx-multiversion <https://github.com/sphinx-contrib/multiversion>`_. This copy was taken from version :code:`0.24.0`.
88

99
It has been adjusted with minor code changes and modified defaults to work seamlessly with Exasol integration projects, which often require a specific project structure and layout. Additionally, it is designed to be used with an HTML theme that supports displaying and selecting multiple versions if the `versions` variable is set in the HTML context of sphinx. As of this writing, the theme used in conjunction with this modified version of `sphinx-multiversion` is `SHIBUYA <https://github.com/lepture/shibuya>`_, version :code:`2024.10.15`.
1010

doc/styleguide/guides/idioms/idioms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ where we picked it up from, rather than the "original" source.
3737

3838

3939
.. _Raymond Hettinger: https://github.com/rhettinger
40-
.. _Transform Code into Beautiful, Idiomatic Python: https://www.youtube.com/watch?v=OSGv2VnC0go>
40+
.. _Transform Code into Beautiful, Idiomatic Python: https://www.youtube.com/watch?v=OSGv2VnC0go
4141
.. _Transform Python Slides: https://speakerdeck.com/pyconslides/transforming-code-into-beautiful-idiomatic-python-by-raymond-hettinger-1

doc/styleguide/guides/style.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ _____
5454
.. _Google Styleguide: https://google.github.io/styleguide/pyguide.html
5555
.. _PEP 8: https://peps.python.org/pep-0008/
5656
.. _Python Idioms: https://gist.github.com/0x4D31/f0b633548d8e0cfb66ee3bea6a0deff9
57-
.. _Python Like You Mean It: http://www.pythonlikeyoumeanit.com/module_2.html>
57+
.. _Python Like You Mean It: http://www.pythonlikeyoumeanit.com/module_2.html
5858
.. _Python Programming Idioms: https://en.wikibooks.org/wiki/Python_Programming/Idioms
5959

60-
.. _Transform Code into Beautiful, Idiomatic Python: https://www.youtube.com/watch?v=OSGv2VnC0go>
60+
.. _Transform Code into Beautiful, Idiomatic Python: https://www.youtube.com/watch?v=OSGv2VnC0go
6161
.. _Transform Python Slides: https://speakerdeck.com/pyconslides/transforming-code-into-beautiful-idiomatic-python-by-raymond-hettinger-1
6262
.. _Stop Writing Classes: https://www.youtube.com/watch?v=o9pEzgHorH0
6363
.. _Refactoring Python: https://www.youtube.com/watch?v=D_6ybDcU5gc

doc/user_guide/features.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Nox
1313
---
1414

1515
The most central tool when interacting with the toolbox is :code:`nox`, which is the task runner used across all of Exasol's Python-based projects.
16-
The toolbox itself provides various standard tasks and a plugin mechanism to extend these tasks if needed. For more information regarding nox, please visit the `nox homepage <http://nox.thea.codes/en/stable/>`_.
16+
The toolbox itself provides various standard tasks and a plugin mechanism to extend these tasks if needed. For more information regarding nox, please visit the `nox homepage <https://nox.thea.codes/en/stable/>`_.
1717

1818
Central files in regards to nox and the toolbox are:
1919

exasol/toolbox/nox/_documentation.py

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,6 @@ def _build_multiversion_docs(session: nox.Session, config: Config) -> None:
5151
session.run("touch", f"{DOCS_OUTPUT_DIR}/.nojekyll")
5252

5353

54-
def _check_failed_links(results: list[str]):
55-
errors = []
56-
for line, result in enumerate(results):
57-
if result.startswith("{") and "}" in result:
58-
data = json.loads(result)
59-
if not (data["status"] == "working") or (data["status"] == "ignored"):
60-
match = re.search(r"https?://[^\s\"\'<>]+", data["uri"])
61-
if match:
62-
try:
63-
request = requests.get(match.group(), timeout=15)
64-
if request.status_code == 200:
65-
data["status"] = "working"
66-
data["code"] = request.status_code
67-
if request.history:
68-
data["info"] = (
69-
f'redirected: [{", ".join(step.url for step in request.history)}, {request.url}]'
70-
)
71-
results[line] = json.dumps(data)
72-
except requests.exceptions.Timeout:
73-
pass
74-
if (data["status"] == "broken") or data["status"] == "timeout":
75-
errors.append(result)
76-
return results, errors
77-
78-
7954
def _git_diff_changes_main() -> int:
8055
"""
8156
Check if doc/changes is changed and return the exit code of command git diff.
@@ -170,11 +145,7 @@ def docs_links_check(session: Session) -> None:
170145
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
171146
)
172147
parser.add_argument(
173-
"-o",
174-
"--output",
175-
type=Path,
176-
help="path to output file",
177-
default="",
148+
"-o", "--output", type=Path, help="path to output file", default=None
178149
)
179150
args = parser.parse_args(session.posargs)
180151
with tempfile.TemporaryDirectory() as path:
@@ -188,22 +159,22 @@ def docs_links_check(session: Session) -> None:
188159
tmpdir,
189160
],
190161
)
162+
print(sp.returncode)
191163
if sp.returncode >= 2:
192164
print(sp.stderr)
193165
session.error(2)
194-
output = tmpdir / "output.json"
195-
out = output.read_text().split("\n")
196-
results, errors = _check_failed_links(out)
197-
if hasattr(args, "output"):
198-
outputfile = Path(args.output) / "link-check-output.json"
199-
if not outputfile.exists():
200-
outputfile.parent.mkdir(parents=True, exist_ok=True)
201-
outputfile.touch()
202-
outputfile.write_text("\n".join(result for result in results))
203-
print(f"file generated at path: {outputfile.resolve()}")
204-
if errors:
205-
print("Error" + "s" if len(errors) > 1 else "")
206-
print("\n".join(error for error in errors))
166+
if args.output:
167+
print([hasattr(args, "output")])
168+
print("warum gehst du hir rein")
169+
result_json = tmpdir / "output.json"
170+
dst = Path(args.output) / "link-check-output.json"
171+
shutil.copyfile(result_json, dst)
172+
print(f"file generated at path: {result_json.resolve()}")
173+
result_txt = tmpdir / "output.txt"
174+
if sp.returncode == 1 or result_txt.read_text() != "":
175+
escape_rot = "\033[31m"
176+
print(escape_rot + "errors:")
177+
print(result_txt.read_text())
207178
session.error(1)
208179

209180

0 commit comments

Comments
 (0)