Skip to content

Commit a374382

Browse files
authored
Merge pull request #422 from chrisburr/client-regen-test
Fix test for if the client needs to be regenerated
2 parents 5054edd + 1a5ee77 commit a374382

File tree

18 files changed

+1724
-3361
lines changed

18 files changed

+1724
-3361
lines changed

diracx-client/tests/test_regenerate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def test_regenerate_client(test_client, tmp_path):
4444
assert (repo_root / "diracx-client" / "src").is_dir()
4545
assert (repo_root / ".git").is_dir()
4646
repo = git.Repo(repo_root)
47-
if repo.is_dirty(path=repo_root / "diracx-client" / "src" / "diracx" / "client"):
47+
client_src = repo_root / "diracx-client" / "src" / "diracx" / "client"
48+
if repo.is_dirty(path=client_src):
4849
raise AssertionError(
4950
"Client is currently in a modified state, skipping regeneration"
5051
)
@@ -70,7 +71,7 @@ def test_regenerate_client(test_client, tmp_path):
7071
subprocess.run(cmd, check=False, cwd=repo_root)
7172
print("Re-running pre-commit...")
7273
subprocess.run(cmd, check=True, cwd=repo_root)
73-
if repo.is_dirty(path=repo_root / "src" / "diracx" / "client"):
74+
if repo.is_dirty(path=client_src):
7475
raise AssertionError("Client was regenerated with changes")
7576

7677

extensions/gubbins/gubbins-client/src/gubbins/client/generated/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
3-
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.0, generator: @autorest/python@6.26.0)
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
44
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=wrong-import-position
67

7-
from ._client import Dirac
8+
from typing import TYPE_CHECKING
9+
10+
if TYPE_CHECKING:
11+
from ._patch import * # pylint: disable=unused-wildcard-import
12+
13+
from ._client import Dirac # type: ignore
814

915
try:
1016
from ._patch import __all__ as _patch_all
11-
from ._patch import * # pylint: disable=unused-wildcard-import
17+
from ._patch import *
1218
except ImportError:
1319
_patch_all = []
1420
from ._patch import patch_sdk as _patch_sdk

extensions/gubbins/gubbins-client/src/gubbins/client/generated/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
3-
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.0, generator: @autorest/python@6.26.0)
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
44
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
55
# --------------------------------------------------------------------------
66

extensions/gubbins/gubbins-client/src/gubbins/client/generated/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
3-
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.0, generator: @autorest/python@6.26.0)
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.4, generator: @autorest/python@6.31.0)
44
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
55
# --------------------------------------------------------------------------
66

0 commit comments

Comments
 (0)