Skip to content

refactor: configure setup.py in preparation for using release-please #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 26, 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
1 change: 1 addition & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
releaseType: python
15 changes: 10 additions & 5 deletions pandas_gbq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@

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

from ._version import get_versions
from pandas_gbq import version as pandas_gbq_version

versions = get_versions()
__version__ = versions.get("closest-tag", versions["version"])
__git_revision__ = versions["full-revisionid"]
del get_versions, versions
__version__ = pandas_gbq_version.__version__

__all__ = [
"__version__",
"to_gbq",
"read_gbq",
"Context",
"context",
]
4 changes: 1 addition & 3 deletions pandas_gbq/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ def get_credentials(
return credentials, project_id


def get_credentials_cache(
reauth,
):
def get_credentials_cache(reauth):
import pydata_google_auth.cache

if reauth:
Expand Down
1 change: 1 addition & 0 deletions pandas_gbq/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.


class AccessDenied(ValueError):
"""
Raised when invalid credentials are provided, or tokens have expired.
Expand Down
5 changes: 5 additions & 0 deletions pandas_gbq/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2021 pandas-gbq Authors All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

__version__ = "0.15.0"
39 changes: 18 additions & 21 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the
# resulting files.

[versioneer]
VCS = git
style = pep440
versionfile_source = pandas_gbq/_version.py
versionfile_build = pandas_gbq/_version.py
tag_prefix =
parentdir_prefix = pandas_gbq-

[flake8]
ignore = E731, W503
exclude = docs

[isort]
multi_line_output=3
line_length=79
default_section=THIRDPARTY
known_first_party=pandas_gbq
# Generated by synthtool. DO NOT EDIT!
[bdist_wheel]
universal = 1
83 changes: 54 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@

# -*- coding: utf-8 -*-

import versioneer
from setuptools import find_packages, setup
import io
import os

NAME = "pandas-gbq"
import setuptools


# versioning
cmdclass = versioneer.get_cmdclass()
# Package metadata.

name = "pandas-gbq"
description = "Google BigQuery connector for pandas"

def readme():
with open("README.rst") as f:
return f.read()


INSTALL_REQUIRES = [
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = "Development Status :: 4 - Beta"
dependencies = [
"setuptools",
"pandas>=0.23.2",
"pydata-google-auth",
Expand All @@ -30,35 +31,59 @@ def readme():
# https://github.com/pydata/pandas-gbq/issues/343
"google-cloud-bigquery[bqstorage,pandas]>=1.11.1,<3.0.0dev,!=2.4.*",
]

extras = {"tqdm": "tqdm>=4.23.0"}

setup(
name=NAME,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Pandas interface to Google BigQuery",
long_description=readme(),
license="BSD License",
author="The PyData Development Team",
author_email="[email protected]",
url="https://github.com/pydata/pandas-gbq",
# Setup boilerplate below this line.

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

readme_filename = os.path.join(package_root, "README.rst")
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

version = {}
with open(os.path.join(package_root, "pandas_gbq/version.py")) as fp:
exec(fp.read(), version)
version = version["__version__"]

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
package
for package in setuptools.PEP420PackageFinder.find()
if package.startswith("pandas_gbq")
]


setuptools.setup(
name=name,
version=version,
description=description,
long_description=readme,
author="pandas-gbq authors",
author_email="[email protected]",
license="BSD-3-Clause",
url="https://github.com/googleapis/python-bigquery-pandas",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
release_status,
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Operating System :: OS Independent",
"Topic :: Internet",
"Topic :: Scientific/Engineering",
],
keywords="data",
install_requires=INSTALL_REQUIRES,
platforms="Posix; MacOS X; Windows",
packages=packages,
install_requires=dependencies,
extras_require=extras,
python_requires=">=3.7",
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
test_suite="tests",
python_requires=">=3.7, <3.10",
include_package_data=True,
zip_safe=False,
)
Loading