|
31 | 31 | root = Git.root(Path(__file__).parent) |
32 | 32 |
|
33 | 33 | #: CodeRegex matching the branches to build docs for |
34 | | -BRANCH_REGEX = r"^(master|dev)$" |
35 | | -# BRANCH_REGEX = r"^(master)$" |
| 34 | +# BRANCH_REGEX = r"^(master|dev)$" |
| 35 | +BRANCH_REGEX = r"^(dev)$" |
36 | 36 |
|
37 | 37 | #: Regex matching the tags to build docs for |
38 | | -TAG_REGEX = r"^v(1\.1\.6|(?!1\.)[\.0-9]*)$" |
39 | | -# TAG_REGEX = r"^(v1.1.6)$" |
| 38 | +# TAG_REGEX = r"^v(1\.1\.6|(?!1\.)[\.0-9]*)$" |
| 39 | +TAG_REGEX = r"" |
40 | 40 |
|
41 | 41 | #: Output dir relative to project root |
42 | 42 | OUTPUT_DIR = "_build_polyversion" |
|
66 | 66 | #: Extra dependencies to install for version 2 |
67 | 67 | V2_BACKEND_DEPS = [ |
68 | 68 | "jax", |
69 | | - "torch", |
70 | | - "tensorflow", |
| 69 | + # "torch", |
| 70 | + # "tensorflow", |
71 | 71 | ] |
72 | 72 |
|
73 | 73 | VENV_DIR_NAME = ".bf_doc_gen_venv" |
@@ -170,6 +170,8 @@ def __init__( |
170 | 170 | # the .git directory, which is not copied for the build. |
171 | 171 | logger.info("Setting setuptools version 'SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BAYESFLOW=" + name[1:] + "'") |
172 | 172 | self.env_vars["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BAYESFLOW"] = name[1:] |
| 173 | + else: |
| 174 | + self.env_vars["KERAS_BACKEND"] = "jax" |
173 | 175 |
|
174 | 176 | super().__init__(path, name, Path(venv) / name, creator=creator) |
175 | 177 |
|
@@ -210,6 +212,31 @@ async def __aenter__(self): |
210 | 212 | raise BuildError from CalledProcessError(cast(int, process.returncode), " ".join(cmd), out, err) |
211 | 213 | return self |
212 | 214 |
|
| 215 | + def activate(self, env: dict[str, str]) -> dict[str, str]: |
| 216 | + """ |
| 217 | + Activate a python venv in a dictionary of environment variables. |
| 218 | +
|
| 219 | + .. warning:: This modifies the given dictionary in-place. |
| 220 | +
|
| 221 | + Parameters |
| 222 | + ---------- |
| 223 | + env : dict[str, str] |
| 224 | + The environment variable mapping to update. |
| 225 | +
|
| 226 | + Returns |
| 227 | + ------- |
| 228 | + dict[str, str] |
| 229 | + The dictionary that was passed with `env`. |
| 230 | +
|
| 231 | + """ |
| 232 | + env["VIRTUAL_ENV"] = str(self.venv) |
| 233 | + env["PATH"] = str(self.venv / "bin") + ":" + env["PATH"] |
| 234 | + |
| 235 | + # add environment variables to environment |
| 236 | + for key, value in self.env_vars.items(): |
| 237 | + env[key] = value |
| 238 | + return env |
| 239 | + |
213 | 240 |
|
214 | 241 | # for some reason, VenvWrapper did not work for me (probably something specific |
215 | 242 | # to my system, so we use subprocess.call directly to use the system utilities |
|
0 commit comments