Skip to content

Commit

Permalink
🧪 Add tox hint compatibility w/ Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Jan 8, 2025
1 parent a41b12f commit 7adabdf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ commands_post =
{[python-cli-options]max-isolation} \
{[python-cli-options]warnings-to-errors} \
-c\
'import pathlib, sys; \
'import pathlib, shlex, sys; \
cov_html_report_arg_prefix = "--cov-report=html:"; \
cov_html_reports = [\
arg[len(cov_html_report_arg_prefix):] for arg in sys.argv \
Expand All @@ -83,13 +83,16 @@ commands_post =
cov_html_report_dir = pathlib.Path(cov_html_reports[-1]); \
index_file = cov_html_report_dir / "index.html";\
html_url = f"file://\{index_file\}";\
browse_cmd = shlex.join(("python3", "-Im", "webbrowser", html_url)); \
serve_cmd = shlex.join((\
"python3", "-Im", "http.server", \
"--directory", "cov_html_report_dir", "0", \
)); \
print(f"\nTo open the HTML coverage report, run\n\n\
\tpython3 -Im webbrowser \
\N\{QUOTATION MARK\}\{html_url !s\}\N\{QUOTATION MARK\}\n");\
\t\{browse_cmd !s\}\n");\
print(f"To serve \
the HTML coverage report with a local web server, use\n\n\
\tpython3 -Im http.server --directory \
\N\{QUOTATION MARK\}\{cov_html_report_dir\}\N\{QUOTATION MARK\} 0\n")' \
\t\{serve_cmd !s\}\n")' \
{posargs:--cov-report=html:{envtmpdir}{/}htmlcov{/}}
package = editable
pass_env =
Expand Down

0 comments on commit 7adabdf

Please sign in to comment.