Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a8d54db
chore: onboard to librarian
ohmayr Nov 5, 2025
a8f9ffa
add setup file
ohmayr Nov 5, 2025
13e81f6
update blacken
ohmayr Nov 5, 2025
6492d28
revert system test version to 3.12
ohmayr Nov 5, 2025
a21d945
wip
ohmayr Nov 6, 2025
bf9caac
wip
ohmayr Nov 6, 2025
9324cda
wip
ohmayr Nov 6, 2025
dadc205
wip
ohmayr Nov 6, 2025
3827348
wip
ohmayr Nov 6, 2025
2262492
wip
ohmayr Nov 6, 2025
110d72c
wip
ohmayr Nov 6, 2025
a8e0f0d
wip
ohmayr Nov 6, 2025
0739b8e
wip
ohmayr Nov 7, 2025
fa3971b
wip
ohmayr Nov 7, 2025
48d37dd
wip
ohmayr Nov 7, 2025
79dd6dc
wip
ohmayr Nov 7, 2025
4c459ac
wip
ohmayr Nov 7, 2025
37dff4c
wip
ohmayr Nov 7, 2025
de360ee
wip
ohmayr Nov 7, 2025
59b7138
wip
ohmayr Nov 7, 2025
0f74181
wip
ohmayr Nov 7, 2025
03c5f47
wip
ohmayr Nov 7, 2025
98003fb
wip
ohmayr Nov 7, 2025
3341cfb
wip
ohmayr Nov 8, 2025
8caed48
wip
ohmayr Nov 8, 2025
c9d8e40
update sha
ohmayr Nov 10, 2025
c957278
update sha
ohmayr Nov 10, 2025
6ff03e8
wip
ohmayr Nov 10, 2025
6cd13c0
wip
ohmayr Nov 10, 2025
9a6788c
wip
ohmayr Nov 10, 2025
4406529
wip
ohmayr Nov 11, 2025
2bcf275
wip
ohmayr Nov 11, 2025
77c5cf4
wip
ohmayr Nov 11, 2025
6961967
wip
ohmayr Nov 11, 2025
872a5dd
generated changes
ohmayr Nov 11, 2025
8d7d982
update sha
ohmayr Nov 11, 2025
7d3fe8d
remove files
ohmayr Nov 11, 2025
9ed7010
update python version for lint
ohmayr Nov 12, 2025
7233ab1
revert setup file to main
ohmayr Nov 14, 2025
3d449e6
reorder apis
ohmayr Nov 17, 2025
1bac37d
fix docs
ohmayr Nov 17, 2025
59e266a
address failure
ohmayr Nov 18, 2025
de8fb83
rename owlbot.py to librarian.py
ohmayr Nov 18, 2025
338d861
rename file
ohmayr Nov 18, 2025
fbfcedf
remove librarian
ohmayr Nov 19, 2025
da83d8f
update sha
ohmayr Nov 19, 2025
35e316e
remove config.yaml
ohmayr Nov 19, 2025
dd132a6
update changes
ohmayr Nov 19, 2025
07165db
minor fixes via generation
ohmayr Nov 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
17 changes: 0 additions & 17 deletions .github/.OwlBot.lock.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/.OwlBot.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/auto-approve.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/release-please.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/release-trigger.yml

This file was deleted.

Empty file removed .github/snippet-bot.yml
Empty file.
15 changes: 0 additions & 15 deletions .github/sync-repo-settings.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.13
python-version: 3.14
- name: Install nox
run: python -m pip install nox
- name: Check formatting
Expand Down
18 changes: 18 additions & 0 deletions .librarian/generator-input/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "spanner",
"name_pretty": "Cloud Spanner",
"product_documentation": "https://cloud.google.com/spanner/docs/",
"client_documentation": "https://cloud.google.com/python/docs/reference/spanner/latest",
"issue_tracker": "https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open",
"release_level": "stable",
"language": "python",
"library_type": "GAPIC_COMBO",
"repo": "googleapis/python-spanner",
"distribution_name": "google-cloud-spanner",
"api_id": "spanner.googleapis.com",
"requires_billing": true,
"default_version": "v1",
"codeowner_team": "@googleapis/spanner-client-libraries-python",
"api_shortname": "spanner",
"api_description": "is a fully managed, mission-critical, \nrelational database service that offers transactional consistency at global scale, \nschemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication \nfor high availability.\n\nBe sure to activate the Cloud Spanner API on the Developer's Console to\nuse Cloud Spanner from your project."
}
106 changes: 14 additions & 92 deletions owlbot.py → .librarian/generator-input/librarian.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,58 +25,9 @@

common = gcp.CommonTemplates()


def get_staging_dirs(
# This is a customized version of the s.get_staging_dirs() function
# from synthtool to # cater for copying 3 different folders from
# googleapis-gen:
# spanner, spanner/admin/instance and spanner/admin/database.
# Source:
# https://github.com/googleapis/synthtool/blob/master/synthtool/transforms.py#L280
default_version: Optional[str] = None,
sub_directory: Optional[str] = None,
) -> List[Path]:
"""Returns the list of directories, one per version, copied from
https://github.com/googleapis/googleapis-gen. Will return in lexical sorting
order with the exception of the default_version which will be last (if specified).

Args:
default_version (str): the default version of the API. The directory for this version
will be the last item in the returned list if specified.
sub_directory (str): if a `sub_directory` is provided, only the directories within the
specified `sub_directory` will be returned.

Returns: the empty list if no file were copied.
"""

staging = Path("owl-bot-staging")

if sub_directory:
staging /= sub_directory

if staging.is_dir():
# Collect the subdirectories of the staging directory.
versions = [v.name for v in staging.iterdir() if v.is_dir()]
# Reorder the versions so the default version always comes last.
versions = [v for v in versions if v != default_version]
versions.sort()
if default_version is not None:
versions += [default_version]
dirs = [staging / v for v in versions]
for dir in dirs:
s._tracked_paths.add(dir)
return dirs
else:
return []


spanner_default_version = "v1"
spanner_admin_instance_default_version = "v1"
spanner_admin_database_default_version = "v1"

clean_up_generated_samples = True

for library in get_staging_dirs(spanner_default_version, "spanner"):
for library in s.get_staging_dirs("v1"):
if clean_up_generated_samples:
shutil.rmtree("samples/generated_samples", ignore_errors=True)
clean_up_generated_samples = False
Expand Down Expand Up @@ -202,22 +153,6 @@ def get_staging_dirs(
if count < 1:
raise Exception("Expected replacements for gRPC channel options not made.")

s.move(
library,
excludes=[
"google/cloud/spanner/**",
"*.*",
"noxfile.py",
"docs/index.rst",
"google/cloud/spanner_v1/__init__.py",
"**/gapic_version.py",
"testing/constraints-3.7.txt",
],
)

for library in get_staging_dirs(
spanner_admin_instance_default_version, "spanner_admin_instance"
):
count = s.replace(
[
library / "google/cloud/spanner_admin_instance_v1/services/*/transports/grpc*",
Expand All @@ -233,14 +168,7 @@ def get_staging_dirs(
)
if count < 1:
raise Exception("Expected replacements for gRPC channel options not made.")
s.move(
library,
excludes=["google/cloud/spanner_admin_instance/**", "*.*", "docs/index.rst", "noxfile.py", "**/gapic_version.py", "testing/constraints-3.7.txt",],
)

for library in get_staging_dirs(
spanner_admin_database_default_version, "spanner_admin_database"
):
count = s.replace(
[
library / "google/cloud/spanner_admin_database_v1/services/*/transports/grpc*",
Expand All @@ -258,7 +186,16 @@ def get_staging_dirs(
raise Exception("Expected replacements for gRPC channel options not made.")
s.move(
library,
excludes=["google/cloud/spanner_admin_database/**", "*.*", "docs/index.rst", "noxfile.py", "**/gapic_version.py", "testing/constraints-3.7.txt",],
excludes=[
"google/cloud/spanner/**",
"*.*",
"noxfile.py",
"docs/index.rst",
"google/cloud/spanner_v1/__init__.py",
"testing/constraints-3.7.txt",
"google/cloud/spanner_admin_instance/**",
"google/cloud/spanner_admin_database/**"
],
)

s.remove_staging_dirs()
Expand All @@ -278,27 +215,12 @@ def get_staging_dirs(
templated_files,
excludes=[
".coveragerc",
".github/workflows", # exclude gh actions as credentials are needed for tests
".github/**",
".kokoro/**",
"README.rst",
".github/release-please.yml",
".kokoro/test-samples-impl.sh",
".kokoro/presubmit/presubmit.cfg",
".kokoro/samples/python3.7/**",
".kokoro/samples/python3.8/**",
],
)

# Ensure CI runs on a new instance each time
s.replace(
".kokoro/build.sh",
"# Setup project id.",
"""\
# Set up creating a new instance for each system test run
export GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE=true

# Setup project id.""",
)

# Update samples folder in CONTRIBUTING.rst
s.replace("CONTRIBUTING.rst", "samples/snippets", "samples/samples")

Expand All @@ -321,4 +243,4 @@ def get_staging_dirs(

# Use a python runtime which is available in the owlbot post processor here
# https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile
s.shell.run(["nox", "-s", "blacken-3.10"], hide_output=False)
s.shell.run(["nox", "-s", "blacken-3.14"], hide_output=False)
Loading
Loading