Skip to content

Use latest version of Nox for tests. #222

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 2 commits into from
Sep 21, 2018
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
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ matrix:
include:
- os: linux
python: 2.7
env: PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='true'
env: PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='false'
- os: linux
python: 3.5
env: PYTHON=3.5 PANDAS=0.18.1 COVERAGE='true' LINT='false'
Expand All @@ -28,7 +28,7 @@ install:
- pip install --upgrade pip
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
if [ -f "$REQ.pip" ]; then
pip install --upgrade nox-automation ;
pip install --upgrade nox ;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda ;
Expand All @@ -49,9 +49,13 @@ install:
fi

script:
- if [[ $PYTHON == '2.7' ]]; then nox -s test27 ; fi
- if [[ $PYTHON == '3.5' ]]; then nox -s test35 ; fi
- if [[ $PYTHON == '3.6' ]] && [[ "$PANDAS" == "MASTER" ]]; then nox -s test36master ; fi
- if [[ $PYTHON == '2.7' ]]; then
pip install -r ci/requirements-2.7-0.19.2.pip ;
pip install -e . ;
pytest tests/unit ;
fi
- if [[ $PYTHON == '3.5' ]]; then nox -s test_earliest_deps ; fi
- if [[ $PYTHON == '3.6' ]] && [[ "$PANDAS" == "MASTER" ]]; then nox -s test_latest_deps ; fi
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
if [ -f "$REQ.conda" ]; then
pytest --quiet -m 'not local_auth' -v tests ;
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-3.5-0.18.1.pip
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
google-auth==1.4.1
google-auth-oauthlib==0.0.1
google-cloud-bigquery==0.32.0
pandas==0.18.1
118 changes: 64 additions & 54 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,48 +30,49 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.todo',
'numpydoc', # used to parse numpy-style docstrings for autodoc
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_directive',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
]
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.todo",
"numpydoc", # used to parse numpy-style docstrings for autodoc
"IPython.sphinxext.ipython_console_highlighting",
"IPython.sphinxext.ipython_directive",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.ifconfig",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
#
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'pandas-gbq'
copyright = u'2017, PyData Development Team'
author = u'PyData Development Team'
project = u"pandas-gbq"
copyright = u"2017, PyData Development Team"
author = u"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 = u"0.1.0"
# The full version, including alpha/beta/rc tags.
release = u'0.1.0'
release = u"0.1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -92,7 +93,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand All @@ -114,7 +115,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -130,11 +131,12 @@

# Taken from docs.readthedocs.io:
# on_rtd is whether we are on readthedocs.io
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -174,7 +176,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -254,34 +256,36 @@
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'pandas-gbqdoc'
htmlhelp_basename = "pandas-gbqdoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pandas-gbq.tex', u'pandas-gbq Documentation',
u'PyData Development Team', 'manual'),
(
master_doc,
"pandas-gbq.tex",
u"pandas-gbq Documentation",
u"PyData Development Team",
"manual",
)
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -322,8 +326,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pandas-gbq', u'pandas-gbq Documentation',
[author], 1)
(master_doc, "pandas-gbq", u"pandas-gbq Documentation", [author], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -337,9 +340,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pandas-gbq', u'pandas-gbq Documentation',
author, 'pandas-gbq', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"pandas-gbq",
u"pandas-gbq Documentation",
author,
"pandas-gbq",
"One line description of project.",
"Miscellaneous",
)
]

# Documents to append as an appendix to all manuals.
Expand All @@ -361,11 +370,12 @@

# Configuration for intersphinx:
intersphinx_mapping = {
'https://docs.python.org/': None,
'https://pandas.pydata.org/pandas-docs/stable/': None,
'https://google-auth.readthedocs.io/en/latest/': None,
"https://docs.python.org/": None,
"https://pandas.pydata.org/pandas-docs/stable/": None,
"https://google-auth.readthedocs.io/en/latest/": None,
}

extlinks = {'issue': ('https://github.com/pydata/pandas-gbq/issues/%s',
'GH#'),
'pr': ('https://github.com/pydata/pandas-gbq/pull/%s', 'GH#')}
extlinks = {
"issue": ("https://github.com/pydata/pandas-gbq/issues/%s", "GH#"),
"pr": ("https://github.com/pydata/pandas-gbq/pull/%s", "GH#"),
}
49 changes: 18 additions & 31 deletions nox.py → noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
)


latest_python = "3.6"


@nox.session
def default(session):
def test(session):
session.install("mock", "pytest", "pytest-cov")
session.install("-e", ".")

Expand Down Expand Up @@ -53,54 +56,38 @@ def unit(session):


@nox.session
def test27(session):
session.interpreter = "python2.7"
session.install(
"-r", os.path.join(".", "ci", "requirements-2.7-0.19.2.pip")
)
default(session)


@nox.session
def test35(session):
session.interpreter = "python3.5"
def test_earliest_deps(session, python="3.5"):
session.install(
"-r", os.path.join(".", "ci", "requirements-3.5-0.18.1.pip")
)
default(session)
test(session)


@nox.session
def test36(session):
session.interpreter = "python3.6"
session.install(
"-r", os.path.join(".", "ci", "requirements-3.6-0.20.1.conda")
)
default(session)


@nox.session
def test36master(session):
session.interpreter = "python3.6"
def test_latest_deps(session, python=latest_python):
session.install(
"--pre", "--upgrade", "--timeout=60", "-f", PANDAS_PRE_WHEELS, "pandas"
)
session.install(
"-r", os.path.join(".", "ci", "requirements-3.6-MASTER.pip")
)
default(session)
test(session)


@nox.session
def lint(session):
session.install("flake8")
session.run("flake8", "pandas_gbq", "tests", "-v")
def lint(session, python=latest_python):
session.install("black")
session.run(
"black",
"--check",
"--exclude",
"(\.git|\.hg|\.mypy_cache|\.tox|\.nox|\.venv|_build|buck-out|build|dist)",
".",
)


@nox.session
def cover(session):
session.interpreter = "python3.5"

def cover(session, python=latest_python):
session.install("coverage", "pytest-cov")
session.run("coverage", "report", "--show-missing", "--fail-under=40")
session.run("coverage", "erase")
Loading