Skip to content

Commit

Permalink
Merge pull request #224 from chaen/setuptools
Browse files Browse the repository at this point in the history
Workaround for setuptools issue in autorest
  • Loading branch information
chrisburr authored Mar 14, 2024
2 parents f126d9f + 76dc46a commit 9969b06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,6 @@ jobs:
npm install -g autorest
- name: Run autorest
run: |
autorest --python --help
$HOME/.autorest/\@autorest_python\@*/node_modules/\@autorest/python/venv/bin/python -m pip install --upgrade setuptools
pytest --no-cov --regenerate-client diracx-client/tests/test_regenerate.py
13 changes: 12 additions & 1 deletion diracx-client/tests/test_regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# pytestmark = pytest.mark.enabled_dependencies(["ConfigSource", "AuthSettings"])


AUTOREST_VERSION = "6.13.7"


@pytest.fixture
def test_client(client_factory):
with client_factory.unauthenticated() as client:
Expand Down Expand Up @@ -53,8 +56,12 @@ def test_regenerate_client(test_client, tmp_path):
"--namespace=client",
f"--output-folder={output_folder}",
]

# This is required to be able to work offline
cmd += ["--use=@autorest/[email protected]"]
# TODO: if offline, find the version already installed
# and use it
# cmd += [f"--use=@autorest/python@{AUTOREST_VERSION}"]

subprocess.run(cmd, check=True)

cmd = ["pre-commit", "run", "--all-files"]
Expand All @@ -64,3 +71,7 @@ def test_regenerate_client(test_client, tmp_path):
subprocess.run(cmd, check=True, cwd=repo_root)
if repo.is_dirty(path=repo_root / "src" / "diracx" / "client"):
raise AssertionError("Client was regenerated with changes")


if __name__ == "__main__":
print(AUTOREST_VERSION)

0 comments on commit 9969b06

Please sign in to comment.