Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pydata-google-auth for
openSUSE:Factory checked in at 2023-10-19 22:50:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pydata-google-auth (Old)
and /work/SRC/openSUSE:Factory/.python-pydata-google-auth.new.1945 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pydata-google-auth"
Thu Oct 19 22:50:44 2023 rev:6 rq:1119011 version:1.8.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-pydata-google-auth/python-pydata-google-auth.changes
2020-07-14 08:01:12.210161458 +0200
+++
/work/SRC/openSUSE:Factory/.python-pydata-google-auth.new.1945/python-pydata-google-auth.changes
2023-10-19 22:53:43.372366856 +0200
@@ -1,0 +2,20 @@
+Thu Oct 19 14:38:48 UTC 2023 - Matej Cepl <[email protected]>
+
+- Clean up the SPEC file
+
+-------------------------------------------------------------------
+Thu Oct 19 12:49:00 UTC 2023 - Markéta Machová <[email protected]>
+
+- Update to 1.8.2
+ * Adds pydata_google_auth.load_service_account_credentials() function to get
+ service account credentials from the specified JSON path.
+ * Adds support for Python 3.10.
+ * Default use_local_webserver to True.
+ * Adds ability to provide redirect uri.
+ * Adds decision logic to handle use cases where a user may not have the
ability
+ to log in via an Out of Band authentication flow.
+ * Add optional colab specific ADC
+- Add no-six.patch to get rid of six dependency
+ * with backwards compatibility for the upstream
+
+-------------------------------------------------------------------
Old:
----
pydata-google-auth-1.1.0.tar.gz
New:
----
no-six.patch
pydata-google-auth-1.8.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pydata-google-auth.spec ++++++
--- /var/tmp/diff_new_pack.LLqH04/_old 2023-10-19 22:53:43.804382525 +0200
+++ /var/tmp/diff_new_pack.LLqH04/_new 2023-10-19 22:53:43.804382525 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pydata-google-auth
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,32 +16,28 @@
#
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%bcond_without python2
Name: python-pydata-google-auth
-Version: 1.1.0
+Version: 1.8.2
Release: 0
Summary: PyData helpers for authenticating to Google APIs
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/pydata/pydata-google-auth
Source:
https://github.com/pydata/pydata-google-auth/archive/%{version}.tar.gz#/pydata-google-auth-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM https://github.com/pydata/pydata-google-auth/pull/73 Do
not require six on Python 3
+Patch0: no-six.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
+Requires: python-google-auth >= 1.25.1
+Requires: python-google-auth-oauthlib >= 0.4.0
+BuildArch: noarch
# SECTION test requirements
-BuildRequires: %{python_module google-auth-oauthlib}
-BuildRequires: %{python_module google-auth}
+BuildRequires: %{python_module google-auth >= 1.25.0}
+BuildRequires: %{python_module google-auth-oauthlib >= 0.4.0}
BuildRequires: %{python_module pyfakefs}
BuildRequires: %{python_module pytest}
-%if %{with python2}
-BuildRequires: python-mock
-%endif
# /SECTION
-Requires: python-google-auth
-Requires: python-google-auth-oauthlib
-BuildArch: noarch
-
%python_subpackages
%description
@@ -49,7 +45,7 @@
to Google APIs.
%prep
-%setup -q -n pydata-google-auth-%{version}
+%autosetup -p1 -n pydata-google-auth-%{version}
%build
%python_build
@@ -64,5 +60,6 @@
%files %{python_files}
%doc README.rst
%license LICENSE.txt
-%{python_sitelib}/*
+%{python_sitelib}/pydata_google_auth
+%{python_sitelib}/pydata_google_auth-%{version}*-info
++++++ no-six.patch ++++++
Index: pydata-google-auth-1.8.2/tests/unit/test_cache.py
===================================================================
--- pydata-google-auth-1.8.2.orig/tests/unit/test_cache.py
+++ pydata-google-auth-1.8.2/tests/unit/test_cache.py
@@ -7,7 +7,10 @@ import os.path
import pytest
import google.oauth2.credentials
-from six.moves import reload_module
+try:
+ from importlib import reload
+except ImportError: # Py2 compat
+ from six.moves import reload_module as reload
@pytest.fixture
@@ -29,7 +32,7 @@ def test_import_unwriteable_fs(module_un
monkeypatch.setattr(os.path, "exists", lambda _: False)
monkeypatch.setattr(os, "makedirs", raise_unwriteable)
- reload_module(module_under_test)
+ reload(module_under_test)
assert module_under_test.NOOP is not None
++++++ pydata-google-auth-1.1.0.tar.gz -> pydata-google-auth-1.8.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/.circleci/config.yml
new/pydata-google-auth-1.8.2/.circleci/config.yml
--- old/pydata-google-auth-1.1.0/.circleci/config.yml 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/.circleci/config.yml 2023-08-01
19:01:12.000000000 +0200
@@ -11,26 +11,40 @@
- checkout
- run: nox -s unit-2.7
- "unit-3.5":
+ "unit-3.6":
docker:
- image: thekevjames/nox
steps:
- checkout
- - run: nox -s unit-3.5
+ - run: nox -s unit-3.6
- "unit-3.6":
+ "unit-3.7":
docker:
- image: thekevjames/nox
steps:
- checkout
- - run: nox -s unit-3.6
+ - run: nox -s unit-3.7
- "unit-3.7":
+ "unit-3.8":
+ docker:
+ - image: thekevjames/nox
+ steps:
+ - checkout
+ - run: nox -s unit-3.8
+
+ "unit-3.9":
+ docker:
+ - image: thekevjames/nox
+ steps:
+ - checkout
+ - run: nox -s unit-3.9 cover
+
+ "unit-3.10":
docker:
- image: thekevjames/nox
steps:
- checkout
- - run: nox -s unit-3.7 cover
+ - run: nox -s unit-3.10 cover
"lint":
docker:
@@ -44,7 +58,9 @@
build:
jobs:
- "unit-2.7"
- - "unit-3.5"
- "unit-3.6"
- "unit-3.7"
+ - "unit-3.8"
+ - "unit-3.9"
+ - "unit-3.10"
- lint
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/.flake8
new/pydata-google-auth-1.8.2/.flake8
--- old/pydata-google-auth-1.1.0/.flake8 2020-04-23 16:27:51.000000000
+0200
+++ new/pydata-google-auth-1.8.2/.flake8 2023-08-01 19:01:12.000000000
+0200
@@ -1,5 +1,5 @@
[flake8]
-ignore = E203, E266, E501, W503
+ignore = E203, E231, E266, E501, W503
exclude =
# Standard linting exemptions.
__pycache__,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/.gitignore
new/pydata-google-auth-1.8.2/.gitignore
--- old/pydata-google-auth-1.1.0/.gitignore 2020-04-23 16:27:51.000000000
+0200
+++ new/pydata-google-auth-1.8.2/.gitignore 2023-08-01 19:01:12.000000000
+0200
@@ -1,88 +1,64 @@
-#########################################
-# Editor temporary/working/backup files #
-.#*
-*\#*\#
-[#]*#
-*~
-*$
-*.bak
-*flymake*
-*.kdev4
-*.log
-*.swp
-*.pdb
-.project
-.pydevproject
-.settings
-.idea
-.vagrant
-.noseids
-.ipynb_checkpoints
-.tags
-.pytest_cache
-.testmon*
-.vscode/
-
-# Docs #
-########
-docs/source/_build
+*.py[cod]
+*.sw[op]
-# Coverage #
-############
-.coverage
-coverage.xml
-coverage_html_report
-.pytest_cache
-
-# Compiled source #
-###################
-*.a
-*.com
-*.class
-*.dll
-*.exe
-*.pxi
-*.o
-*.py[ocd]
+# C extensions
*.so
-.build_cache_dir
-MANIFEST
-__pycache__
-# Python files #
-################
-# setup.py working directory
-build
-# setup.py dist directory
-dist
-# Egg metadata
+# Packages
+*.egg
*.egg-info
+dist
+build
+eggs
.eggs
-.pypirc
+parts
+bin
+var
+sdist
+develop-eggs
+.installed.cfg
+lib
+lib64
+__pycache__
-# tox testing tool
-.tox
-# rope
-.ropeproject
-# wheel files
-*.whl
-**/wheelhouse/*
-# coverage
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
.coverage
.nox
+.cache
+.pytest_cache
+
-# OS generated files #
-######################
-.directory
-.gdb_history
+# Mac
.DS_Store
-ehthumbs.db
-Icon?
-Thumbs.db
-# caches #
-.cache
+# JetBrains
+.idea
+
+# VS Code
+.vscode
+
+# emacs
+*~
+
+# Built documentation
+docs/_build
+docs/source/_build
+bigquery/docs/generated
+docs.metadata
+
+# Virtual environment
+env/
+
+# Test logs
+coverage.xml
+*sponge_log.xml
+
+# System test environment variables.
+system_tests/local_test_setup
-# Credentials #
-###############
-bigquery_credentials.dat
+# Make sure a generated file isn't accidentally committed.
+pylintrc
+pylintrc.test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/docs/requirements-docs.txt
new/pydata-google-auth-1.8.2/docs/requirements-docs.txt
--- old/pydata-google-auth-1.1.0/docs/requirements-docs.txt 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/docs/requirements-docs.txt 2023-08-01
19:01:12.000000000 +0200
@@ -1,5 +1,5 @@
ipython
matplotlib
numpydoc
-sphinx
+sphinx==4.0.2
sphinx_rtd_theme
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pydata-google-auth-1.1.0/docs/source/_static/js/authcodescripts.js
new/pydata-google-auth-1.8.2/docs/source/_static/js/authcodescripts.js
--- old/pydata-google-auth-1.1.0/docs/source/_static/js/authcodescripts.js
1970-01-01 01:00:00.000000000 +0100
+++ new/pydata-google-auth-1.8.2/docs/source/_static/js/authcodescripts.js
2023-08-01 19:01:12.000000000 +0200
@@ -0,0 +1,30 @@
+function onloadoauthcode() {
+ const PARAMS = new Proxy(new URLSearchParams(window.location.search), {
+ get: (searchParams, prop) => searchParams.get(prop),
+ });
+ const AUTH_CODE = PARAMS.code;
+
+ document.querySelector('.auth-code').textContent = AUTH_CODE;
+
+ setupCopyButton(document.querySelector('.copy'), AUTH_CODE);
+}
+
+function setupCopyButton(button, text) {
+ button.addEventListener('click', () => {
+ navigator.clipboard.writeText(text);
+ button.textContent = "Verification Code Copied";
+ setTimeout(() => {
+ // Remove the aria-live label so that when the
+ // button text changes back to "Copy", it is
+ // not read out.
+ button.removeAttribute("aria-live");
+ button.textContent = "Copy";
+ }, 1000);
+
+ // Re-Add the aria-live attribute to enable speech for
+ // when button text changes next time.
+ setTimeout(() => {
+ button.setAttribute("aria-live", "assertive");
+ }, 2000);
+ });
+}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/docs/source/api.rst
new/pydata-google-auth-1.8.2/docs/source/api.rst
--- old/pydata-google-auth-1.1.0/docs/source/api.rst 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/docs/source/api.rst 2023-08-01
19:01:12.000000000 +0200
@@ -11,6 +11,7 @@
get_user_credentials
load_user_credentials
save_user_credentials
+ load_service_account_credentials
cache.CredentialsCache
cache.READ_WRITE
cache.REAUTH
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/docs/source/changelog.rst
new/pydata-google-auth-1.8.2/docs/source/changelog.rst
--- old/pydata-google-auth-1.1.0/docs/source/changelog.rst 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/docs/source/changelog.rst 2023-08-01
19:01:12.000000000 +0200
@@ -1,6 +1,83 @@
Changelog
=========
+.. _changelog-1.8.2:
+
+1.8.2 / (2023-08-01)
+--------------------
+
+- Ensure that the user credentials flow always gets a refresh token.
+ (:issue:`72`)
+
+.. _changelog-1.8.1:
+
+1.8.1 / (2023-07-10)
+--------------------
+
+- If any exception occurs during Google Colab authentication, fallback to
+ the Google Application Default Credentials flow. (:issue:`71`)
+
+.. _changelog-1.8.0:
+
+1.8.0 / (2023-05-09)
+--------------------
+
+- When running on Google Colab, try Colab-based authentication
+ (``google.colab.auth.authenticate_user()``) before attempting the Google
+ Application Default Credentials flow. (:issue:`68`)
+
+.. _changelog-1.7.0:
+
+1.7.0 / (2023-02-07)
+--------------------
+
+- Reissue of the library with the changes from 1.6.0 but with a new
+ version number due to a conflict in releases.
+
+.. _changelog-1.6.0:
+
+1.6.0 / (2023-02-07)
+--------------------
+
+- Adds decision logic to handle use cases where a user may not have the
+ ability to log in via an Out of Band authentication flow. (:issue:`54`)
+
+- Also provides an OAuth page as part of the documentation.
+
+.. _changelog-1.5.0:
+
+1.5.0 / (2023-01-09)
+--------------------
+
+- Adds ability to provide redirect uri. (:issue:`58`)
+
+.. _changelog-1.4.0:
+
+1.4.0 / (2022-03-14)
+--------------------
+
+- Default ``use_local_webserver`` to ``True``. Google has deprecated the
+ ``use_local_webserver = False`` `"out of band" (copy-paste) flow
+
<https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob>`_.
+ The ``use_local_webserver = False`` option is planned to stop working in
+ October 2022.
+
+.. _changelog-1.3.0:
+
+1.3.0 / (2021-12-03)
+--------------------
+
+- Adds support for Python 3.10. (:issue:`51`)
+- Fixes typo in documentation. (:issue:`44`)
+
+.. _changelog-1.2.0:
+
+1.2.0 / (2021-04-21)
+--------------------
+
+- Adds :func:`pydata_google_auth.load_service_account_credentials` function to
+ get service account credentials from the specified JSON path. (:issue:`39`)
+
.. _changelog-1.1.0:
1.1.0 / (2020-04-23)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/docs/source/conf.py
new/pydata-google-auth-1.8.2/docs/source/conf.py
--- old/pydata-google-auth-1.1.0/docs/source/conf.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/docs/source/conf.py 2023-08-01
19:01:12.000000000 +0200
@@ -61,25 +61,25 @@
master_doc = "index"
# General information about the project.
-project = u"pydata-google-auth"
-copyright = u"2017, PyData Development Team"
-author = u"PyData Development Team"
+project = "pydata-google-auth"
+copyright = "2017, PyData Development Team"
+author = "PyData Development Team"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = u"0.1.0"
+version = "0.1.0"
# The full version, including alpha/beta/rc tags.
-release = u"0.1.0"
+release = "0.1.0"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
-language = None
+language = "en"
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
@@ -184,6 +184,10 @@
#
# html_extra_path = []
+html_js_files = [
+ "js/authcodescripts.js",
+]
+
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
@@ -282,8 +286,8 @@
(
master_doc,
"pydata-google-auth.tex",
- u"pydata-google-auth Documentation",
- u"PyData Development Team",
+ "pydata-google-auth Documentation",
+ "PyData Development Team",
"manual",
)
]
@@ -326,7 +330,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, "pydata-google-auth", u"pydata-google-auth Documentation",
[author], 1)
+ (master_doc, "pydata-google-auth", "pydata-google-auth Documentation",
[author], 1)
]
# If true, show URL addresses after external links.
@@ -349,7 +353,7 @@
(
master_doc,
"pydata-google-auth",
- u"pydata-google-auth Documentation",
+ "pydata-google-auth Documentation",
author,
"pydata-google-auth",
"One line description of project.",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/docs/source/intro.rst
new/pydata-google-auth-1.8.2/docs/source/intro.rst
--- old/pydata-google-auth-1.1.0/docs/source/intro.rst 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/docs/source/intro.rst 2023-08-01
19:01:12.000000000 +0200
@@ -24,6 +24,16 @@
Use the :func:`pydata_google_auth.get_user_credentials` to get user
credentials, authenticated to Google APIs.
+By default, pydata-google-auth will listen for the credentials on a local
+webserver, which is used as the redirect page from Google's OAuth 2.0 flow.
+When you set ``use_local_webserver=False``, pydata-google-auth will request
+that you copy a token from the :ref:`oauth-sign-in` page.
+
+.. toctree::
+ :maxdepth: 2
+
+ oauth.rst
+
Default credentials
-------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/docs/source/oauth.rst
new/pydata-google-auth-1.8.2/docs/source/oauth.rst
--- old/pydata-google-auth-1.1.0/docs/source/oauth.rst 1970-01-01
01:00:00.000000000 +0100
+++ new/pydata-google-auth-1.8.2/docs/source/oauth.rst 2023-08-01
19:01:12.000000000 +0200
@@ -0,0 +1,42 @@
+.. image::
https://lh3.googleusercontent.com/n4u3LcbRm3yvTK-EzYqGGtqHBf83KnfY14-3z9mIPRCrIKv-K4ieqJVLYl-yVM7H5EM
+ :alt: pydata logo
+ :class: logo
+
+
+.. _oauth-sign-in:
+
+Sign in to BigQuery
+===================
+
+You are seeing this page because you are attempting to access BigQuery via one
+of several possible methods, including:
+
+ * the ``pydata-google-auth`` library
+
+ OR a ``pandas`` library helper function such as:
+
+ * ``pandas.DataFrame.to_gbq()``
+ * ``pandas.read_gbq()``
+
+from this or another machine. If this is not the case, close this tab.
+
+Enter the following verification code in the CommandLine Interface (CLI) on the
+machine you want to log into. This is a credential **similar to your password**
+and should not be shared with others.
+
+
+.. raw:: html
+
+ <script type="text/javascript">
+ window.addEventListener( "load", onloadoauthcode )
+ </script>
+
+ <div>
+ <code class="auth-code"></code>
+ </div>
+ <br>
+ <button class="copy" aria-live="assertive">Copy</button>
+
+.. hint::
+
+ You can close this tab when youâre done.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/noxfile.py
new/pydata-google-auth-1.8.2/noxfile.py
--- old/pydata-google-auth-1.1.0/noxfile.py 2020-04-23 16:27:51.000000000
+0200
+++ new/pydata-google-auth-1.8.2/noxfile.py 2023-08-01 19:01:12.000000000
+0200
@@ -1,92 +1,197 @@
-"""Nox test automation configuration.
+# -*- coding: utf-8 -*-
+#
+# Copyright 2018 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: https://nox.readthedocs.io/en/latest/
-"""
+# Generated by synthtool. DO NOT EDIT!
+from __future__ import absolute_import
import os
-import os.path
+import pathlib
import shutil
import nox
-latest_python = "3.8"
-python_versions = ["2.7", "3.5", "3.6", "3.7", "3.8"]
+BLACK_VERSION = "black==22.12.0"
+BLACK_PATHS = ["docs", "pydata_google_auth", "tests", "noxfile.py", "setup.py"]
+DEFAULT_PYTHON_VERSION = "3.8"
+SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.8"]
+UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
+
+CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
+
+# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
+nox.options.sessions = [
+ "unit",
+ "system",
+ "cover",
+ "lint",
+ "lint_setup_py",
+ "blacken",
+ "docs",
+]
[email protected](python=latest_python)
+# Error if a python version is missing
+nox.options.error_on_missing_interpreters = True
+
+
[email protected](python=DEFAULT_PYTHON_VERSION)
def lint(session):
"""Run linters.
+
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
-
- session.install("black", "flake8")
- session.install("-e", ".")
- session.run("flake8", "pydata_google_auth")
- session.run("flake8", "tests")
- session.run("black", "--check", ".")
+ session.install("flake8", BLACK_VERSION)
+ session.run(
+ "black",
+ "--check",
+ *BLACK_PATHS,
+ )
+ session.run("flake8", "--append-config", ".flake8", "pydata_google_auth",
"tests")
[email protected](python=latest_python)
[email protected](python=DEFAULT_PYTHON_VERSION)
def blacken(session):
- """Run black.
- Format code to uniform standard.
- """
- session.install("black")
- session.run("black", ".")
+ """Run black. Format code to uniform standard."""
+ session.install(BLACK_VERSION)
+ session.run(
+ "black",
+ *BLACK_PATHS,
+ )
[email protected](python=python_versions)
-def unit(session):
- session.install("mock", "pyfakefs", "pytest", "pytest-cov")
- session.install("-e", ".")
- session.run(
[email protected](python=DEFAULT_PYTHON_VERSION)
+def lint_setup_py(session):
+ """Verify that setup.py is valid (including RST check)."""
+ session.install("docutils", "pygments")
+ session.run("python", "setup.py", "check", "--restructuredtext",
"--strict")
+
+
+def default(session):
+ # Install all test dependencies, then install this package in-place.
+
+ constraints_path = str(
+ CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
+ )
+ session.install(
+ "mock",
+ "pyfakefs",
"pytest",
- os.path.join(".", "tests", "unit"),
+ "pytest-cov",
+ "-c",
+ constraints_path,
+ )
+
+ session.install("-e", ".", "-c", constraints_path)
+
+ # Run py.test against the unit tests.
+ session.run(
+ "py.test",
"--quiet",
+ f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=pydata_google_auth",
- "--cov=tests.unit",
- "--cov-report",
- "xml:/tmp/pytest-cov.xml",
- *session.posargs
+ "--cov=tests/unit",
+ "--cov-append",
+ "--cov-config=.coveragerc",
+ "--cov-report=",
+ "--cov-fail-under=0",
+ os.path.join("tests", "unit"),
+ *session.posargs,
)
[email protected](python=latest_python)
-def cover(session):
- session.install("coverage", "pytest-cov")
- session.run("coverage", "report", "--show-missing", "--fail-under=50")
- session.run("coverage", "erase")
[email protected](python=UNIT_TEST_PYTHON_VERSIONS)
+def unit(session):
+ """Run the unit test suite."""
+ default(session)
[email protected](python=python_versions)
[email protected](python=SYSTEM_TEST_PYTHON_VERSIONS)
def system(session):
- session.install("mock", "pyfakefs", "pytest", "pytest-cov")
- session.install("-e", ".")
+ """Run the system test suite."""
+ constraints_path = str(
+ CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
+ )
+ system_test_path = os.path.join("tests", "system.py")
+ system_test_folder_path = os.path.join("tests", "system")
- # Skip local auth tests on Travis.
- additional_args = list(session.posargs)
- if "TRAVIS_BUILD_DIR" in os.environ:
- additional_args = additional_args + ["-m", "not local_auth"]
+ # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
+ if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
+ session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
+ # Install pyopenssl for mTLS testing.
+ if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":
+ session.install("pyopenssl")
+
+ system_test_exists = os.path.exists(system_test_path)
+ system_test_folder_exists = os.path.exists(system_test_folder_path)
+ # Sanity check: only run tests if found.
+ if not system_test_exists and not system_test_folder_exists:
+ session.skip("System tests were not found")
+
+ # Use pre-release gRPC for system tests.
+ session.install("--pre", "grpcio")
+
+ # Install all test dependencies, then install this package into the
+ # virtualenv's dist-packages.
+ session.install(
+ "mock",
+ "pyfakefs",
+ "pytest",
+ "pytest-cov",
+ "google-cloud-testutils",
+ "-c",
+ constraints_path,
+ )
+ session.install("-e", ".", "-c", constraints_path)
+ # Run py.test against the system tests.
session.run(
- "pytest",
- os.path.join(".", "tests", "system"),
+ "py.test",
"--quiet",
+ f"--junitxml=system_{session.python}_sponge_log.xml",
"--cov=pydata_google_auth",
- "--cov=tests.system",
- "--cov-report",
- "xml:/tmp/pytest-cov.xml",
- *additional_args
+ "--cov=tests/system",
+ "--cov-append",
+ "--cov-config=.coveragerc",
+ "--cov-report=",
+ "--cov-fail-under=0",
+ system_test_folder_path,
+ *session.posargs,
)
[email protected](python=latest_python)
[email protected](python=DEFAULT_PYTHON_VERSION)
+def cover(session):
+ """Run the final coverage report.
+
+ This outputs the coverage report aggregating coverage from the unit
+ test runs (not system test runs), and then erases coverage data.
+ """
+ session.install("coverage", "pytest-cov")
+ session.run("coverage", "report", "--show-missing", "--fail-under=60")
+
+ session.run("coverage", "erase")
+
+
[email protected](python=DEFAULT_PYTHON_VERSION)
def docs(session):
- """Build the docs."""
+ """Build the docs for this library."""
- session.install("sphinx", "sphinx_rtd_theme", "ipython")
+ session.install("sphinx==4.0.2", "sphinx_rtd_theme", "ipython")
session.install("-e", ".")
shutil.rmtree(os.path.join("docs", "source", "_build"), ignore_errors=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pydata-google-auth-1.1.0/pydata_google_auth/__init__.py
new/pydata-google-auth-1.8.2/pydata_google_auth/__init__.py
--- old/pydata-google-auth-1.1.0/pydata_google_auth/__init__.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/pydata_google_auth/__init__.py 2023-08-01
19:01:12.000000000 +0200
@@ -2,6 +2,7 @@
from .auth import get_user_credentials
from .auth import load_user_credentials
from .auth import save_user_credentials
+from .auth import load_service_account_credentials
from ._version import get_versions
versions = get_versions()
@@ -20,4 +21,5 @@
"get_user_credentials",
"load_user_credentials",
"save_user_credentials",
+ "load_service_account_credentials",
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pydata-google-auth-1.1.0/pydata_google_auth/__main__.py
new/pydata-google-auth-1.8.2/pydata_google_auth/__main__.py
--- old/pydata-google-auth-1.1.0/pydata_google_auth/__main__.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/pydata_google_auth/__main__.py 2023-08-01
19:01:12.000000000 +0200
@@ -55,7 +55,7 @@
args.destination,
client_id=args.client_id,
client_secret=args.client_secret,
- use_local_webserver=args.use_local_webserver,
+ use_local_webserver=not args.nouse_local_webserver,
)
@@ -80,7 +80,12 @@
login_parser.add_argument("--client_id", help=LOGIN_CLIENT_ID_HELP)
login_parser.add_argument("--client_secret", help=LOGIN_CLIENT_SECRET_HELP)
login_parser.add_argument(
- "--use_local_webserver", action="store_true",
help=LOGIN_USE_LOCAL_WEBSERVER_HELP
+ "--use_local_webserver",
+ action="store_true",
+ help="Ignored. Defaults to true. To disable, set --nouse_local_webserver
option.",
+)
+login_parser.add_argument(
+ "--nouse_local_webserver", action="store_true",
help=LOGIN_USE_LOCAL_WEBSERVER_HELP
)
print_token_parser = subparsers.add_parser(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pydata-google-auth-1.1.0/pydata_google_auth/_version.py
new/pydata-google-auth-1.8.2/pydata_google_auth/_version.py
--- old/pydata-google-auth-1.1.0/pydata_google_auth/_version.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/pydata_google_auth/_version.py 2023-08-01
19:01:12.000000000 +0200
@@ -22,9 +22,9 @@
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (tag: 1.1.0)"
- git_full = "c224a80372d17ab1e803c9dfc6a2ffc282d0dc49"
- git_date = "2020-04-23 09:27:51 -0500"
+ git_refnames = " (HEAD -> main, tag: 1.8.2)"
+ git_full = "7f66a8e6537594ecaab3d906a0d3b415dc8b79b4"
+ git_date = "2023-08-01 12:01:12 -0500"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pydata-google-auth-1.1.0/pydata_google_auth/_webserver.py
new/pydata-google-auth-1.8.2/pydata_google_auth/_webserver.py
--- old/pydata-google-auth-1.1.0/pydata_google_auth/_webserver.py
2020-04-23 16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/pydata_google_auth/_webserver.py
2023-08-01 19:01:12.000000000 +0200
@@ -64,7 +64,7 @@
return None
-def run_local_server(app_flow):
+def run_local_server(app_flow, **kwargs):
"""Run local webserver installed app flow on some open port.
Parameters
@@ -86,4 +86,4 @@
port = find_open_port()
if not port:
raise exceptions.PyDataConnectionError("Could not find open port.")
- return app_flow.run_local_server(host=LOCALHOST, port=port)
+ return app_flow.run_local_server(host=LOCALHOST, port=port, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/pydata_google_auth/auth.py
new/pydata-google-auth-1.8.2/pydata_google_auth/auth.py
--- old/pydata-google-auth-1.1.0/pydata_google_auth/auth.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/pydata_google_auth/auth.py 2023-08-01
19:01:12.000000000 +0200
@@ -16,19 +16,59 @@
logger = logging.getLogger(__name__)
-CLIENT_ID =
"262006177488-3425ks60hkk80fssi9vpohv88g6q1iqd.apps.googleusercontent.com"
-CLIENT_SECRET = "JSF-iczmzEgbTR-XK-2xaWAc"
+DESKTOP_CLIENT_ID = (
+ "262006177488-3425ks60hkk80fssi9vpohv88g6q1iqd.apps.googleusercontent.com"
+)
+DESKTOP_CLIENT_SECRET = "JSF-iczmzEgbTR-XK-2xaWAc"
+
+# webapp CID/CS to enable a redirect uri/client id/secret that is not OOB.
+WEBAPP_REDIRECT_URI =
"https://pydata-google-auth.readthedocs.io/en/latest/oauth.html"
+WEBAPP_CLIENT_ID = (
+ "262006177488-ka1m0ue4fptfmt9siejdd5lom7p39upa.apps.googleusercontent.com"
+)
+WEBAPP_CLIENT_SECRET = "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"
+
GOOGLE_AUTH_URI = "https://accounts.google.com/o/oauth2/auth"
GOOGLE_TOKEN_URI = "https://oauth2.googleapis.com/token"
+AUTH_URI_KWARGS = {
+ # Ensure that we get a refresh token by telling Google we want to assume
+ # this is first time we're authorizing this app. See:
+ #
https://github.com/googleapis/google-api-python-client/issues/213#issuecomment-205886341
+ "prompt": "consent",
+}
+
+
+def _run_webapp(flow, redirect_uri=None, **kwargs):
+
+ if redirect_uri:
+ flow.redirect_uri = redirect_uri
+ else:
+ flow.redirect_uri = flow._OOB_REDIRECT_URI
+
+ auth_url, _ = flow.authorization_url(**kwargs)
+ authorization_prompt_message = (
+ "Please visit this URL to authorize this application: {url}"
+ )
+
+ if authorization_prompt_message:
+ print(authorization_prompt_message.format(url=auth_url))
+
+ authorization_code_message = "Enter the authorization code: "
+
+ code = input(authorization_code_message)
+ flow.fetch_token(code=code)
+ return flow.credentials
+
def default(
scopes,
client_id=None,
client_secret=None,
credentials_cache=cache.READ_WRITE,
- use_local_webserver=False,
+ use_local_webserver=True,
auth_local_webserver=None,
+ redirect_uri=None,
):
"""
Get credentials and default project for accessing Google APIs.
@@ -76,6 +116,14 @@
``False``, which requests a token via the console.
auth_local_webserver : deprecated
Use the ``use_local_webserver`` parameter instead.
+ redirect_uri : str, optional
+ Redirect URIs are endpoints to which the OAuth 2.0 server can send
+ responses. They may be used in situations such as
+
+ * an organization has an org specific authentication endpoint
+ * an organization can not use an endpoint directly because of
+ constraints on access to the internet (i.e. when running code on a
+ remotely hosted device).
Returns
-------
@@ -107,6 +155,7 @@
client_secret=client_secret,
credentials_cache=credentials_cache,
use_local_webserver=use_local_webserver,
+ redirect_uri=redirect_uri,
)
if not credentials or not credentials.valid:
@@ -115,6 +164,28 @@
return credentials, None
+def _ensure_application_default_credentials_in_colab_environment():
+ # This is a special handling for google colab environment where we want to
+ # use the colab specific authentication flow
+ #
https://github.com/googlecolab/colabtools/blob/3c8772efd332289e1c6d1204826b0915d22b5b95/google/colab/auth.py#L209
+ try:
+ from google.colab import auth
+
+ auth.authenticate_user()
+ except Exception:
+ # We are catching a broad exception class here because we want to be
+ # agnostic to anything that could internally go wrong in the google
+ # colab auth. Some of the known exception we want to pass on are:
+ #
+ # ModuleNotFoundError: No module named 'google.colab'
+ # ImportError: cannot import name 'auth' from 'google.cloud'
+ # MessageError: Error: credential propagation was unsuccessful
+ #
+ # The MessageError happens on Vertex Colab when it fails to resolve
auth
+ # from the Compute Engine Metadata server.
+ pass
+
+
def get_application_default_credentials(scopes):
"""
This method tries to retrieve the "default application credentials".
@@ -136,6 +207,8 @@
have access to the project (project_id) on BigQuery.
"""
+ _ensure_application_default_credentials_in_colab_environment()
+
try:
credentials, project = google.auth.default(scopes=scopes)
except (google.auth.exceptions.DefaultCredentialsError, IOError) as exc:
@@ -161,8 +234,9 @@
client_id=None,
client_secret=None,
credentials_cache=cache.READ_WRITE,
- use_local_webserver=False,
+ use_local_webserver=True,
auth_local_webserver=None,
+ redirect_uri=None,
):
"""
Gets user account credentials.
@@ -177,7 +251,7 @@
``PyData Google Auth``. The permissions it requests correspond to the
scopes you've provided.
- Additional information on the user credentails authentication mechanism
+ Additional information on the user credentials authentication mechanism
can be found `here
<https://developers.google.com/identity/protocols/OAuth2#clientside/>`__.
@@ -219,6 +293,14 @@
``False``, which requests a token via the console.
auth_local_webserver : deprecated
Use the ``use_local_webserver`` parameter instead.
+ redirect_uri : str, optional
+ Redirect URIs are endpoints to which the OAuth 2.0 server can send
+ responses. They may be used in situations such as
+
+ * an organization has an org specific authentication endpoint
+ * an organization can not use an endpoint directly because of
+ constraints on access to the internet (i.e. when running code on a
+ remotely hosted device).
Returns
-------
@@ -237,10 +319,26 @@
# aren't included in the docs. A string of bytes isn't useful for the
# documentation and might encourage the values to be used outside of this
# library.
- if client_id is None:
- client_id = CLIENT_ID
- if client_secret is None:
- client_secret = CLIENT_SECRET
+
+ if use_local_webserver:
+ if client_id is None:
+ client_id = DESKTOP_CLIENT_ID
+ if client_secret is None:
+ client_secret = DESKTOP_CLIENT_SECRET
+
+ elif not use_local_webserver and not redirect_uri:
+ if client_id is None:
+ client_id = WEBAPP_CLIENT_ID
+ if client_secret is None:
+ client_secret = WEBAPP_CLIENT_SECRET
+ redirect_uri = WEBAPP_REDIRECT_URI
+
+ elif not use_local_webserver and redirect_uri:
+ if (client_id is None) or (client_secret is None):
+ raise exceptions.PyDataCredentialsError(
+ """Unable to get valid credentials: please provide a
+valid client_id and/or client_secret."""
+ )
credentials = credentials_cache.load()
@@ -248,7 +346,7 @@
"installed": {
"client_id": client_id,
"client_secret": client_secret,
- "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob"],
+ "redirect_uris": [redirect_uri, "urn:ietf:wg:oauth:2.0:oob"],
"auth_uri": GOOGLE_AUTH_URI,
"token_uri": GOOGLE_TOKEN_URI,
}
@@ -261,9 +359,12 @@
try:
if use_local_webserver:
- credentials = _webserver.run_local_server(app_flow)
+ credentials = _webserver.run_local_server(app_flow,
**AUTH_URI_KWARGS)
else:
- credentials = app_flow.run_console()
+ credentials = _run_webapp(
+ app_flow, redirect_uri=redirect_uri, **AUTH_URI_KWARGS
+ )
+
except oauthlib.oauth2.rfc6749.errors.OAuth2Error as exc:
raise exceptions.PyDataCredentialsError(
"Unable to get valid credentials: {}".format(exc)
@@ -279,7 +380,7 @@
def save_user_credentials(
- scopes, path, client_id=None, client_secret=None, use_local_webserver=False
+ scopes, path, client_id=None, client_secret=None, use_local_webserver=True
):
"""
Gets user account credentials and saves them to a JSON file at ``path``.
@@ -402,3 +503,51 @@
if not credentials:
raise exceptions.PyDataCredentialsError("Could not load credentials.")
return credentials
+
+
+def load_service_account_credentials(path, scopes=None):
+ """
+ Gets service account credentials from JSON file at ``path``.
+
+ Parameters
+ ----------
+ path : str
+ Path to credentials JSON file.
+ scopes : list[str], optional
+ A list of scopes to use when authenticating to Google APIs. See the
+ `list of OAuth 2.0 scopes for Google APIs
+ <https://developers.google.com/identity/protocols/googlescopes>`_.
+
+ Returns
+ -------
+
+ google.oauth2.service_account.Credentials
+
+ Raises
+ ------
+ pydata_google_auth.exceptions.PyDataCredentialsError
+ If unable to load service credentials.
+
+ Examples
+ --------
+
+ Load credentials and use them to construct a BigQuery client.
+
+ .. code-block:: python
+
+ import pydata_google_auth
+ import google.cloud.bigquery
+
+ credentials = pydata_google_auth.load_service_account_credentials(
+ "/home/username/keys/google-service-account-credentials.json",
+ )
+ client = google.cloud.bigquery.BigQueryClient(
+ credentials=credentials,
+ project=credentials.project_id
+ )
+ """
+
+ credentials = cache._load_service_account_credentials_from_file(path,
scopes=scopes)
+ if not credentials:
+ raise exceptions.PyDataCredentialsError("Could not load credentials.")
+ return credentials
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/pydata_google_auth/cache.py
new/pydata-google-auth-1.8.2/pydata_google_auth/cache.py
--- old/pydata-google-auth-1.1.0/pydata_google_auth/cache.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/pydata_google_auth/cache.py 2023-08-01
19:01:12.000000000 +0200
@@ -7,6 +7,7 @@
import os.path
import google.oauth2.credentials
+from google.oauth2 import service_account
logger = logging.getLogger(__name__)
@@ -123,6 +124,35 @@
logger.warning("Unable to save credentials.")
+def _load_service_account_credentials_from_file(credentials_path, **kwargs):
+ try:
+ with open(credentials_path) as credentials_file:
+ credentials_json = json.load(credentials_file)
+ except (IOError, ValueError) as exc:
+ logger.debug(
+ "Error loading credentials from {}: {}".format(credentials_path,
str(exc))
+ )
+ return None
+
+ return _load_service_account_credentials_from_info(credentials_json,
**kwargs)
+
+
+def _load_service_account_credentials_from_info(credentials_json, **kwargs):
+ credentials = service_account.Credentials.from_service_account_info(
+ credentials_json, **kwargs
+ )
+ if not credentials.valid:
+ request = google.auth.transport.requests.Request()
+ try:
+ credentials.refresh(request)
+ except google.auth.exceptions.RefreshError as exc:
+ # Credentials could be expired or revoked.
+ logger.debug("Error refreshing credentials: {}".format(str(exc)))
+ return None
+
+ return credentials
+
+
class CredentialsCache(object):
"""
Shared base class for crentials classes.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/release-procedure.md
new/pydata-google-auth-1.8.2/release-procedure.md
--- old/pydata-google-auth-1.1.0/release-procedure.md 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/release-procedure.md 2023-08-01
19:01:12.000000000 +0200
@@ -1,15 +1,19 @@
+# Releasing pydata-google-auth
+
+* Update the CHANGELOG. Example:
https://github.com/pydata/pydata-google-auth/pull/60
+
* Tag commit
git tag -a x.x.x -m 'Version x.x.x'
* and push to github
- git push upstream master --tags
+ git push upstream main --tags
* Build the package
git clean -xfd
- python setup.py register sdist bdist_wheel --universal
+ python setup.py sdist bdist_wheel --universal
* Upload to test PyPI
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/setup.py
new/pydata-google-auth-1.8.2/setup.py
--- old/pydata-google-auth-1.1.0/setup.py 2020-04-23 16:27:51.000000000
+0200
+++ new/pydata-google-auth-1.8.2/setup.py 2023-08-01 19:01:12.000000000
+0200
@@ -16,7 +16,13 @@
return f.read()
-INSTALL_REQUIRES = ["setuptools", "google-auth", "google-auth-oauthlib"]
+INSTALL_REQUIRES = [
+ "setuptools",
+ "google-auth >=1.25.0, <2.0dev; python_version<'3.0'",
+ "google-auth >=1.25.0, <3.0dev; python_version>='3.6'",
+ "google-auth-oauthlib >=0.4.0, <0.4.2dev; python_version<'3.0'",
+ "google-auth-oauthlib >=0.4.0; python_version>='3.6'",
+]
setup(
name=NAME,
@@ -41,6 +47,8 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: BSD License",
],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/testing/.gitignore
new/pydata-google-auth-1.8.2/testing/.gitignore
--- old/pydata-google-auth-1.1.0/testing/.gitignore 1970-01-01
01:00:00.000000000 +0100
+++ new/pydata-google-auth-1.8.2/testing/.gitignore 2023-08-01
19:01:12.000000000 +0200
@@ -0,0 +1,3 @@
+test-env.sh
+service-account.json
+client-secrets.json
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/testing/constraints-2.7.txt
new/pydata-google-auth-1.8.2/testing/constraints-2.7.txt
--- old/pydata-google-auth-1.1.0/testing/constraints-2.7.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/pydata-google-auth-1.8.2/testing/constraints-2.7.txt 2023-08-01
19:01:12.000000000 +0200
@@ -0,0 +1,9 @@
+# This constraints file is used to check that lower bounds
+# are correct in setup.py
+# List *all* library dependencies and extras in this file.
+# Pin the version to the lower bound.
+#
+# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
+# Then this file should have foo==1.14.0
+google-auth==1.25.0
+google-auth-oauthlib==0.4.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/testing/constraints-3.6.txt
new/pydata-google-auth-1.8.2/testing/constraints-3.6.txt
--- old/pydata-google-auth-1.1.0/testing/constraints-3.6.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/pydata-google-auth-1.8.2/testing/constraints-3.6.txt 2023-08-01
19:01:12.000000000 +0200
@@ -0,0 +1,9 @@
+# This constraints file is used to check that lower bounds
+# are correct in setup.py
+# List *all* library dependencies and extras in this file.
+# Pin the version to the lower bound.
+#
+# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
+# Then this file should have foo==1.14.0
+google-auth==1.25.0
+google-auth-oauthlib==0.4.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pydata-google-auth-1.1.0/tests/unit/test_auth.py
new/pydata-google-auth-1.8.2/tests/unit/test_auth.py
--- old/pydata-google-auth-1.1.0/tests/unit/test_auth.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/tests/unit/test_auth.py 2023-08-01
19:01:12.000000000 +0200
@@ -10,6 +10,7 @@
import google.oauth2.credentials
import pytest
+from google.oauth2 import service_account
from pydata_google_auth import exceptions
@@ -56,6 +57,33 @@
assert credentials is mock_user_credentials
+class FakeCredentials(object):
+ @property
+ def valid(self):
+ return True
+
+
+def test_load_service_account_credentials(monkeypatch, tmp_path,
module_under_test):
+ creds_path = str(tmp_path / "creds.json")
+ with open(creds_path, "w") as stream:
+ stream.write("{}")
+
+ fake_creds = FakeCredentials()
+ mock_service = mock.create_autospec(service_account.Credentials)
+ mock_service.from_service_account_info.return_value = fake_creds
+ monkeypatch.setattr(service_account, "Credentials", mock_service)
+
+ creds = module_under_test.load_service_account_credentials(creds_path)
+ assert creds is fake_creds
+
+
def
test_load_user_credentials_raises_when_file_doesnt_exist(module_under_test):
with pytest.raises(exceptions.PyDataCredentialsError):
module_under_test.load_user_credentials("path/not/found.json")
+
+
+def test_load_service_account_credentials_raises_when_file_doesnt_exist(
+ module_under_test,
+):
+ with pytest.raises(exceptions.PyDataCredentialsError):
+
module_under_test.load_service_account_credentials("path/not/found.json")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pydata-google-auth-1.1.0/tests/unit/test_webserver.py
new/pydata-google-auth-1.8.2/tests/unit/test_webserver.py
--- old/pydata-google-auth-1.1.0/tests/unit/test_webserver.py 2020-04-23
16:27:51.000000000 +0200
+++ new/pydata-google-auth-1.8.2/tests/unit/test_webserver.py 2023-08-01
19:01:12.000000000 +0200
@@ -56,7 +56,7 @@
google_auth_oauthlib.flow.InstalledAppFlow, instance=True
)
module_under_test.run_local_server(mock_flow)
- mock_flow.run_local_server.assert_called_once_with(host="localhost",
port=8080)
+ mock_flow.run_local_server.assert_called_once_with(host="localhost",
port=mock.ANY)
def test_run_local_server_raises_connectionerror(monkeypatch,
module_under_test):