Skip to content

Commit 1afeb53

Browse files
authored
refactor: configure setup.py in preparation for using release-please (#371)
* refactor: configure release-please * blacken
1 parent 2f82070 commit 1afeb53

File tree

8 files changed

+90
-1967
lines changed

8 files changed

+90
-1967
lines changed

.github/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
releaseType: python

pandas_gbq/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44

55
from .gbq import to_gbq, read_gbq, Context, context # noqa
66

7-
from ._version import get_versions
7+
from pandas_gbq import version as pandas_gbq_version
88

9-
versions = get_versions()
10-
__version__ = versions.get("closest-tag", versions["version"])
11-
__git_revision__ = versions["full-revisionid"]
12-
del get_versions, versions
9+
__version__ = pandas_gbq_version.__version__
10+
11+
__all__ = [
12+
"__version__",
13+
"to_gbq",
14+
"read_gbq",
15+
"Context",
16+
"context",
17+
]

pandas_gbq/auth.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ def get_credentials(
5555
return credentials, project_id
5656

5757

58-
def get_credentials_cache(
59-
reauth,
60-
):
58+
def get_credentials_cache(reauth):
6159
import pydata_google_auth.cache
6260

6361
if reauth:

pandas_gbq/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Use of this source code is governed by a BSD-style
33
# license that can be found in the LICENSE file.
44

5+
56
class AccessDenied(ValueError):
67
"""
78
Raised when invalid credentials are provided, or tokens have expired.

pandas_gbq/version.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2021 pandas-gbq Authors All rights reserved.
2+
# Use of this source code is governed by a BSD-style
3+
# license that can be found in the LICENSE file.
4+
5+
__version__ = "0.15.0"

setup.cfg

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
116

2-
# See the docstring in versioneer.py for instructions. Note that you must
3-
# re-run 'versioneer.py setup' after changing this section, and commit the
4-
# resulting files.
5-
6-
[versioneer]
7-
VCS = git
8-
style = pep440
9-
versionfile_source = pandas_gbq/_version.py
10-
versionfile_build = pandas_gbq/_version.py
11-
tag_prefix =
12-
parentdir_prefix = pandas_gbq-
13-
14-
[flake8]
15-
ignore = E731, W503
16-
exclude = docs
17-
18-
[isort]
19-
multi_line_output=3
20-
line_length=79
21-
default_section=THIRDPARTY
22-
known_first_party=pandas_gbq
17+
# Generated by synthtool. DO NOT EDIT!
18+
[bdist_wheel]
19+
universal = 1

setup.py

Lines changed: 54 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55

66
# -*- coding: utf-8 -*-
77

8-
import versioneer
9-
from setuptools import find_packages, setup
8+
import io
9+
import os
1010

11-
NAME = "pandas-gbq"
11+
import setuptools
1212

1313

14-
# versioning
15-
cmdclass = versioneer.get_cmdclass()
14+
# Package metadata.
1615

16+
name = "pandas-gbq"
17+
description = "Google BigQuery connector for pandas"
1718

18-
def readme():
19-
with open("README.rst") as f:
20-
return f.read()
21-
22-
23-
INSTALL_REQUIRES = [
19+
# Should be one of:
20+
# 'Development Status :: 3 - Alpha'
21+
# 'Development Status :: 4 - Beta'
22+
# 'Development Status :: 5 - Production/Stable'
23+
release_status = "Development Status :: 4 - Beta"
24+
dependencies = [
2425
"setuptools",
2526
"pandas>=0.23.2",
2627
"pydata-google-auth",
@@ -30,35 +31,59 @@ def readme():
3031
# https://github.com/pydata/pandas-gbq/issues/343
3132
"google-cloud-bigquery[bqstorage,pandas]>=1.11.1,<3.0.0dev,!=2.4.*",
3233
]
33-
3434
extras = {"tqdm": "tqdm>=4.23.0"}
3535

36-
setup(
37-
name=NAME,
38-
version=versioneer.get_version(),
39-
cmdclass=versioneer.get_cmdclass(),
40-
description="Pandas interface to Google BigQuery",
41-
long_description=readme(),
42-
license="BSD License",
43-
author="The PyData Development Team",
44-
author_email="[email protected]",
45-
url="https://github.com/pydata/pandas-gbq",
36+
# Setup boilerplate below this line.
37+
38+
package_root = os.path.abspath(os.path.dirname(__file__))
39+
40+
readme_filename = os.path.join(package_root, "README.rst")
41+
with io.open(readme_filename, encoding="utf-8") as readme_file:
42+
readme = readme_file.read()
43+
44+
version = {}
45+
with open(os.path.join(package_root, "pandas_gbq/version.py")) as fp:
46+
exec(fp.read(), version)
47+
version = version["__version__"]
48+
49+
# Only include packages under the 'google' namespace. Do not include tests,
50+
# benchmarks, etc.
51+
packages = [
52+
package
53+
for package in setuptools.PEP420PackageFinder.find()
54+
if package.startswith("pandas_gbq")
55+
]
56+
57+
58+
setuptools.setup(
59+
name=name,
60+
version=version,
61+
description=description,
62+
long_description=readme,
63+
author="pandas-gbq authors",
64+
author_email="[email protected]",
65+
license="BSD-3-Clause",
66+
url="https://github.com/googleapis/python-bigquery-pandas",
4667
classifiers=[
47-
"Development Status :: 4 - Beta",
48-
"Environment :: Console",
68+
release_status,
69+
"Intended Audience :: Developers",
4970
"Intended Audience :: Science/Research",
5071
"Operating System :: OS Independent",
72+
"License :: OSI Approved :: BSD License",
5173
"Programming Language :: Python",
5274
"Programming Language :: Python :: 3",
5375
"Programming Language :: Python :: 3.7",
5476
"Programming Language :: Python :: 3.8",
5577
"Programming Language :: Python :: 3.9",
78+
"Operating System :: OS Independent",
79+
"Topic :: Internet",
5680
"Topic :: Scientific/Engineering",
5781
],
58-
keywords="data",
59-
install_requires=INSTALL_REQUIRES,
82+
platforms="Posix; MacOS X; Windows",
83+
packages=packages,
84+
install_requires=dependencies,
6085
extras_require=extras,
61-
python_requires=">=3.7",
62-
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
63-
test_suite="tests",
86+
python_requires=">=3.7, <3.10",
87+
include_package_data=True,
88+
zip_safe=False,
6489
)

0 commit comments

Comments
 (0)