Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cc633ee
chore: onboard to librarian
ohmayr Nov 5, 2025
c0b2ba3
add setup file
ohmayr Nov 5, 2025
58244e1
update blacken
ohmayr Nov 5, 2025
97f48f4
revert system test version to 3.12
ohmayr Nov 5, 2025
f1c559e
wip
ohmayr Nov 6, 2025
f5bb5b0
wip
ohmayr Nov 6, 2025
8fac832
wip
ohmayr Nov 6, 2025
27df1a4
wip
ohmayr Nov 6, 2025
1047741
wip
ohmayr Nov 6, 2025
4ad99dc
wip
ohmayr Nov 6, 2025
125179a
wip
ohmayr Nov 6, 2025
8201304
wip
ohmayr Nov 6, 2025
5f89e33
wip
ohmayr Nov 7, 2025
c916a92
wip
ohmayr Nov 7, 2025
5adda80
wip
ohmayr Nov 7, 2025
dc42efc
wip
ohmayr Nov 7, 2025
7fc2948
wip
ohmayr Nov 7, 2025
6658906
wip
ohmayr Nov 7, 2025
5c60088
wip
ohmayr Nov 7, 2025
b45b0a2
wip
ohmayr Nov 7, 2025
a53781a
wip
ohmayr Nov 7, 2025
e808405
wip
ohmayr Nov 7, 2025
6b27075
wip
ohmayr Nov 7, 2025
5e33afb
wip
ohmayr Nov 8, 2025
e98a4b7
wip
ohmayr Nov 8, 2025
b1d2427
update sha
ohmayr Nov 10, 2025
2a44764
update sha
ohmayr Nov 10, 2025
5919f3c
wip
ohmayr Nov 10, 2025
22c7cfa
wip
ohmayr Nov 10, 2025
7ed3697
wip
ohmayr Nov 10, 2025
d39305e
wip
ohmayr Nov 11, 2025
e730ecc
wip
ohmayr Nov 11, 2025
c5a37fc
wip
ohmayr Nov 11, 2025
dc17924
wip
ohmayr Nov 11, 2025
ea2fb81
generated changes
ohmayr Nov 11, 2025
5e14343
update sha
ohmayr Nov 11, 2025
3623604
remove files
ohmayr Nov 11, 2025
594ccfe
update python version for lint
ohmayr Nov 12, 2025
4b3bc2c
revert setup file to main
ohmayr Nov 14, 2025
907ed25
reorder apis
ohmayr Nov 17, 2025
5e8d17b
fix docs
ohmayr Nov 17, 2025
41e701c
address failure
ohmayr Nov 18, 2025
69fccf7
rename owlbot.py to librarian.py
ohmayr Nov 18, 2025
6f8a89b
rename file
ohmayr Nov 18, 2025
97d7374
chore: create a release
ohmayr Nov 18, 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