Skip to content

CLN: Drop support for Python 2. #273

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 1 commit into from
Apr 19, 2019
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
9 changes: 0 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
version: 2
jobs:
# Pip
"pip-2.7":
docker:
- image: thekevjames/nox
steps:
- checkout
- run: ci/config_auth.sh
- run: nox -s unit-2.7 system-2.7

"pip-3.5":
docker:
- image: thekevjames/nox
Expand Down Expand Up @@ -60,7 +52,6 @@ workflows:
version: 2
build:
jobs:
- "pip-2.7"
- "pip-3.5"
- "pip-3.6"
- "pip-3.7"
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include MANIFEST.in
include README.rst
include LICENSE.md
include AUTHORS.md
include LICENSE.txt
include setup.py

graft pandas_gbq
Expand Down
6 changes: 0 additions & 6 deletions ci/requirements-2.7.pip

This file was deleted.

9 changes: 9 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

.. _changelog-0.11.0:

0.11.0 / TBD
------------

- **Breaking Change:** Python 2 support has been dropped. This is to align
with the pandas package which dropped Python 2 support at the end of 2019.
(:issue:`268`)

.. _changelog-0.10.0:

0.10.0 / 2019-04-05
Expand Down
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import nox


supported_pythons = ["2.7", "3.5", "3.6", "3.7"]
latest_python = "3.6"
supported_pythons = ["3.5", "3.6", "3.7"]
latest_python = "3.7"


@nox.session
Expand All @@ -31,7 +31,7 @@ def blacken(session):

@nox.session(python=supported_pythons)
def unit(session):
session.install("mock", "pytest", "pytest-cov")
session.install("pytest", "pytest-cov")
session.install("-e", ".")
session.run(
"pytest",
Expand Down
6 changes: 1 addition & 5 deletions pandas_gbq/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import os
import os.path

import pandas.compat

import pandas_gbq.exceptions

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -72,9 +70,7 @@ def get_service_account_credentials(private_key):
" ", "\n"
)

if pandas.compat.PY3:
json_key["private_key"] = bytes(json_key["private_key"], "UTF-8")

json_key["private_key"] = bytes(json_key["private_key"], "UTF-8")
credentials = Credentials.from_service_account_info(json_key)
credentials = credentials.with_scopes(SCOPES)

Expand Down
2 changes: 1 addition & 1 deletion release-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Build the package

git clean -xfd
python setup.py register sdist bdist_wheel --universal
python setup.py register sdist bdist_wheel

* Upload to test PyPI

Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def readme():
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
Expand Down
6 changes: 2 additions & 4 deletions tests/system/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""System tests for fetching Google BigQuery credentials."""

try:
import mock
except ImportError: # pragma: NO COVER
from unittest import mock
from unittest import mock

import pytest

from pandas_gbq import auth
Expand Down
12 changes: 3 additions & 9 deletions tests/system/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import pandas
import pandas.api.types
import pandas.util.testing as tm
from pandas import DataFrame, NaT, compat
from pandas.compat import range, u
from pandas import DataFrame, NaT
import pytest
import pytz

Expand Down Expand Up @@ -447,13 +446,8 @@ def test_should_properly_handle_nullable_booleans(self, project_id):
)

def test_unicode_string_conversion_and_normalization(self, project_id):
correct_test_datatype = DataFrame({"unicode_string": [u("\xe9\xfc")]})

unicode_string = "\xc3\xa9\xc3\xbc"

if compat.PY3:
unicode_string = unicode_string.encode("latin-1").decode("utf8")

correct_test_datatype = DataFrame({"unicode_string": ["éü"]})
unicode_string = "éü"
query = 'SELECT "{0}" AS unicode_string'.format(unicode_string)

df = gbq.read_gbq(
Expand Down
5 changes: 1 addition & 4 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-

try:
from unittest import mock
except ImportError: # pragma: NO COVER
import mock
from unittest import mock

import pytest

Expand Down
5 changes: 1 addition & 4 deletions tests/unit/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

from pandas_gbq import auth

try:
import mock
except ImportError: # pragma: NO COVER
from unittest import mock
from unittest import mock


def test_get_credentials_private_key_contents(monkeypatch):
Expand Down
5 changes: 1 addition & 4 deletions tests/unit/test_context.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-

try:
from unittest import mock
except ImportError: # pragma: NO COVER
import mock
from unittest import mock

import pytest

Expand Down
5 changes: 1 addition & 4 deletions tests/unit/test_gbq.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-

try:
import mock
except ImportError: # pragma: NO COVER
from unittest import mock
from unittest import mock

import numpy
from pandas import DataFrame
Expand Down