|
23 | 23 |
|
24 | 24 | logger = getLogger(__name__) |
25 | 25 |
|
| 26 | +#: Determine repository root directory |
| 27 | +root = Git.root(Path(__file__).parent) |
| 28 | + |
26 | 29 | #: CodeRegex matching the branches to build docs for |
27 | 30 | BRANCH_REGEX = r"^(master|dev)$" |
28 | 31 |
|
29 | 32 | #: Regex matching the tags to build docs for |
30 | 33 | TAG_REGEX = r"^v[\.0-9]*$" |
31 | 34 |
|
32 | 35 | #: Output dir relative to project root |
33 | | -OUTPUT_DIR = "docsrc/_build_polyversion" |
| 36 | +OUTPUT_DIR = "_build_polyversion" |
34 | 37 |
|
35 | 38 | #: Source directory |
36 | 39 | SOURCE_DIR = "docsrc" |
@@ -86,20 +89,6 @@ def root_data(driver): |
86 | 89 |
|
87 | 90 | # Load overrides read from commandline to global scope |
88 | 91 | apply_overrides(globals()) |
89 | | -# Determine repository root directory |
90 | | -root = Git.root(Path(__file__).parent) |
91 | | - |
92 | | - |
93 | | -async def selector(rev, keys): |
94 | | - """Select configuration based on revision""" |
95 | | - # map all v1 revisions to one configuration |
96 | | - if rev.name.startswith("v1."): |
97 | | - return "v1" |
98 | | - elif rev.name in ["master"]: |
99 | | - # special configuration for v1 master branch |
100 | | - return rev.name |
101 | | - # common config for everything else |
102 | | - return None |
103 | 92 |
|
104 | 93 |
|
105 | 94 | # adapted from Pip |
@@ -232,6 +221,19 @@ async def __call__(self, path: Path) -> None: |
232 | 221 |
|
233 | 222 | creator = LocalVenvCreator() |
234 | 223 |
|
| 224 | + |
| 225 | +async def selector(rev, keys): |
| 226 | + """Select configuration based on revision""" |
| 227 | + # map all v1 revisions to one configuration |
| 228 | + if rev.name.startswith("v1."): |
| 229 | + return "v1" |
| 230 | + elif rev.name in ["master"]: |
| 231 | + # special configuration for v1 master branch |
| 232 | + return rev.name |
| 233 | + # common config for everything else |
| 234 | + return None |
| 235 | + |
| 236 | + |
235 | 237 | ENVIRONMENT = { |
236 | 238 | # configuration for v2 and dev |
237 | 239 | None: DynamicPip.factory(venv=Path(".venv"), args=["-e", "."] + SPHINX_DEPS + V2_BACKEND_DEPS, creator=creator), |
|
0 commit comments