Skip to content

Commit e590317

Browse files
authored
CLN: Drop support for Python 2. (#273)
The 0.10.0 package will be the latest version to support Python 2. This aligns pandas-gbq with pandas, which dropped support for Python 2 at the end of 2019.
1 parent f633fa9 commit e590317

File tree

14 files changed

+25
-56
lines changed

14 files changed

+25
-56
lines changed

.circleci/config.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
version: 2
22
jobs:
33
# Pip
4-
"pip-2.7":
5-
docker:
6-
- image: thekevjames/nox
7-
steps:
8-
- checkout
9-
- run: ci/config_auth.sh
10-
- run: nox -s unit-2.7 system-2.7
11-
124
"pip-3.5":
135
docker:
146
- image: thekevjames/nox
@@ -60,7 +52,6 @@ workflows:
6052
version: 2
6153
build:
6254
jobs:
63-
- "pip-2.7"
6455
- "pip-3.5"
6556
- "pip-3.6"
6657
- "pip-3.7"

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include MANIFEST.in
22
include README.rst
3-
include LICENSE.md
3+
include AUTHORS.md
4+
include LICENSE.txt
45
include setup.py
56

67
graft pandas_gbq

ci/requirements-2.7.pip

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/source/changelog.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
=========
33

4+
.. _changelog-0.11.0:
5+
6+
0.11.0 / TBD
7+
------------
8+
9+
- **Breaking Change:** Python 2 support has been dropped. This is to align
10+
with the pandas package which dropped Python 2 support at the end of 2019.
11+
(:issue:`268`)
12+
413
.. _changelog-0.10.0:
514

615
0.10.0 / 2019-04-05

noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import nox
1111

1212

13-
supported_pythons = ["2.7", "3.5", "3.6", "3.7"]
14-
latest_python = "3.6"
13+
supported_pythons = ["3.5", "3.6", "3.7"]
14+
latest_python = "3.7"
1515

1616

1717
@nox.session
@@ -31,7 +31,7 @@ def blacken(session):
3131

3232
@nox.session(python=supported_pythons)
3333
def unit(session):
34-
session.install("mock", "pytest", "pytest-cov")
34+
session.install("pytest", "pytest-cov")
3535
session.install("-e", ".")
3636
session.run(
3737
"pytest",

pandas_gbq/auth.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import os
66
import os.path
77

8-
import pandas.compat
9-
108
import pandas_gbq.exceptions
119

1210
logger = logging.getLogger(__name__)
@@ -72,9 +70,7 @@ def get_service_account_credentials(private_key):
7270
" ", "\n"
7371
)
7472

75-
if pandas.compat.PY3:
76-
json_key["private_key"] = bytes(json_key["private_key"], "UTF-8")
77-
73+
json_key["private_key"] = bytes(json_key["private_key"], "UTF-8")
7874
credentials = Credentials.from_service_account_info(json_key)
7975
credentials = credentials.with_scopes(SCOPES)
8076

release-procedure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Build the package
2222

2323
git clean -xfd
24-
python setup.py register sdist bdist_wheel --universal
24+
python setup.py register sdist bdist_wheel
2525

2626
* Upload to test PyPI
2727

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ def readme():
4343
"Intended Audience :: Science/Research",
4444
"Operating System :: OS Independent",
4545
"Programming Language :: Python",
46-
"Programming Language :: Python :: 2",
47-
"Programming Language :: Python :: 2.7",
4846
"Programming Language :: Python :: 3",
4947
"Programming Language :: Python :: 3.5",
5048
"Programming Language :: Python :: 3.6",

tests/system/test_auth.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
"""System tests for fetching Google BigQuery credentials."""
22

3-
try:
4-
import mock
5-
except ImportError: # pragma: NO COVER
6-
from unittest import mock
3+
from unittest import mock
4+
75
import pytest
86

97
from pandas_gbq import auth

tests/system/test_gbq.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
import pandas
1010
import pandas.api.types
1111
import pandas.util.testing as tm
12-
from pandas import DataFrame, NaT, compat
13-
from pandas.compat import range, u
12+
from pandas import DataFrame, NaT
1413
import pytest
1514
import pytz
1615

@@ -447,13 +446,8 @@ def test_should_properly_handle_nullable_booleans(self, project_id):
447446
)
448447

449448
def test_unicode_string_conversion_and_normalization(self, project_id):
450-
correct_test_datatype = DataFrame({"unicode_string": [u("\xe9\xfc")]})
451-
452-
unicode_string = "\xc3\xa9\xc3\xbc"
453-
454-
if compat.PY3:
455-
unicode_string = unicode_string.encode("latin-1").decode("utf8")
456-
449+
correct_test_datatype = DataFrame({"unicode_string": ["éü"]})
450+
unicode_string = "éü"
457451
query = 'SELECT "{0}" AS unicode_string'.format(unicode_string)
458452

459453
df = gbq.read_gbq(

tests/unit/conftest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
try:
4-
from unittest import mock
5-
except ImportError: # pragma: NO COVER
6-
import mock
3+
from unittest import mock
74

85
import pytest
96

tests/unit/test_auth.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55

66
from pandas_gbq import auth
77

8-
try:
9-
import mock
10-
except ImportError: # pragma: NO COVER
11-
from unittest import mock
8+
from unittest import mock
129

1310

1411
def test_get_credentials_private_key_contents(monkeypatch):

tests/unit/test_context.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
try:
4-
from unittest import mock
5-
except ImportError: # pragma: NO COVER
6-
import mock
3+
from unittest import mock
74

85
import pytest
96

tests/unit/test_gbq.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
try:
4-
import mock
5-
except ImportError: # pragma: NO COVER
6-
from unittest import mock
3+
from unittest import mock
74

85
import numpy
96
from pandas import DataFrame

0 commit comments

Comments
 (0)