Skip to content

Commit

Permalink
fix(python): generator cli config uses .dict instead of .json (#4976)
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo authored Oct 21, 2024
1 parent 484c6b6 commit 8ce4747
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 107 deletions.
9 changes: 8 additions & 1 deletion generators/python/sdk/versions.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# For unreleased changes, use unreleased.yml
- version: 4.3.3
irVersion: 53
changelogEntry:
- type: fix
summary: |
The generator now writes the reference.md configuration correctly, using `.dict()` instead of `.json()`.
- version: 4.3.2
irVersion: 53
changelogEntry:
- type: fix
summary: |
The generator will now correctly default to the configured global `default_bytes_stream_chunk_size` when the `request_options` parameter is not provided.
- version: 4.3.1
irVersion: 53
changelogEntry:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import os
import subprocess
import tempfile
Expand Down Expand Up @@ -78,6 +79,9 @@ def generate_reference(self, snippets: generator_exec.Snippets, project: Project
reference_config = reference_config_builder.generate_reference_config()
if self._should_write_reference(reference_config):
reference_config_filepath = self._write_reference_config(reference_config=reference_config)
print(
f"running command: {' '.join([GENERATOR_CLI, 'generate-reference', '--config', reference_config_filepath])}"
)
return self._run_command(
command=[GENERATOR_CLI, "generate-reference", "--config", reference_config_filepath]
)
Expand Down Expand Up @@ -128,7 +132,7 @@ def _write_reference_config(
reference_config: generatorcli.reference.ReferenceConfig,
) -> str:
file = tempfile.NamedTemporaryFile(delete=False, mode="w+")
file.write(reference_config.json())
file.write(json.dumps(reference_config.dict()))
file.flush()
return file.name

Expand All @@ -144,7 +148,7 @@ def _write_readme_config(
github_installation_token=github_installation_token,
)
file = tempfile.NamedTemporaryFile(delete=False, mode="w+")
file.write(readme_config.json())
file.write(json.dumps(readme_config.dict()))
file.flush()
return file.name

Expand Down
104 changes: 0 additions & 104 deletions seed/python-sdk/grpc-proto/.mock/proto/google/api/field_behavior.proto

This file was deleted.

0 comments on commit 8ce4747

Please sign in to comment.