Skip to content
Open
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
4 changes: 2 additions & 2 deletions gapic/templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

{% if api.naming.module_namespace %}
FORMAT_PATHS = ["docs", "{{ api.naming.module_namespace[0] }}", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "{{ api.naming.module_namespace[0] }}", "tests"]
LINT_PATHS = ["docs", "{{ api.naming.module_namespace[0] }}", "tests", "noxfile.py", "setup.py"]
{% else %}
FORMAT_PATHS = ["docs", "{{ api.naming.versioned_module_name }}", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "{{ api.naming.versioned_module_name }}", "tests"]
LINT_PATHS = ["docs", "{{ api.naming.versioned_module_name }}", "tests", "noxfile.py", "setup.py"]
{% endif %}

Expand Down
22 changes: 10 additions & 12 deletions gapic/templates/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import io
import os
import re

import setuptools # type: ignore
import setuptools # type: ignore

package_root = os.path.abspath(os.path.dirname(__file__))

name = '{{ api.naming.warehouse_package_name }}'
name = "{{ api.naming.warehouse_package_name }}"

{% set warehouse_description = api.naming.warehouse_package_name.replace('-',' ')|title %}

Expand All @@ -22,9 +22,9 @@ description = "{{ warehouse_description }} API client library"

version = None

with open(os.path.join(package_root, '{{ package_path }}/gapic_version.py')) as fp:
with open(os.path.join(package_root, "{{ package_path }}/gapic_version.py")) as fp:
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
assert (len(version_candidates) == 1)
assert len(version_candidates) == 1
version = version_candidates[0]

if version[0] == "0":
Expand Down Expand Up @@ -52,14 +52,16 @@ dependencies = [
{% endif %}
{% endfor %}
]
extras = {
{% if rest_async_io_enabled %}
extras = {
"async_rest": [
"google-api-core[grpc] >= 2.21.0, < 3.0.0",
"google-auth[aiohttp] >= 2.35.0, <3.0.0"
"google-auth[aiohttp] >= 2.35.0, <3.0.0",
],
{% endif %}
}
{% else %}
extras = {}
{% endif %}
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/{{ api.naming.warehouse_package_name }}"

package_root = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -68,11 +70,7 @@ readme_filename = os.path.join(package_root, "README.rst")
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

packages = [
package
for package in setuptools.find_namespace_packages()
if package.startswith("{{ api.naming.namespace_packages|first }}")
]
packages = [package for package in setuptools.find_namespace_packages() if package.startswith("{{ api.naming.namespace_packages|first }}")]

setuptools.setup(
name=name,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/asset/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

FORMAT_PATHS = ["docs", "google", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "google", "tests"]
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

# We're most interested in ensuring that code is formatted properly
Expand Down
17 changes: 6 additions & 11 deletions tests/integration/goldens/asset/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
import os
import re

import setuptools # type: ignore
import setuptools # type: ignore

package_root = os.path.abspath(os.path.dirname(__file__))

name = 'google-cloud-asset'
name = "google-cloud-asset"


description = "Google Cloud Asset API client library"

version = None

with open(os.path.join(package_root, 'google/cloud/asset/gapic_version.py')) as fp:
with open(os.path.join(package_root, "google/cloud/asset/gapic_version.py")) as fp:
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
assert (len(version_candidates) == 1)
assert len(version_candidates) == 1
version = version_candidates[0]

if version[0] == "0":
Expand All @@ -52,8 +52,7 @@
"google-cloud-os-config >= 1.0.0, <2.0.0",
"grpc-google-iam-v1 >= 0.14.0, <1.0.0",
]
extras = {
}
extras = {}
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-asset"

package_root = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -62,11 +61,7 @@
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

packages = [
package
for package in setuptools.find_namespace_packages()
if package.startswith("google")
]
packages = [package for package in setuptools.find_namespace_packages() if package.startswith("google")]

setuptools.setup(
name=name,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/credentials/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

FORMAT_PATHS = ["docs", "google", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "google", "tests"]
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

# We're most interested in ensuring that code is formatted properly
Expand Down
17 changes: 6 additions & 11 deletions tests/integration/goldens/credentials/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
import os
import re

import setuptools # type: ignore
import setuptools # type: ignore

package_root = os.path.abspath(os.path.dirname(__file__))

name = 'google-iam-credentials'
name = "google-iam-credentials"


description = "Google Iam Credentials API client library"

version = None

with open(os.path.join(package_root, 'google/iam/credentials/gapic_version.py')) as fp:
with open(os.path.join(package_root, "google/iam/credentials/gapic_version.py")) as fp:
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
assert (len(version_candidates) == 1)
assert len(version_candidates) == 1
version = version_candidates[0]

if version[0] == "0":
Expand All @@ -49,8 +49,7 @@
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]
extras = {
}
extras = {}
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-iam-credentials"

package_root = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -59,11 +58,7 @@
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

packages = [
package
for package in setuptools.find_namespace_packages()
if package.startswith("google")
]
packages = [package for package in setuptools.find_namespace_packages() if package.startswith("google")]

setuptools.setup(
name=name,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/eventarc/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

FORMAT_PATHS = ["docs", "google", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "google", "tests"]
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

# We're most interested in ensuring that code is formatted properly
Expand Down
17 changes: 6 additions & 11 deletions tests/integration/goldens/eventarc/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
import os
import re

import setuptools # type: ignore
import setuptools # type: ignore

package_root = os.path.abspath(os.path.dirname(__file__))

name = 'google-cloud-eventarc'
name = "google-cloud-eventarc"


description = "Google Cloud Eventarc API client library"

version = None

with open(os.path.join(package_root, 'google/cloud/eventarc_v1/gapic_version.py')) as fp:
with open(os.path.join(package_root, "google/cloud/eventarc_v1/gapic_version.py")) as fp:
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
assert (len(version_candidates) == 1)
assert len(version_candidates) == 1
version = version_candidates[0]

if version[0] == "0":
Expand All @@ -50,8 +50,7 @@
"protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
"grpc-google-iam-v1 >= 0.14.0, <1.0.0",
]
extras = {
}
extras = {}
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-eventarc"

package_root = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -60,11 +59,7 @@
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

packages = [
package
for package in setuptools.find_namespace_packages()
if package.startswith("google")
]
packages = [package for package in setuptools.find_namespace_packages() if package.startswith("google")]

setuptools.setup(
name=name,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/logging/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

FORMAT_PATHS = ["docs", "google", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "google", "tests"]
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

# We're most interested in ensuring that code is formatted properly
Expand Down
17 changes: 6 additions & 11 deletions tests/integration/goldens/logging/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
import os
import re

import setuptools # type: ignore
import setuptools # type: ignore

package_root = os.path.abspath(os.path.dirname(__file__))

name = 'google-cloud-logging'
name = "google-cloud-logging"


description = "Google Cloud Logging API client library"

version = None

with open(os.path.join(package_root, 'google/cloud/logging/gapic_version.py')) as fp:
with open(os.path.join(package_root, "google/cloud/logging/gapic_version.py")) as fp:
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
assert (len(version_candidates) == 1)
assert len(version_candidates) == 1
version = version_candidates[0]

if version[0] == "0":
Expand All @@ -49,8 +49,7 @@
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]
extras = {
}
extras = {}
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-logging"

package_root = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -59,11 +58,7 @@
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

packages = [
package
for package in setuptools.find_namespace_packages()
if package.startswith("google")
]
packages = [package for package in setuptools.find_namespace_packages() if package.startswith("google")]

setuptools.setup(
name=name,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/logging_internal/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

FORMAT_PATHS = ["docs", "google", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "google", "tests"]
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

# We're most interested in ensuring that code is formatted properly
Expand Down
17 changes: 6 additions & 11 deletions tests/integration/goldens/logging_internal/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
import os
import re

import setuptools # type: ignore
import setuptools # type: ignore

package_root = os.path.abspath(os.path.dirname(__file__))

name = 'google-cloud-logging'
name = "google-cloud-logging"


description = "Google Cloud Logging API client library"

version = None

with open(os.path.join(package_root, 'google/cloud/logging/gapic_version.py')) as fp:
with open(os.path.join(package_root, "google/cloud/logging/gapic_version.py")) as fp:
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
assert (len(version_candidates) == 1)
assert len(version_candidates) == 1
version = version_candidates[0]

if version[0] == "0":
Expand All @@ -49,8 +49,7 @@
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]
extras = {
}
extras = {}
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-logging"

package_root = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -59,11 +58,7 @@
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

packages = [
package
for package in setuptools.find_namespace_packages()
if package.startswith("google")
]
packages = [package for package in setuptools.find_namespace_packages() if package.startswith("google")]

setuptools.setup(
name=name,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/redis/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

FORMAT_PATHS = ["docs", "google", "tests", "setup.py"]
FORMAT_PATHS = ["docs", "google", "tests"]
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

# We're most interested in ensuring that code is formatted properly
Expand Down
Loading