Skip to content

Commit bd9d137

Browse files
committed
Fix a few warnings during tests
Signed-off-by: Fabrice Normandin <[email protected]>
1 parent 6c7c38b commit bd9d137

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

project/algorithms/jax_ppo_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def debug_jit_warnings():
461461
# Temporarily make this particular warning into an error to help future-proof our jax code.
462462
import jax._src.deprecations
463463

464-
deprecations_to_trigger_error_for = ["tracer-hash"]
464+
deprecations_to_trigger_error_for = []
465465
values_before = {}
466466
for dep in deprecations_to_trigger_error_for:
467467
if val := jax._src.deprecations._registered_deprecations.get(dep):

tests/test_template.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import tomli
1414
import yaml
1515
from copier import Worker
16-
from copier.vcs import get_git
1716
from plumbum import local
1817

1918
import project
@@ -23,6 +22,23 @@
2322

2423
logger = getLogger(__name__)
2524

25+
26+
def get_git(context_dir: str | Path | None = None):
27+
"""Gets `git` command, or fails if it's not available."""
28+
29+
GIT_USER_NAME = "Copier"
30+
GIT_USER_EMAIL = "copier@copier"
31+
command = local["git"].with_env(
32+
GIT_AUTHOR_NAME=GIT_USER_NAME,
33+
GIT_AUTHOR_EMAIL=GIT_USER_EMAIL,
34+
GIT_COMMITTER_NAME=GIT_USER_NAME,
35+
GIT_COMMITTER_EMAIL=GIT_USER_EMAIL,
36+
)
37+
if context_dir:
38+
command = command["-C", context_dir]
39+
return command
40+
41+
2642
example_folder = Path(project.algorithms.__file__).parent
2743
examples: list[str] = [
2844
p.relative_to(example_folder).stem
@@ -399,7 +415,7 @@ def test_update_project(
399415

400416
with modification(project_root, copier_answers, template_version_used):
401417
# Need to commit changes for copier to accept to update.
402-
git = get_git().with_cwd(project_root)
418+
git = get_git(context_dir=project_root)
403419
# TODO: Double-check that these changes only affect the temporary cloned repo, not this
404420
# current dev repo.
405421
git("config", "commit.gpgsign", "false")

0 commit comments

Comments
 (0)