Skip to content

Commit 7adabdf

Browse files
committed
🧪 Add tox hint compatibility w/ Windows
1 parent a41b12f commit 7adabdf

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tox.ini

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ commands_post =
7373
{[python-cli-options]max-isolation} \
7474
{[python-cli-options]warnings-to-errors} \
7575
-c\
76-
'import pathlib, sys; \
76+
'import pathlib, shlex, sys; \
7777
cov_html_report_arg_prefix = "--cov-report=html:"; \
7878
cov_html_reports = [\
7979
arg[len(cov_html_report_arg_prefix):] for arg in sys.argv \
@@ -83,13 +83,16 @@ commands_post =
8383
cov_html_report_dir = pathlib.Path(cov_html_reports[-1]); \
8484
index_file = cov_html_report_dir / "index.html";\
8585
html_url = f"file://\{index_file\}";\
86+
browse_cmd = shlex.join(("python3", "-Im", "webbrowser", html_url)); \
87+
serve_cmd = shlex.join((\
88+
"python3", "-Im", "http.server", \
89+
"--directory", "cov_html_report_dir", "0", \
90+
)); \
8691
print(f"\nTo open the HTML coverage report, run\n\n\
87-
\tpython3 -Im webbrowser \
88-
\N\{QUOTATION MARK\}\{html_url !s\}\N\{QUOTATION MARK\}\n");\
92+
\t\{browse_cmd !s\}\n");\
8993
print(f"To serve \
9094
the HTML coverage report with a local web server, use\n\n\
91-
\tpython3 -Im http.server --directory \
92-
\N\{QUOTATION MARK\}\{cov_html_report_dir\}\N\{QUOTATION MARK\} 0\n")' \
95+
\t\{serve_cmd !s\}\n")' \
9396
{posargs:--cov-report=html:{envtmpdir}{/}htmlcov{/}}
9497
package = editable
9598
pass_env =

0 commit comments

Comments
 (0)