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

Add pyupgrade to pre-commit hooks #433

Merged
merged 1 commit into from
Jan 13, 2022
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
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ repos:
- id: check-json
- id: check-yaml
- id: double-quote-string-fixer
- id: debug-statements
- id: mixed-line-ending

# - repo: https://github.com/mwouts/jupytext
# rev: v1.13.3
# hooks:
# - id: jupytext
# args: [--pipe, black, --warn-only]
# additional_dependencies:
# - black==21.12b0 # Matches hook
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args:
- '--py37-plus'

- repo: https://github.com/psf/black
rev: 21.12b0
Expand Down
12 changes: 5 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import datetime

import yaml
Expand Down Expand Up @@ -68,9 +66,9 @@

# General information about the project.
current_year = datetime.datetime.now().year
project = u'Intake-ESM'
project = 'Intake-ESM'
copyright = f'2018-{current_year}, Intake-ESM development team'
author = u'Intake-ESM developers'
author = 'Intake-ESM developers'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -140,15 +138,15 @@
}


latex_documents = [('index', 'intake-esm.tex', u'intake-esm Documentation', author, 'manual')]
latex_documents = [('index', 'intake-esm.tex', 'intake-esm Documentation', author, 'manual')]

man_pages = [('index', 'intake-esm', u'intake-esm Documentation', [author], 1)]
man_pages = [('index', 'intake-esm', 'intake-esm Documentation', [author], 1)]

texinfo_documents = [
(
'index',
'intake-esm',
u'intake-esm Documentation',
'intake-esm Documentation',
author,
'intake-esm',
'One line description of project.',
Expand Down
2 changes: 1 addition & 1 deletion intake_esm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(

"""Intake Catalog representing an ESM Collection."""
intake_kwargs = intake_kwargs or {}
super(esm_datastore, self).__init__(**intake_kwargs)
super().__init__(**intake_kwargs)
self.storage_options = storage_options or {}
self.read_csv_kwargs = read_csv_kwargs or {}
self.progressbar = progressbar
Expand Down
1 change: 0 additions & 1 deletion intake_esm/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
""" Helper functions for fetching and loading catalog"""
import importlib
import sys
Expand Down
2 changes: 1 addition & 1 deletion tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_search_columns_with_iterables(query, expected):
'path': ['file1', 'file2', 'file3'],
'variable': [['A', 'B'], ['A', 'B', 'C'], ['C', 'D', 'A']],
'attr': [1, 2, 3],
'random': [set(['bx', 'by']), set(['bx', 'bz']), set(['bx', 'by'])],
'random': [{'bx', 'by'}, {'bx', 'bz'}, {'bx', 'by'}],
}
)
query_model = QueryModel(query=query, columns=df.columns.tolist())
Expand Down