Skip to content

Commit f4a5f73

Browse files
authored
chore: blacken with 19.10b0 to match shared templates (#386)
* chore: blacken with 19.10b0 to match shared templates * remove unused versioneer file
1 parent 1afeb53 commit f4a5f73

29 files changed

+271
-1112
lines changed

.gitignore

Lines changed: 51 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,64 @@
1-
#########################################
2-
# Editor temporary/working/backup files #
3-
.#*
4-
*\#*\#
5-
[#]*#
6-
*~
7-
*$
8-
*.bak
9-
*flymake*
10-
*.kdev4
11-
*.log
12-
*.swp
13-
*.pdb
14-
.project
15-
.pydevproject
16-
.settings
17-
.idea
18-
.vagrant
19-
.noseids
20-
.ipynb_checkpoints
21-
.tags
22-
.pytest_cache
23-
.testmon*
24-
.vscode/
25-
.env
26-
27-
# Docs #
28-
########
29-
docs/source/_build
1+
*.py[cod]
2+
*.sw[op]
303

31-
# Coverage #
32-
############
33-
.coverage
34-
coverage.xml
35-
coverage_html_report
36-
.pytest_cache
37-
38-
# Compiled source #
39-
###################
40-
*.a
41-
*.com
42-
*.class
43-
*.dll
44-
*.exe
45-
*.pxi
46-
*.o
47-
*.py[ocd]
4+
# C extensions
485
*.so
49-
.build_cache_dir
50-
MANIFEST
51-
__pycache__
526

53-
# Python files #
54-
################
55-
# setup.py working directory
56-
build
57-
# setup.py dist directory
58-
dist
59-
# Egg metadata
7+
# Packages
8+
*.egg
609
*.egg-info
10+
dist
11+
build
12+
eggs
6113
.eggs
62-
.pypirc
14+
parts
15+
bin
16+
var
17+
sdist
18+
develop-eggs
19+
.installed.cfg
20+
lib
21+
lib64
22+
__pycache__
6323

64-
# tox testing tool
65-
.tox
66-
# rope
67-
.ropeproject
68-
# wheel files
69-
*.whl
70-
**/wheelhouse/*
71-
pip-wheel-metadata
24+
# Installer logs
25+
pip-log.txt
7226

73-
# coverage
27+
# Unit test / coverage reports
7428
.coverage
75-
.testmondata
76-
.pytest_cache
7729
.nox
30+
.cache
31+
.pytest_cache
32+
7833

79-
# OS generated files #
80-
######################
81-
.directory
82-
.gdb_history
34+
# Mac
8335
.DS_Store
84-
ehthumbs.db
85-
Icon?
86-
Thumbs.db
8736

88-
# caches #
89-
.cache
37+
# JetBrains
38+
.idea
39+
40+
# VS Code
41+
.vscode
42+
43+
# emacs
44+
*~
45+
46+
# Built documentation
47+
docs/_build
48+
docs/source/_build
49+
bigquery/docs/generated
50+
docs.metadata
51+
52+
# Virtual environment
53+
env/
54+
55+
# Test logs
56+
coverage.xml
57+
*sponge_log.xml
58+
59+
# System test environment variables.
60+
system_tests/local_test_setup
9061

91-
# Credentials #
92-
###############
93-
bigquery_credentials.dat
94-
ci/service_account.json
62+
# Make sure a generated file isn't accidentally committed.
63+
pylintrc
64+
pylintrc.test

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# See https://pre-commit.com for more information
16+
# See https://pre-commit.com/hooks.html for more hooks
17+
repos:
18+
- repo: https://github.com/pre-commit/pre-commit-hooks
19+
rev: v4.0.1
20+
hooks:
21+
- id: trailing-whitespace
22+
- id: end-of-file-fixer
23+
- id: check-yaml
24+
- repo: https://github.com/psf/black
25+
rev: 19.10b0
26+
hooks:
27+
- id: black
28+
- repo: https://gitlab.com/pycqa/flake8
29+
rev: 3.9.2
30+
hooks:
31+
- id: flake8

.stickler.yml

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

codecov.yml

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

docs/source/conf.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@
7070

7171
# General information about the project.
7272
project = u"pandas-gbq"
73-
copyright = u"2017-{}, PyData Development Team".format(
74-
datetime.datetime.now().year
75-
)
73+
copyright = u"2017-{}, PyData Development Team".format(datetime.datetime.now().year)
7674
author = u"PyData Development Team"
7775

7876
# The version info for the project you're documenting, acts as replacement for
@@ -102,8 +100,13 @@
102100

103101
# List of patterns, relative to source directory, that match files and
104102
# directories to ignore when looking for source files.
105-
# This patterns also effect to html_static_path and html_extra_path
106-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
103+
exclude_patterns = [
104+
"_build",
105+
"**/.nox/**/*",
106+
"samples/AUTHORING_GUIDE.md",
107+
"samples/CONTRIBUTING.md",
108+
"samples/snippets/README.rst",
109+
]
107110

108111
# The reST default role (used for this markup: `text`) to use for all
109112
# documents.
@@ -335,9 +338,7 @@
335338

336339
# One entry per manual page. List of tuples
337340
# (source start file, name, description, authors, manual section).
338-
man_pages = [
339-
(master_doc, "pandas-gbq", u"pandas-gbq Documentation", [author], 1)
340-
]
341+
man_pages = [(master_doc, "pandas-gbq", u"pandas-gbq Documentation", [author], 1)]
341342

342343
# If true, show URL addresses after external links.
343344
#

noxfile.py

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,48 @@
1414
import nox
1515

1616

17-
supported_pythons = ["3.7", "3.8"]
18-
system_test_pythons = ["3.7", "3.8"]
19-
latest_python = "3.8"
17+
BLACK_VERSION = "black==19.10b0"
18+
BLACK_PATHS = ["docs", "pandas_gbq", "tests", "noxfile.py", "setup.py"]
2019

21-
# Use a consistent version of black so CI is deterministic.
22-
# Should match Stickler: https://stickler-ci.com/docs#black
23-
black_package = "black==20.8b1"
20+
DEFAULT_PYTHON_VERSION = "3.8"
21+
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
22+
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9"]
2423

2524

26-
@nox.session(python=latest_python)
25+
# Error if a python version is missing
26+
nox.options.error_on_missing_interpreters = True
27+
28+
29+
@nox.session(python=DEFAULT_PYTHON_VERSION)
2730
def lint(session):
28-
session.install(black_package, "flake8")
29-
session.run("flake8", "pandas_gbq")
30-
session.run("flake8", "tests")
31-
session.run("black", "--check", ".")
31+
"""Run linters.
32+
Returns a failure if the linters find linting errors or sufficiently
33+
serious code quality issues.
34+
"""
35+
session.install("flake8", BLACK_VERSION)
36+
session.run(
37+
"black", "--check", *BLACK_PATHS,
38+
)
39+
session.run("flake8", "pandas_gbq", "tests")
3240

3341

34-
@nox.session(python=latest_python)
42+
@nox.session(python=DEFAULT_PYTHON_VERSION)
3543
def blacken(session):
36-
session.install(black_package)
37-
session.run("black", ".")
44+
"""Run black. Format code to uniform standard."""
45+
session.install(BLACK_VERSION)
46+
session.run(
47+
"black", *BLACK_PATHS,
48+
)
49+
3850

51+
@nox.session(python=DEFAULT_PYTHON_VERSION)
52+
def lint_setup_py(session):
53+
"""Verify that setup.py is valid (including RST check)."""
54+
session.install("docutils", "pygments")
55+
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
3956

40-
@nox.session(python=supported_pythons)
57+
58+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
4159
def unit(session):
4260
session.install("pytest", "pytest-cov")
4361
session.install(
@@ -56,18 +74,23 @@ def unit(session):
5674
"--cov=tests.unit",
5775
"--cov-report",
5876
"xml:/tmp/pytest-cov.xml",
59-
*session.posargs
77+
*session.posargs,
6078
)
6179

6280

63-
@nox.session(python=latest_python)
81+
@nox.session(python=DEFAULT_PYTHON_VERSION)
6482
def cover(session):
83+
"""Run the final coverage report.
84+
This outputs the coverage report aggregating coverage from the unit
85+
test runs (not system test runs), and then erases coverage data.
86+
"""
6587
session.install("coverage", "pytest-cov")
6688
session.run("coverage", "report", "--show-missing", "--fail-under=73")
89+
6790
session.run("coverage", "erase")
6891

6992

70-
@nox.session(python=latest_python)
93+
@nox.session(python=DEFAULT_PYTHON_VERSION)
7194
def docs(session):
7295
"""Build the docs."""
7396

@@ -89,7 +112,7 @@ def docs(session):
89112
)
90113

91114

92-
@nox.session(python=system_test_pythons)
115+
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
93116
def system(session):
94117
session.install("pytest", "pytest-cov")
95118
session.install(
@@ -111,5 +134,5 @@ def system(session):
111134
os.path.join(".", "tests", "system"),
112135
os.path.join(".", "samples", "tests"),
113136
"-v",
114-
*additional_args
137+
*additional_args,
115138
)

0 commit comments

Comments
 (0)