Skip to content

Commit 1061611

Browse files
rinarakakigcf-owl-bot[bot]chalmerlowe
authored
feat: migrate to pyproject.toml (#2041)
* Migrate to pyproject.toml * Update * Add copyright notice * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update pyproject.toml --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Chalmer Lowe <[email protected]>
1 parent b2f33df commit 1061611

File tree

3 files changed

+107
-127
lines changed

3 files changed

+107
-127
lines changed

pyproject.toml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
[build-system]
16+
requires = ["setuptools"]
17+
build-backend = "setuptools.build_meta"
18+
19+
[project]
20+
name = "google-cloud-bigquery"
21+
authors = [{ name = "Google LLC", email = "[email protected]" }]
22+
license = { text = "Apache 2.0" }
23+
requires-python = ">=3.7"
24+
description = "Google BigQuery API client library"
25+
readme = "README.rst"
26+
classifiers = [
27+
# Should be one of:
28+
# "Development Status :: 3 - Alpha"
29+
# "Development Status :: 4 - Beta"
30+
# "Development Status :: 5 - Production/Stable"
31+
"Development Status :: 5 - Production/Stable",
32+
"Intended Audience :: Developers",
33+
"License :: OSI Approved :: Apache Software License",
34+
"Programming Language :: Python",
35+
"Programming Language :: Python :: 3",
36+
"Programming Language :: Python :: 3.7",
37+
"Programming Language :: Python :: 3.8",
38+
"Programming Language :: Python :: 3.9",
39+
"Programming Language :: Python :: 3.10",
40+
"Programming Language :: Python :: 3.11",
41+
"Programming Language :: Python :: 3.12",
42+
"Operating System :: OS Independent",
43+
"Topic :: Internet",
44+
]
45+
dependencies = [
46+
"google-api-core[grpc] >= 2.11.1, < 3.0.0dev",
47+
"google-auth >= 2.14.1, < 3.0.0dev",
48+
"google-cloud-core >= 2.4.1, < 3.0.0dev",
49+
"google-resumable-media >= 2.0.0, < 3.0dev",
50+
"packaging >= 20.0.0",
51+
"python-dateutil >= 2.7.3, < 3.0dev",
52+
"requests >= 2.21.0, < 3.0.0dev",
53+
]
54+
dynamic = ["version"]
55+
56+
[project.urls]
57+
Repository = "https://github.com/googleapis/python-bigquery"
58+
59+
[project.optional-dependencies]
60+
# bqstorage had a period where it was a required dependency, and has been
61+
# moved back to optional due to bloat. See
62+
# https://github.com/googleapis/python-bigquery/issues/1196 for more background.
63+
bqstorage = [
64+
"google-cloud-bigquery-storage >= 2.6.0, < 3.0.0dev",
65+
# Due to an issue in pip's dependency resolver, the `grpc` extra is not
66+
# installed, even though `google-cloud-bigquery-storage` specifies it
67+
# as `google-api-core[grpc]`. We thus need to explicitly specify it here.
68+
# See: https://github.com/googleapis/python-bigquery/issues/83 The
69+
# grpc.Channel.close() method isn't added until 1.32.0.
70+
# https://github.com/grpc/grpc/pull/15254
71+
"grpcio >= 1.47.0, < 2.0dev",
72+
"grpcio >= 1.49.1, < 2.0dev; python_version >= '3.11'",
73+
"pyarrow >= 3.0.0",
74+
]
75+
pandas = [
76+
"pandas >= 1.1.0",
77+
"pyarrow >= 3.0.0",
78+
"db-dtypes >= 0.3.0, < 2.0.0dev",
79+
"importlib_metadata >= 1.0.0; python_version < '3.8'",
80+
]
81+
ipywidgets = ["ipywidgets >= 7.7.0", "ipykernel >= 6.0.0"]
82+
geopandas = ["geopandas >= 0.9.0, < 1.0dev", "Shapely >= 1.8.4, < 3.0.0dev"]
83+
ipython = ["bigquery-magics >= 0.1.0"]
84+
tqdm = ["tqdm >= 4.7.4, < 5.0.0dev"]
85+
opentelemetry = [
86+
"opentelemetry-api >= 1.1.0",
87+
"opentelemetry-sdk >= 1.1.0",
88+
"opentelemetry-instrumentation >= 0.20b0",
89+
]
90+
bigquery_v2 = [
91+
"proto-plus >= 1.22.3, < 2.0.0dev",
92+
"protobuf >= 3.20.2, < 6.0.0dev, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5", # For the legacy proto-based types.
93+
]
94+
all = [
95+
"google-cloud-bigquery[bqstorage,pandas,ipywidgets,geopandas,ipython,tqdm,opentelemetry,bigquery_v2]",
96+
]
97+
98+
[tool.setuptools.dynamic]
99+
version = { attr = "google.cloud.bigquery.version.__version__" }
100+
101+
[tool.setuptools.packages.find]
102+
# Only include packages under the 'google' namespace. Do not include tests,
103+
# benchmarks, etc.
104+
include = ["google*"]

setup.py

+2-126
Original file line numberDiff line numberDiff line change
@@ -12,131 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import io
16-
import os
15+
import setuptools # type: ignore
1716

18-
import setuptools
1917

20-
21-
# Package metadata.
22-
23-
name = "google-cloud-bigquery"
24-
description = "Google BigQuery API client library"
25-
26-
# Should be one of:
27-
# 'Development Status :: 3 - Alpha'
28-
# 'Development Status :: 4 - Beta'
29-
# 'Development Status :: 5 - Production/Stable'
30-
release_status = "Development Status :: 5 - Production/Stable"
31-
dependencies = [
32-
"google-api-core[grpc] >= 2.11.1, <3.0.0dev",
33-
"google-auth >= 2.14.1, <3.0.0dev",
34-
"google-cloud-core >= 2.4.1, <3.0.0dev",
35-
"google-resumable-media >= 2.0.0, < 3.0dev",
36-
"packaging >= 20.0.0",
37-
"python-dateutil >= 2.7.3, <3.0dev",
38-
"requests >= 2.21.0, < 3.0.0dev",
39-
]
40-
pyarrow_dependency = "pyarrow >= 3.0.0"
41-
extras = {
42-
# bqstorage had a period where it was a required dependency, and has been
43-
# moved back to optional due to bloat. See
44-
# https://github.com/googleapis/python-bigquery/issues/1196 for more background.
45-
"bqstorage": [
46-
"google-cloud-bigquery-storage >= 2.6.0, <3.0.0dev",
47-
# Due to an issue in pip's dependency resolver, the `grpc` extra is not
48-
# installed, even though `google-cloud-bigquery-storage` specifies it
49-
# as `google-api-core[grpc]`. We thus need to explicitly specify it here.
50-
# See: https://github.com/googleapis/python-bigquery/issues/83 The
51-
# grpc.Channel.close() method isn't added until 1.32.0.
52-
# https://github.com/grpc/grpc/pull/15254
53-
"grpcio >= 1.47.0, < 2.0dev",
54-
"grpcio >= 1.49.1, < 2.0dev; python_version>='3.11'",
55-
pyarrow_dependency,
56-
],
57-
"pandas": [
58-
"pandas>=1.1.0",
59-
pyarrow_dependency,
60-
"db-dtypes>=0.3.0,<2.0.0dev",
61-
"importlib_metadata>=1.0.0; python_version<'3.8'",
62-
],
63-
"ipywidgets": [
64-
"ipywidgets>=7.7.0",
65-
"ipykernel>=6.0.0",
66-
],
67-
"geopandas": ["geopandas>=0.9.0, <1.0dev", "Shapely>=1.8.4, <3.0.0dev"],
68-
"ipython": [
69-
"bigquery-magics >= 0.1.0",
70-
],
71-
"tqdm": ["tqdm >= 4.7.4, <5.0.0dev"],
72-
"opentelemetry": [
73-
"opentelemetry-api >= 1.1.0",
74-
"opentelemetry-sdk >= 1.1.0",
75-
"opentelemetry-instrumentation >= 0.20b0",
76-
],
77-
"bigquery_v2": [
78-
"proto-plus >= 1.22.3, <2.0.0dev",
79-
"protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", # For the legacy proto-based types.
80-
],
81-
}
82-
83-
all_extras = []
84-
85-
for extra in extras:
86-
all_extras.extend(extras[extra])
87-
88-
extras["all"] = all_extras
89-
90-
# Setup boilerplate below this line.
91-
92-
package_root = os.path.abspath(os.path.dirname(__file__))
93-
94-
readme_filename = os.path.join(package_root, "README.rst")
95-
with io.open(readme_filename, encoding="utf-8") as readme_file:
96-
readme = readme_file.read()
97-
98-
version = {}
99-
with open(os.path.join(package_root, "google/cloud/bigquery/version.py")) as fp:
100-
exec(fp.read(), version)
101-
version = version["__version__"]
102-
103-
# Only include packages under the 'google' namespace. Do not include tests,
104-
# benchmarks, etc.
105-
packages = [
106-
package
107-
for package in setuptools.find_namespace_packages()
108-
if package.startswith("google")
109-
]
110-
111-
setuptools.setup(
112-
name=name,
113-
version=version,
114-
description=description,
115-
long_description=readme,
116-
author="Google LLC",
117-
author_email="[email protected]",
118-
license="Apache 2.0",
119-
url="https://github.com/googleapis/python-bigquery",
120-
classifiers=[
121-
release_status,
122-
"Intended Audience :: Developers",
123-
"License :: OSI Approved :: Apache Software License",
124-
"Programming Language :: Python",
125-
"Programming Language :: Python :: 3",
126-
"Programming Language :: Python :: 3.7",
127-
"Programming Language :: Python :: 3.8",
128-
"Programming Language :: Python :: 3.9",
129-
"Programming Language :: Python :: 3.10",
130-
"Programming Language :: Python :: 3.11",
131-
"Programming Language :: Python :: 3.12",
132-
"Operating System :: OS Independent",
133-
"Topic :: Internet",
134-
],
135-
platforms="Posix; MacOS X; Windows",
136-
packages=packages,
137-
install_requires=dependencies,
138-
extras_require=extras,
139-
python_requires=">=3.7",
140-
include_package_data=True,
141-
zip_safe=False,
142-
)
18+
setuptools.setup()

tests/unit/test_table.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ def _make_one(
20112011
path=None,
20122012
schema=None,
20132013
table=None,
2014-
**kwargs
2014+
**kwargs,
20152015
):
20162016
from google.cloud.bigquery.table import TableReference
20172017

0 commit comments

Comments
 (0)