Skip to content
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

Update black et al #4155

Merged
merged 4 commits into from
May 26, 2021
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.4.0'
rev: 'v4.0.1'
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
Expand All @@ -17,14 +17,14 @@ repos:
# Don't commit to master branch.
- id: no-commit-to-branch
- repo: https://github.com/psf/black
rev: '20.8b1'
rev: '21.5b1'
hooks:
- id: black
# Force black to run on whole repo, using settings from pyproject.toml
pass_filenames: false
args: [--config=./pyproject.toml, .]
- repo: https://github.com/PyCQA/flake8
rev: '3.9.0'
rev: '3.9.2'
hooks:
# Run flake8.
- id: flake8
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/fileformats/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,7 @@ def save(
local_keys.update(different_value_keys)

def is_valid_packspec(p):
""" Only checks that the datatype is valid. """
"""Only checks that the datatype is valid."""
if isinstance(p, dict):
if "dtype" in p:
return is_valid_packspec(p["dtype"])
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/integration/test_netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def test_single_packed_signed(self):
self._single_test("i2", "single_packed_signed.cdl")

def test_single_packed_unsigned(self):
"""Test saving a single CF-netCDF file with packing into unsigned. """
"""Test saving a single CF-netCDF file with packing into unsigned."""
self._single_test("u1", "single_packed_unsigned.cdl")

def test_single_packed_manual_scale(self):
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/test_cube_to_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_365_calendar_export(self):


class FakePPEnvironment:
""" fake a minimal PP environment for use in cross-section coords, as in PP save rules """
"""fake a minimal PP environment for use in cross-section coords, as in PP save rules"""

y = [1, 2, 3, 4]
z = [111, 222, 333, 444]
Expand Down
6 changes: 3 additions & 3 deletions lib/iris/tests/test_file_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


def save_by_filename(filename1, filename2, cube, saver_fn, iosaver=None):
""" Saves a cube to two different filenames using iris.save and the save method of the object representing the file type directly"""
"""Saves a cube to two different filenames using iris.save and the save method of the object representing the file type directly"""
# Save from object direct
saver_fn(cube, filename1)

Expand All @@ -46,7 +46,7 @@ def save_by_filename(filename1, filename2, cube, saver_fn, iosaver=None):
def save_by_filehandle(
filehandle1, filehandle2, cube, fn_saver, binary_mode=True
):
""" Saves a cube to two different filehandles using iris.save and the save method of the object representing the file type directly"""
"""Saves a cube to two different filehandles using iris.save and the save method of the object representing the file type directly"""
mode = "wb" if binary_mode else "w"

# Save from object direct
Expand All @@ -60,7 +60,7 @@ def save_by_filehandle(

@tests.skip_data
class TestSaveMethods(tests.IrisTest):
""" Base class for file saving tests. Loads data and creates/deletes tempfiles"""
"""Base class for file saving tests. Loads data and creates/deletes tempfiles"""

def setUp(self):
self.cube1 = iris.load_cube(
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/unit/fileformats/test_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def converter(field):


class Test_scalar_cell_method(tests.IrisTest):
""" Tests for iris.fileformats.rules.scalar_cell_method() function """
"""Tests for iris.fileformats.rules.scalar_cell_method() function"""

def setUp(self):
self.cube = stock.simple_2d()
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def black(session: nox.sessions.Session):

"""
# Pip install the session requirements.
session.install("black==20.8b1")
session.install("black==21.5b1")
# Execute the black format checker on the package.
session.run("black", "--check", PACKAGE)
# Execute the black format checker on this file.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 79
target-version = ['py36', 'py37']
target-version = ['py36', 'py37', 'py38']
include = '\.pyi?$'
exclude = '''

Expand Down
2 changes: 1 addition & 1 deletion requirements/ci/py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:

# Test dependencies.
- asv
- black=20.8b1
- black=21.5b1
- filelock
- flake8
- imagehash>=4.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci/py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:

# Test dependencies.
- asv
- black=20.8b1
- black=21.5b1
- filelock
- flake8
- imagehash>=4.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci/py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:

# Test dependencies.
- asv
- black=20.8b1
- black=21.5b1
- filelock
- flake8
- imagehash>=4.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Test dependencies.

asv
black==20.8b1
black==21.5b1
filelock
imagehash>=4.0
nose
Expand Down