Skip to content

Commit 4ade79b

Browse files
Remove post processing step from tox generate environment (Azure#39758)
* remove post-processing step and clean up pyproject.toml references for it --------- Co-authored-by: catalinaperalta <[email protected]>
1 parent b27efc9 commit 4ade79b

File tree

8 files changed

+2
-39
lines changed

8 files changed

+2
-39
lines changed

sdk/ai/azure-ai-inference/pyproject.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
[tool.azure-sdk-build]
22
pyright = false
33

4-
[tool.generate]
5-
autorest-post-process = true
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
[tool.generate]
2-
autorest-post-process = true
31
[tool.azure-sdk-build]
42
verifytypes = false

sdk/monitor/azure-monitor-ingestion/pyproject.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[tool.azure-sdk-build]
22
pyright = false
33

4-
[tool.generate]
5-
autorest-post-process = true
4+

sdk/translation/azure-ai-translation-text/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ type_check_samples = true
44
verifytypes = true
55
pyright = true
66

7-
[tool.generate]
8-
autorest-post-process = true
7+

sdk/vision/azure-ai-vision-imageanalysis/pyproject.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

tools/azure-sdk-tools/packaging_tools/generate_client.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,6 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
CONF_NAME = "pyproject.toml"
11-
12-
def check_post_process(folder: Path) -> bool:
13-
conf_path = folder / CONF_NAME
14-
if not conf_path.exists():
15-
return False
16-
17-
with open(conf_path, "rb") as fd:
18-
toml_dict = tomli.load(fd)
19-
if toml_dict.get("tool", None) is not None:
20-
if toml_dict["tool"].get("generate", None) is not None:
21-
if toml_dict["tool"]["generate"].get("autorest-post-process", None) is not None:
22-
return toml_dict["tool"]["generate"]["autorest-post-process"]
23-
return False
24-
25-
def run_post_process(folder: Path) -> None:
26-
completed_process = run(f"autorest --postprocess --output-folder={folder} --perform-load=false --python", cwd=folder, shell=True)
27-
28-
if completed_process.returncode != 0:
29-
raise ValueError("Something happened during autorest post processing: " + str(completed_process))
30-
_LOGGER.info("Autorest post processing done")
31-
3210
def generate_autorest(folder: Path) -> None:
3311

3412
readme_path = folder / "swagger" / "README.md"
@@ -68,9 +46,6 @@ def generate(folder: Path = Path(".")) -> None:
6846
else:
6947
raise ValueError("Didn't find swagger/README.md nor tsp_location.yaml")
7048

71-
if check_post_process(folder):
72-
run_post_process(folder)
73-
7449
def generate_main() -> None:
7550
"""Main method"""
7651

0 commit comments

Comments
 (0)