Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

feat: Python DIREGAPIC initial commit #14

Merged
merged 2 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 7 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ switched_rules_by_language(
java = True,
php = True,
nodejs = True,
python = True,
)

# Protobuf depends on very old version of bazel_skylib (forward compatible with the new one).
Expand All @@ -35,8 +36,8 @@ http_archive(
# version of the library will be selected as a transitive dependency of gRPC.
http_archive(
name = "rules_python",
strip_prefix = "rules_python-748aa53d7701e71101dfd15d800e100f6ff8e5d1",
url = "https://github.com/bazelbuild/rules_python/archive/748aa53d7701e71101dfd15d800e100f6ff8e5d1.zip",
strip_prefix = "rules_python-0.1.0",
url = "https://github.com/bazelbuild/rules_python/archive/0.1.0.tar.gz",
)

http_archive(
Expand Down Expand Up @@ -70,8 +71,8 @@ rules_proto_toolchains()
# section

Choose a reason for hiding this comment

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

the "common code" this comment refers to is only PHP? I do see a reference to py_gapic_repositories in the rules below. Will we move that to the µgenerators?

http_archive(
name = "com_google_api_codegen",
strip_prefix = "gapic-generator-2.9.0",
urls = ["https://github.com/googleapis/gapic-generator/archive/v2.9.0.zip"],
strip_prefix = "gapic-generator-2.10.1",
urls = ["https://github.com/googleapis/gapic-generator/archive/v2.10.1.zip"],
)

# rules_go (support Golang under bazel)
Expand Down Expand Up @@ -235,8 +236,8 @@ pip_repositories()
# Change upstream repository once PR is merged
http_archive(
name = "gapic_generator_python",
strip_prefix = "gapic-generator-python-0.35.9",
urls = ["https://github.com/googleapis/gapic-generator-python/archive/v0.35.9.zip"],
strip_prefix = "gapic-generator-python-56c31de4a9f661e3d69b52e19c9a28dddfe9d7dc",

Choose a reason for hiding this comment

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

This SHA points to googleapis/gapic-generator-python#716, which has been committed. Let's point to the latest release, 0.39.1.
(see commit list)

urls = ["https://github.com/googleapis/gapic-generator-python/archive/56c31de4a9f661e3d69b52e19c9a28dddfe9d7dc.zip"],
)

load(
Expand All @@ -249,10 +250,6 @@ gapic_generator_python()

gapic_generator_register_toolchains()

load("@gapic_generator_python_pip_deps//:requirements.bzl", "pip_install")

pip_install()

##############################################################################
# Go
##############################################################################
Expand Down
47 changes: 47 additions & 0 deletions google/cloud/compute/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ proto_library(
"@com_google_googleapis//google/api:client_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_protobuf//:descriptor_proto",
],
)

Expand Down Expand Up @@ -248,6 +249,52 @@ java_gapic_assembly_gradle_pkg(
],
)

##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
)

py_gapic_library(
name = "compute_py_gapic",
opt_args = [
"transport=rest"
],
srcs = [
":compute_proto"
],
)

# Open Source Packages
py_gapic_assembly_pkg(
name = "compute-v1-py",
deps = [
":compute_py_gapic",
],
)

# Python Compute Small (for testing and prototyping purposes)
py_gapic_library(
name = "compute_small_py_gapic",
srcs = [
":compute_small_proto"
],
opt_args = [
"transport=rest"
],
)

# Open Source Packages
py_gapic_assembly_pkg(
name = "compute-small-v1-py",
deps = [
":compute_small_py_gapic",
],
)

##############################################################################
# PHP
##############################################################################
Expand Down
Loading