Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1a2d557
spelling: ; otherwise,
jsoref Oct 19, 2025
4a9f25f
spelling: account
jsoref Oct 20, 2025
0bb4de2
spelling: also need to
jsoref Oct 19, 2025
6c4ff59
spelling: an
jsoref Oct 19, 2025
c5354cd
spelling: anymore
jsoref Oct 19, 2025
e60e88f
spelling: argument
jsoref Oct 20, 2025
959c102
spelling: assessor
jsoref Oct 20, 2025
8f1c03d
spelling: authentication
jsoref Oct 20, 2025
6ce47be
spelling: big-endian
jsoref Oct 19, 2025
824b01c
spelling: cannot
jsoref Oct 19, 2025
e154234
spelling: current
jsoref Oct 20, 2025
af10fbc
spelling: destination
jsoref Oct 20, 2025
5e603d4
spelling: diversity
jsoref Oct 20, 2025
88c0701
spelling: fall back
jsoref Oct 19, 2025
c47cfc2
spelling: field
jsoref Oct 19, 2025
c45291e
spelling: for example,
jsoref Oct 19, 2025
7741568
spelling: github
jsoref Oct 19, 2025
ce6ae3a
spelling: include
jsoref Oct 20, 2025
9ca70c7
spelling: metadata
jsoref Oct 20, 2025
6ae9422
spelling: nonexistent
jsoref Oct 19, 2025
fc67134
spelling: obsolete
jsoref Oct 20, 2025
c55ab93
spelling: of a library
jsoref Oct 19, 2025
fab3de3
spelling: organization
jsoref Oct 20, 2025
6517fc2
spelling: partitioned
jsoref Oct 20, 2025
75a64b0
spelling: please refer
jsoref Oct 19, 2025
8118615
spelling: posix
jsoref Oct 21, 2025
bb1b55d
spelling: privileged
jsoref Oct 20, 2025
42ef62c
spelling: privileges
jsoref Oct 20, 2025
a29e0ac
spelling: process
jsoref Oct 21, 2025
628e8f3
spelling: programmatically
jsoref Oct 21, 2025
1220f59
spelling: reference
jsoref Oct 21, 2025
97e7f46
spelling: relationship
jsoref Oct 21, 2025
961b814
spelling: separate
jsoref Oct 21, 2025
594f880
spelling: source row of a finding
jsoref Oct 19, 2025
3ecfd93
spelling: that
jsoref Oct 19, 2025
6fb0cbb
spelling: the findings, the
jsoref Oct 19, 2025
ca7cdb3
spelling: the
jsoref Oct 19, 2025
6501cc3
spelling: to
jsoref Oct 19, 2025
4112798
spelling: upgrading
jsoref Oct 21, 2025
e5dada9
spelling: variable
jsoref Oct 21, 2025
49649d8
spelling: whether or not
jsoref Oct 19, 2025
e6ff1e1
spelling: writes the result of ... to the destination
jsoref Oct 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
- Prefer https URLs for cloning from GitHub, add SYNTHTOOL_USE_SSH to use ssh ([#120](https://github.com/googleapis/synthtool/pull/120))
- Drop the PR template for nodejs ([#117](https://github.com/googleapis/synthtool/pull/117))
- Update github issue templates ([#116](https://github.com/googleapis/synthtool/pull/116))
- Incude build/ in eslint ignore ([#115](https://github.com/googleapis/synthtool/pull/115))
- Include build/ in eslint ignore ([#115](https://github.com/googleapis/synthtool/pull/115))
- feat: make npm link work for system tests ([#114](https://github.com/googleapis/synthtool/pull/114))
- fix: update nodejs issue templates ([#112](https://github.com/googleapis/synthtool/pull/112))
- feat(node): add node11 test env ([#110](https://github.com/googleapis/synthtool/pull/110))
Expand Down Expand Up @@ -437,7 +437,7 @@
### New Features

- add template for .circleci config for node libraries (#6, #7, #17)
- Warn when copy/move/replace can not find any sources (#4)
- Warn when copy/move/replace cannot find any sources (#4)
- Add warning for non-replacement
- Add an update checker.
- added get_workflow_name.py (#15)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
'Operating System :: OS Independent',
'Topic :: Internet',
],
platforms='Posix; MacOS X; Windows',
platforms='POSIX; MacOS X; Windows',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the canonical and correct spelling: https://pypi.org/search/?c=Operating+System+%3A%3A+POSIX

Note that MacOS X is wrong, but it's messed up in PyPI, so I'm not proposing "fixing" it.

packages=packages,
install_requires=dependencies,
include_package_data=True,
Expand Down
2 changes: 1 addition & 1 deletion synthtool/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SynthTool (for client libraries)

![Diagram of relationship between Autosynth, Synthtool, and Github](../images/flow.png)
![Diagram of relationship between Autosynth, Synthtool, and GitHub](../images/flow.png)

This tool helps to generate and layout cloud client libraries. Synthtool runs the [GAPIC (Generated API Client) Generator][GAPIC] via [Google API Artifact Manager (artman)][artman].

Expand Down
8 changes: 4 additions & 4 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def py_library(self, **kwargs) -> Path:

# Add kwargs to signal that UPGRADING.md should be included in docs/index.rst if it exists
if Path("docs/UPGRADING.md").exists() or Path("docs/UPGRADING.rst").exists():
kwargs["include_uprading_doc"] = True
kwargs["include_upgrading_doc"] = True

# If the directory `google/cloud` exists, add kwargs to signal that the client library is for a Cloud API
if Path("google/cloud").exists():
Expand Down Expand Up @@ -439,7 +439,7 @@ def detect_versions(
default_first: Optional[bool] = None,
) -> List[str]:
"""
Detects the versions a library has, based on distinct folders
Detects the versions of a library, based on distinct folders
within path. This is based on the fact that our GAPIC libraries are
structured as follows:

Expand Down Expand Up @@ -531,7 +531,7 @@ def _load_repo_metadata(
* `api_id` - The API ID associated with the service. Fully qualified identifier use to
enable a service in the cloud platform (e.g. monitoring.googleapis.com)
* `requires_billing` - Whether or not the API requires billing to be configured on the
customer's acocunt
customer's account

Args:
metadata_file (str, optional): Path to the metadata json file
Expand All @@ -555,7 +555,7 @@ def _get_default_branch_name(repository_name: str) -> str:
First checks environment variable DEFAULT_BRANCH_PATH. If found, it
reads the contents of the file at DEFAULT_BRANCH_PATH and returns it.

Then checks environment varabile DEFAULT_BRANCH, and returns it if found.
Then checks environment variable DEFAULT_BRANCH, and returns it if found.
"""
default_branch_path = os.getenv("DEFAULT_BRANCH_PATH")
if default_branch_path:
Expand Down
2 changes: 1 addition & 1 deletion synthtool/gcp/gapic_microgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _generate_code(
sep = os.path.sep

# try to figure out user ID and stay compatible.
# If there is no `os.getuid()`, fallback to `getpass.getuser()`
# If there is no `os.getuid()`, fall back to `getpass.getuser()`
getuid = getattr(os, "getuid", None)
if getuid:
user = str(getuid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ body:
- type: input
attributes:
label: >
Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal
Link to the code that reproduces this issue. A link to a **public** GitHub Repository or gist with a minimal
reproduction.
description: >
**Skipping this or providing an invalid link will result in the issue being closed**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
attributes:
value: >
Please use this issue type to log documentation requests against the library itself.
These requests should involve documentation on Github (`.md` files), and should relate to the library
These requests should involve documentation on GitHub (`.md` files), and should relate to the library
itself. If you have questions or documentation requests for an API, please
reach out to the API tracker itself.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

N/A

### Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal reproduction.
### Link to the code that reproduces this issue. A link to a **public** GitHub Repository or gist with a minimal reproduction.

not-a-link

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

N/A

### Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal reproduction.
### Link to the code that reproduces this issue. A link to a **public** GitHub Repository or gist with a minimal reproduction.

https://gist.github.com/orgads/13cbf44c91923da27d8772b5f10489c9

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or
at addChunk (node:internal/streams/readable:559:12) {
code: 'ERR_INVALID_ARG_TYPE'

### Link to the code that reproduces this issue. A link to a **public** Github Repository with a minimal reproduction.
### Link to the code that reproduces this issue. A link to a **public** GitHub Repository with a minimal reproduction.


https://gist.github.com/orgads/13cbf44c91923da27d8772b5f10489c9
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ env | grep KOKORO
# `virtualenv==20.26.6` is added for Python 3.7 compatibility
python3.9 -m pip install --upgrade --quiet nox virtualenv==20.26.6

# Use secrets acessor service account to get secrets
# Use secrets assessor service account to get secrets
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
gcloud auth activate-service-account \
--key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ TRAMPOLINE_WORKSPACE="${TRAMPOLINE_WORKSPACE:-/workspace}"

pass_down_envvars=(
# TRAMPOLINE_V2 variables.
# Tells scripts whether they are running as part of CI or not.
# Tells scripts whether or not they are running as part of CI.
"RUNNING_IN_CI"
# Indicates which CI system we're in.
"TRAMPOLINE_CI"
Expand Down Expand Up @@ -238,7 +238,7 @@ function repo_root() {
}

# Detect the project root. In CI builds, we assume the script is in
# the git tree and traverse from there, otherwise, traverse from `pwd`
# the git tree and traverse from there; otherwise, traverse from `pwd`
# to find `.git` directory.
if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then
PROGRAM_PATH="$(realpath "$0")"
Expand Down Expand Up @@ -391,7 +391,7 @@ docker_flags=(
# Use the host network.
"--network=host"

# Run in priviledged mode. We are not using docker for sandboxing or
# Run in privileged mode. We are not using docker for sandboxing or
# isolation, just for packaging our dev tools.
"--privileged"

Expand Down Expand Up @@ -441,7 +441,7 @@ do
done

# If arguments are given, all arguments will become the commands run
# in the container, otherwise run TRAMPOLINE_BUILD_FILE.
# in the container; otherwise, run TRAMPOLINE_BUILD_FILE.
if [[ $# -ge 1 ]]; then
log_yellow "Running the given commands '" "${@:1}" "' in the container."
readonly commands=("${@:1}")
Expand Down
2 changes: 1 addition & 1 deletion synthtool/gcp/templates/python_library/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Logging details
logger from the `google`-level logger. If you need the events to be propagated to the root logger, you must explicitly set
:code:`logging.getLogger("google").propagate = True` in your code.
#. You can mix the different logging configurations above for different Google modules. For example, you may want use a code-based logging configuration for
one library, but decide you need to also set up environment-based logging configuration for another library.
one library, but decide you also need to set up environment-based logging configuration for another library.

#. If you attempt to use both code-based and environment-based configuration for the same module, the environment-based configuration will be ineffectual
if the code -based configuration gets applied first.
Expand Down
2 changes: 1 addition & 1 deletion synthtool/gcp/templates/python_library/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ API Reference
{{ version }}/services_
{{ version }}/types_
{% endfor %}
{% if include_uprading_doc %}
{% if include_upgrading_doc %}
Migration Guide
---------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Logging details
logger from the `google`-level logger. If you need the events to be propagated to the root logger, you must explicitly set
:code:`logging.getLogger("google").propagate = True` in your code.
#. You can mix the different logging configurations above for different Google modules. For example, you may want use a code-based logging configuration for
one library, but decide you need to also set up environment-based logging configuration for another library.
one library, but decide you also need to set up environment-based logging configuration for another library.

#. If you attempt to use both code-based and environment-based configuration for the same module, the environment-based configuration will be ineffectual
if the code -based configuration gets applied first.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ API Reference
{{ version }}/services_
{{ version }}/types_
{% endfor %}
{% if include_uprading_doc %}
{% if include_upgrading_doc %}
Migration Guide
---------------

Expand Down
4 changes: 2 additions & 2 deletions synthtool/gcp/templates/python_samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Python Samples for {{ metadata['repo']['name_pretty'] }}

This directory contains samples for {{ metadata['repo']['name_pretty'] }}, which may be used as a refererence for how to use this product. {% if metadata['repo']['custom_content'] is defined %}
This directory contains samples for {{ metadata['repo']['name_pretty'] }}, which may be used as a reference for how to use this product. {% if metadata['repo']['custom_content'] is defined %}
{{ metadata['repo']['custom_content']}}{% endif %}{% if metadata['repo']['samples']|length %}
Samples, quickstarts, and other documentation are available at <a href="{{ metadata['repo']['product_documentation'] }}">cloud.google.com</a>.
{% for sample in range(metadata['repo']['samples']|length) %}
Expand All @@ -18,7 +18,7 @@ Samples, quickstarts, and other documentation are available at <a href="{{ metad

To run this sample:

1. If this is your first time working with GCP products, you will need to set up [the Cloud SDK][cloud_sdk] or utilize [Google Cloud Shell][gcloud_shell]. This sample may [require authetication][authentication]{% if metadata['repo']['requires_billing'] %} and you will need to [enable billing][enable_billing]{% endif %}.
1. If this is your first time working with GCP products, you will need to set up [the Cloud SDK][cloud_sdk] or utilize [Google Cloud Shell][gcloud_shell]. This sample may [require authentication][authentication]{% if metadata['repo']['requires_billing'] %} and you will need to [enable billing][enable_billing]{% endif %}.

1. Make a fork of this repo and clone the branch locally, then navigate to the sample directory you want to use.

Expand Down
2 changes: 1 addition & 1 deletion synthtool/languages/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def template_metadata() -> Dict[str, Any]:
Returns:
Dictionary of metadata. Includes the entire parsed contents of the package.json file if
present. Other expected fields:
* quickstart (str): Contents of the quickstart snippet if available, otherwise, ""
* quickstart (str): Contents of the quickstart snippet if available; otherwise, ""
* samples (List[Dict[str, str]]): List of available samples. See synthtool.gcp.samples.all_samples()
"""
metadata = {}
Expand Down
4 changes: 2 additions & 2 deletions synthtool/languages/node_mono_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def template_metadata(relative_dir: str) -> Dict[str, Any]:
Returns:
Dictionary of metadata. Includes the entire parsed contents of the package.json file if
present. Other expected fields:
* quickstart (str): Contents of the quickstart snippet if available, otherwise, ""
* quickstart (str): Contents of the quickstart snippet if available; otherwise, ""
* samples (List[Dict[str, str]]): List of available samples. See synthtool.gcp.samples.all_samples()
"""
metadata = {}
Expand Down Expand Up @@ -404,7 +404,7 @@ def walk_through_owlbot_dirs(dir: Path, search_for_changed_files: bool):
if search_for_changed_files:
try:
# Need to run this step first in the post processor since we only clone
# the branch the PR is on in the Docker container
# the branch that the PR is on in the Docker container
output = subprocess.run(
["git", "fetch", "origin", "main:main", "--deepen=200"]
)
Expand Down
2 changes: 1 addition & 1 deletion synthtool/languages/python_mono_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def apply_client_specific_post_processing(
- replacement:
paths: [<List of monorepo file paths beginning with "packages/" where the replacement should occur>]
before: "The string to search for in the specified paths"
after: "The string to replace in the the specified paths",
after: "The string to replace in the specified paths",
count: <integer indicating number of replacements that should have occurred across all files after the script is run>
```

Expand Down
2 changes: 1 addition & 1 deletion synthtool/protos/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Synthtool and Autosynth Protocol

**Synthtool** generates client library source code according to the currrent
**Synthtool** generates client library source code according to the current
state of the source repo, and upstream repos like
[googleapis/googleapis](https://github.com/googleapis/googleapis).

Expand Down
2 changes: 1 addition & 1 deletion synthtool/py_templating_instructions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Each sample in `samples` has the attributes:
- `file` : The main file associated with this sample
- `runnable` (Optional) : Either True/False, depending on whether this sample is made to be run by running the above file name, or not.
- `custom_content` (Optional) : This is custom content that appears after all other information generated about the sample
- `override_path` (Optional): If you would like to have a seperate README generate for this file in a different folder within the directory that holds the samples, ex. a folder named `quickstart`, specify that relative path here.
- `override_path` (Optional): If you would like to have a separate README generate for this file in a different folder within the directory that holds the samples, ex. a folder named `quickstart`, specify that relative path here.
If multiple samples have the same override path, the README in that folder will contain info for all those samples.
2 changes: 1 addition & 1 deletion synthtool/sources/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def clone(
"""Clones a remote git repo.

Will not actually clone the repo if it's already local via two ways:
1. It's in the cache (the default destitination).
1. It's in the cache (the default destination).
2. It was supplied via the preconfig file.

Arguments:
Expand Down
8 changes: 4 additions & 4 deletions synthtool/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def _merge_file(
source_path: Path, dest_path: Path, merge: Callable[[str, str, Path], str]
):
"""
Writes to the destination the result of merging the source with the
existing destination contents, using the given merge function.
Writes the result of merging the source with the existing destination
contents using the given merge function to the destination.

The merge function must take three arguments: the source contents, the
old destination contents, and a Path to the file to be written.
Expand Down Expand Up @@ -159,11 +159,11 @@ def dont_overwrite(
files.
"""

def merge(source_text: str, destinaton_text: str, file_path: Path) -> str:
def merge(source_text: str, destination_text: str, file_path: Path) -> str:
for pattern in patterns:
if file_path.match(str(pattern)):
logger.debug(f"Preserving existing contents of {file_path}.")
return destinaton_text
return destination_text
return source_text

return merge
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading