Skip to content

Commit

Permalink
update linting package versions for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Jun 18, 2024
1 parent 8135fcc commit ff6c2b4
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
# Use specific format-enforcing pre-commit hooks from the core library
# with the default configuration (see pre-commit.com for documentation)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-ast
- id: debug-statements
Expand All @@ -23,7 +23,7 @@ repos:
# (see https://black.readthedocs.io/en/stable/ for documentation and see
# the cfdm pyproject.toml file for our custom black configuration)
- repo: https://github.com/ambv/black
rev: 23.1.0
rev: 24.4.2
hooks:
- id: black
language_version: python3
Expand Down Expand Up @@ -59,7 +59,7 @@ repos:
# (see https://flake8.pycqa.org/en/latest/ for documentation and see
# the cfdm .flake8 file for our custom flake8 configuration)
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.1.0
hooks:
- id: flake8

Expand All @@ -68,7 +68,7 @@ repos:
# compatible with 'black' with the lines set to ensure so in the repo's
# pyproject.toml. Other than that and the below, no extra config is required.
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
Expand Down
1 change: 1 addition & 0 deletions cfdm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
up to the user to use them in a CF-compliant way.
"""

import logging
import sys

Expand Down
1 change: 1 addition & 0 deletions cfdm/core/docstring/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
.. versionaddedd:: (cfdm) 1.8.7.0
"""

_docstring_substitution_definitions = {
# ----------------------------------------------------------------
# General susbstitutions (not indent-dependent)
Expand Down
1 change: 0 additions & 1 deletion cfdm/docstring/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"""


_docstring_substitution_definitions = {
# ----------------------------------------------------------------
# General substitutions (not indent-dependent)
Expand Down
34 changes: 18 additions & 16 deletions cfdm/read_write/netcdf/netcdfread.py
Original file line number Diff line number Diff line change
Expand Up @@ -1231,10 +1231,10 @@ def read(
variable_attributes[ncvar][attr]
)
except UnicodeEncodeError:
variable_attributes[ncvar][
attr
] = variable_attributes[ncvar][attr].encode(
errors="ignore"
variable_attributes[ncvar][attr] = (
variable_attributes[ncvar][attr].encode(
errors="ignore"
)
)
except UnicodeDecodeError:
pass
Expand Down Expand Up @@ -6251,12 +6251,12 @@ def _create_data(
for term, param_ncvar in rec[
"interpolation_parameters"
].items():
interpolation_parameters[
term
] = self._copy_construct(
"interpolation_parameter",
parent_ncvar,
param_ncvar,
interpolation_parameters[term] = (
self._copy_construct(
"interpolation_parameter",
parent_ncvar,
param_ncvar,
)
)

# For each intepolation parameter, record
Expand Down Expand Up @@ -8428,9 +8428,11 @@ def _split_string_by_white_space(
mapping = self.read_vars["flattener_variables"]
if trailing_colon:
out = [
mapping[ncvar[:-1]] + ":"
if ncvar.endswith(":")
else mapping[ncvar]
(
mapping[ncvar[:-1]] + ":"
if ncvar.endswith(":")
else mapping[ncvar]
)
for ncvar in out
]
else:
Expand Down Expand Up @@ -9105,9 +9107,9 @@ def _ugrid_create_domain_topology(self, parent_ncvar, f, mesh, location):

# Create data
if cell == "point":
properties[
"long_name"
] = "Maps every point to its connected points"
properties["long_name"] = (
"Maps every point to its connected points"
)
indices, kwargs = self._create_netcdfarray(connectivity_ncvar)
n_nodes = self.read_vars["internal_dimension_sizes"][
mesh.ncdim[location]
Expand Down
2 changes: 1 addition & 1 deletion cfdm/read_write/netcdf/netcdfwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -2673,7 +2673,7 @@ def _write_netcdf_variable(
datatype = self._datatype(cfvar)
data, ncdimensions = self._transform_strings(
data,
ncdimensions
ncdimensions,
# cfvar, data, ncdimensions
)

Expand Down
1 change: 1 addition & 0 deletions docs/source/check_docs_api_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
$ python check_api_coverage.py <docs/source/ directory path>
"""

import os
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions docs/source/extract_tutorial_code.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Extract tutorial Python code into an executable Python script."""

import re
import sys

Expand Down

0 comments on commit ff6c2b4

Please sign in to comment.