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

Commit

Permalink
feat: Python DIREGAPIC initial commit (#14)
Browse files Browse the repository at this point in the history
* fix: Update gapic-generator version (to fix PHP generation)

* core: Python DIREGAPIC initial commit

Also fix and update the other dependencies in the repository:
1) Use the latest revision of comptue API discovery (revision 2020/11/22)

2) Update to the lates gapic-generator (to fix `php_gapic_library` rule `transport` argument)

3) Update to the latest `gapic-generator-python` and `rules_python` (including changes in `WORKSPACE` file required by the newest version of rules_python).
  • Loading branch information
vam-google authored Jan 5, 2021
1 parent 125ea6e commit eb99311
Show file tree
Hide file tree
Showing 4 changed files with 1,833 additions and 713 deletions.
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
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",
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

0 comments on commit eb99311

Please sign in to comment.