Skip to content

Commit 2d50519

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pr-127-maxim-lian-default-project
2 parents a7f6c43 + 187a57f commit 2d50519

23 files changed

+641
-200
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ dist
6969
**/wheelhouse/*
7070
# coverage
7171
.coverage
72+
.nox
7273

7374
# OS generated files #
7475
######################

.travis.yml

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,53 @@ sudo: false
33
language: python
44

55
env:
6-
- PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='true' AUTH='s_path'
7-
- PYTHON=3.5 PANDAS=0.18.1 COVERAGE='true' LINT='false' AUTH='s_path'
8-
- PYTHON=3.6 PANDAS=0.20.1 COVERAGE='false' LINT='false' AUTH='s_cred'
9-
- PYTHON=3.6 PANDAS=MASTER COVERAGE='false' LINT='true' AUTH='s_cred'
6+
- PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='true' PYENV_VERSION=2.7.14
7+
- PYTHON=3.5 PANDAS=0.18.1 COVERAGE='true' LINT='false' PYENV_VERSION=3.5.4
8+
- PYTHON=3.6 PANDAS=0.20.1 COVERAGE='false' LINT='false' PYENV_VERSION=3.6.1
9+
- PYTHON=3.6 PANDAS=MASTER COVERAGE='false' LINT='true' PYENV_VERSION=3.6.1
1010

1111
before_install:
1212
- echo "before_install"
1313
- source ci/travis_process_gbq_encryption.sh
1414

1515
install:
16-
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
17-
- bash miniconda.sh -b -p $HOME/miniconda
18-
- export PATH="$HOME/miniconda/bin:$PATH"
19-
- hash -r
20-
- conda config --set always_yes yes --set changeps1 no
21-
- conda config --add channels pandas
22-
- conda config --add channels conda-forge
23-
- conda update -q conda
24-
- conda info -a
25-
- conda create -q -n test-environment python=$PYTHON
26-
- source activate test-environment
27-
- if [[ "$PANDAS" == "MASTER" ]]; then
28-
conda install -q numpy pytz python-dateutil;
29-
PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com";
30-
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS pandas;
16+
# work around https://github.com/travis-ci/travis-ci/issues/8363
17+
# https://github.com/pre-commit/pre-commit/commit/e3ab8902692e896da9ded42bd4d76ea4e1de359d
18+
- pyenv install -s $PYENV_VERSION
19+
- pyenv global system $PYENV_VERSION
20+
# Upgrade setuptools and pip to work around
21+
# https://github.com/pypa/setuptools/issues/885
22+
- pip install --upgrade setuptools
23+
- pip install --upgrade pip
24+
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
25+
if [ -f "$REQ.pip" ]; then
26+
pip install --upgrade nox-automation ;
3127
else
28+
wget http://repo.continuum.io/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh -O miniconda.sh;
29+
bash miniconda.sh -b -p $HOME/miniconda ;
30+
export PATH="$HOME/miniconda/bin:$PATH" ;
31+
hash -r ;
32+
conda config --set always_yes yes --set changeps1 no ;
33+
conda config --add channels pandas ;
34+
conda config --add channels conda-forge ;
35+
conda update -q conda ;
36+
conda info -a ;
37+
conda create -q -n test-environment python=$PYTHON ;
38+
source activate test-environment ;
39+
conda install -q setuptools ;
3240
conda install -q pandas=$PANDAS;
33-
fi
34-
- pip install coverage pytest pytest-cov flake8 codecov
35-
- REQ="ci/requirements-${PYTHON}-${PANDAS}"
36-
- if [ -f "$REQ.pip" ]; then
37-
pip install -r "$REQ.pip";
38-
else
3941
conda install -q --file "$REQ.conda";
42+
conda list ;
43+
python setup.py install ;
4044
fi
41-
- conda list
42-
- python setup.py install
4345

4446
script:
45-
- if [[ $AUTH == 's_path' ]]; then pytest -m 'not local_auth and not s_cred_auth' -v --cov=pandas_gbq --cov-report xml:/tmp/pytest-cov.xml pandas_gbq ; fi
46-
- if [[ $AUTH == 's_cred' ]]; then pytest -m 'not local_auth and not s_path_auth' -v --cov=pandas_gbq --cov-report xml:/tmp/pytest-cov.xml pandas_gbq ; fi
47-
- if [[ $COVERAGE == 'true' ]]; then codecov ; fi
48-
- if [[ $LINT == 'true' ]]; then flake8 pandas_gbq -v ; fi
47+
- if [[ $PYTHON == '2.7' ]]; then nox -s test27 ; fi
48+
- if [[ $PYTHON == '3.5' ]]; then nox -s test35 ; fi
49+
- if [[ $PYTHON == '3.6' ]] && [[ "$PANDAS" == "MASTER" ]]; then nox -s test36master ; fi
50+
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
51+
if [ -f "$REQ.conda" ]; then
52+
pytest -v tests ;
53+
fi
54+
- if [[ $COVERAGE == 'true' ]]; then nox -s cover ; fi
55+
- if [[ $LINT == 'true' ]]; then nox -s lint ; fi

ci/requirements-3.5-0.18.1.pip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
google-auth==1.4.1
22
google-auth-oauthlib==0.0.1
3-
mock
43
google-cloud-bigquery==0.29.0

ci/requirements-3.6-0.20.1.conda

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
google-auth
22
google-auth-oauthlib
3-
mock
4-
google-cloud-bigquery
3+
google-cloud-bigquery==0.32.0
4+
pytest
5+
pytest-cov
6+
codecov
7+
coverage
8+
flake8

ci/requirements-3.6-MASTER.pip

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
google-auth
22
google-auth-oauthlib
3-
mock
4-
google-cloud-bigquery
3+
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=api_core
4+
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=core
5+
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=bigquery

docs/source/api.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
API Reference
66
*************
77

8+
.. note::
9+
10+
Only functions and classes which are members of the ``pandas_gbq`` module
11+
are considered public. Submodules and their members are considered private.
12+
813
.. autosummary::
914

1015
read_gbq

docs/source/changelog.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
Changelog
22
=========
33

4-
0.3.2 / [TBD]
4+
0.5.0 / TBD
5+
-----------
6+
7+
- Tests now use `nox` to run in multiple Python environments. (:issue:`52`)
8+
- Renamed internal modules. (:issue:`154`)
9+
10+
0.4.1 / 2018-04-05
11+
------------------
12+
13+
- Only show ``verbose`` deprecation warning if Pandas version does not
14+
populate it. (:issue:`157`)
15+
16+
0.4.0 / 2018-04-03
517
------------------
6-
- Fix bug with querying for an array of floats (:issue:`123`)
18+
19+
- Fix bug in `read_gbq` when building a dataframe with integer columns
20+
on Windows. Explicitly use 64bit integers when converting from BQ types.
21+
(:issue:`119`)
22+
- Fix bug in `read_gbq` when querying for an array of floats (:issue:`123`)
23+
- Fix bug in `read_gbq` with configuration argument. Updates `read_gbq` to
24+
account for breaking change in the way ``google-cloud-python`` version
25+
0.32.0+ handles query configuration API representation. (:issue:`152`)
26+
- Fix bug in `to_gbq` where seconds were discarded in timestamp columns.
27+
(:issue:`148`)
28+
- Fix bug in `to_gbq` when supplying a user-defined schema (:issue:`150`)
29+
- **Deprecate** the ``verbose`` parameter in `read_gbq` and `to_gbq`.
30+
Messages use the logging module instead of printing progress directly to
31+
standard output. (:issue:`12`)
732

833
0.3.1 / 2018-02-13
934
------------------

docs/source/contributing.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,24 +250,38 @@ Running the test suite
250250
The tests can then be run directly inside your Git clone (without having to
251251
install *pandas-gbq*) by typing::
252252

253-
pytest pandas_gbq
253+
pytest tests/unit
254+
pytest tests/system.py
254255

255256
The tests suite is exhaustive and takes around 20 minutes to run. Often it is
256257
worth running only a subset of tests first around your changes before running the
257258
entire suite.
258259

259260
The easiest way to do this is with::
260261

261-
pytest pandas_gbq/path/to/test.py -k regex_matching_test_name
262+
pytest tests/path/to/test.py -k regex_matching_test_name
262263

263264
Or with one of the following constructs::
264265

265-
pytest pandas_gbq/tests/[test-module].py
266-
pytest pandas_gbq/tests/[test-module].py::[TestClass]
267-
pytest pandas_gbq/tests/[test-module].py::[TestClass]::[test_method]
266+
pytest tests/[test-module].py
267+
pytest tests/[test-module].py::[TestClass]
268+
pytest tests/[test-module].py::[TestClass]::[test_method]
268269

269270
For more, see the `pytest <http://doc.pytest.org/en/latest/>`_ documentation.
270271

272+
Testing on multiple Python versions
273+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
274+
275+
pandas-gbq uses `nox <https://nox.readthedocs.io>`__ to automate testing in
276+
multiple Python environments. First, install nox.
277+
278+
.. code-block:: shell
279+
280+
$ pip install --upgrade nox-automation
281+
282+
To run tests in all versions of Python, run `nox` from the repository's root
283+
directory.
284+
271285
.. _contributing.gbq_integration_tests:
272286

273287
Running Google BigQuery Integration Tests

nox.py

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
"""Nox test automation configuration.
2+
3+
See: https://nox.readthedocs.io/en/latest/
4+
"""
5+
6+
import os.path
7+
8+
import nox
9+
10+
11+
PANDAS_PRE_WHEELS = (
12+
'https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83'
13+
'.ssl.cf2.rackcdn.com')
14+
15+
16+
@nox.session
17+
def default(session):
18+
session.install('mock', 'pytest', 'pytest-cov')
19+
session.install('-e', '.')
20+
session.run(
21+
'pytest',
22+
os.path.join('.', 'tests', 'unit'),
23+
os.path.join('.', 'tests', 'system.py'),
24+
'--quiet',
25+
'--cov=pandas_gbq',
26+
'--cov=tests.unit',
27+
'--cov-report',
28+
'xml:/tmp/pytest-cov.xml',
29+
*session.posargs
30+
)
31+
32+
33+
@nox.session
34+
def unit(session):
35+
session.install('mock', 'pytest', 'pytest-cov')
36+
session.install('-e', '.')
37+
session.run(
38+
'pytest',
39+
os.path.join('.', 'tests', 'unit'),
40+
'--quiet',
41+
'--cov=pandas_gbq',
42+
'--cov=tests.unit',
43+
'--cov-report',
44+
'xml:/tmp/pytest-cov.xml',
45+
*session.posargs
46+
)
47+
48+
49+
@nox.session
50+
def test27(session):
51+
session.interpreter = 'python2.7'
52+
session.install(
53+
'-r', os.path.join('.', 'ci', 'requirements-2.7-0.19.2.pip'))
54+
default(session)
55+
56+
57+
@nox.session
58+
def test35(session):
59+
session.interpreter = 'python3.5'
60+
session.install(
61+
'-r', os.path.join('.', 'ci', 'requirements-3.5-0.18.1.pip'))
62+
default(session)
63+
64+
65+
@nox.session
66+
def test36(session):
67+
session.interpreter = 'python3.6'
68+
session.install(
69+
'-r', os.path.join('.', 'ci', 'requirements-3.6-0.20.1.conda'))
70+
default(session)
71+
72+
73+
@nox.session
74+
def test36master(session):
75+
session.interpreter = 'python3.6'
76+
session.install(
77+
'--pre',
78+
'--upgrade',
79+
'--timeout=60',
80+
'-f', PANDAS_PRE_WHEELS,
81+
'pandas')
82+
session.install(
83+
'-r', os.path.join('.', 'ci', 'requirements-3.6-MASTER.pip'))
84+
default(session)
85+
86+
87+
@nox.session
88+
def lint(session):
89+
session.install('flake8')
90+
session.run('flake8', 'pandas_gbq', 'tests', '-v')
91+
92+
93+
@nox.session
94+
def cover(session):
95+
session.interpreter = 'python3.5'
96+
97+
session.install('coverage', 'pytest-cov')
98+
session.run('coverage', 'report', '--show-missing', '--fail-under=40')
99+
session.run('coverage', 'erase')

0 commit comments

Comments
 (0)