File tree Expand file tree Collapse file tree 5 files changed +18
-2
lines changed
commands/export/html/precompiled_jinja_templates/01_basic Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,14 @@ def __init__(
111111 # Settings obtained from the strictdoc.toml config file.
112112 self .project_title : str = project_title
113113 self .dir_for_sdoc_assets : str = dir_for_sdoc_assets
114+
115+ if env_cache_dir := os .environ .get ("STRICTDOC_CACHE_DIR" ):
116+ # The only use case for STRICTDOC_CACHE_DIR is to make the cache
117+ # local to an itest folder.
118+ assert env_cache_dir == "Output/cache" , env_cache_dir
119+ dir_for_sdoc_cache = env_cache_dir
114120 self .dir_for_sdoc_cache : str = dir_for_sdoc_cache
121+
115122 self .project_features : List [str ] = project_features
116123 self .server_host : str = server_host
117124 self .server_port : int = server_port
Original file line number Diff line number Diff line change 55import re
66import sys
77from enum import Enum
8- from typing import Optional
8+ from typing import Optional , Dict
99
1010if not hasattr (inspect , "getargspec" ):
1111 inspect .getargspec = inspect .getfullargspec
@@ -58,17 +58,21 @@ def run_invoke_with_tox(
5858 context ,
5959 environment_type : ToxEnvironment ,
6060 command : str ,
61+ environment : Optional [Dict ] = None ,
6162) -> invoke .runners .Result :
6263 assert isinstance (environment_type , ToxEnvironment )
6364 assert isinstance (command , str )
65+
6466 tox_py_version = f"py{ sys .version_info .major } { sys .version_info .minor } "
67+
6568 return run_invoke (
6669 context ,
6770 f"""
6871 tox
6972 -e { tox_py_version } -{ environment_type .value } --
7073 { command }
7174 """ ,
75+ environment = environment ,
7276 )
7377
7478
@@ -369,6 +373,7 @@ def test_integration(
369373 context ,
370374 environment ,
371375 itest_command ,
376+ environment = {"STRICTDOC_CACHE_DIR" : "Output/cache" },
372377 )
373378
374379
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ RUN: %strictdoc export %S --output-dir Output | filecheck %s --dump-input=fail
66CHECK: Compile Jinja templates {{.*}}s
77CHECK: Published: Hello world doc
88
9- RUN: rm -rf Output/
9+ RUN: rm -rf Output/html
1010
1111RUN: %strictdoc export %S --output-dir Output | filecheck %s --dump-input=fail --check-prefix=CHECK-SECOND
1212CHECK-SECOND-NOT: Compile Jinja templates {{.*}}s
Original file line number Diff line number Diff line change @@ -47,3 +47,6 @@ if "TEST_HTML2PDF" in lit_config.params:
4747 chromedriver = lit_config.params[' CHROMEDRIVER' ]
4848 config.substitutions.append((' %chromedriver' , chromedriver))
4949 config.available_features.add(' SYSTEM_CHROMEDRIVER' )
50+
51+ if (env_cache_dir := os.getenv(' STRICTDOC_CACHE_DIR' , None)) is not None:
52+ config.environment[' STRICTDOC_CACHE_DIR' ] = env_cache_dir
Original file line number Diff line number Diff line change 2929 -rrequirements.check.txt
3030pass_env =
3131 CHROMEWEBDRIVER
32+ STRICTDOC_CACHE_DIR
3233commands =
3334 python developer/pip_install_strictdoc_deps.py
3435 {posargs}
You can’t perform that action at this time.
0 commit comments