diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index abd3f19..9d5a443 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,11 +8,20 @@ repos: - id: check-json - id: check-yaml - id: double-quote-string-fixer + - id: debug-statements + - id: mixed-line-ending + + - 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 hooks: - - id: black + - id: black-jupyter - repo: https://github.com/keewis/blackdoc rev: v0.3.4 @@ -24,10 +33,6 @@ repos: hooks: - id: flake8 - - repo: https://github.com/asottile/seed-isort-config - rev: v2.2.0 - hooks: - - id: seed-isort-config - repo: https://github.com/PyCQA/isort rev: 5.10.1 hooks: @@ -37,13 +42,3 @@ repos: rev: v2.5.1 hooks: - id: prettier - - - repo: https://github.com/nbQA-dev/nbQA - rev: 1.2.2 - hooks: - - id: nbqa-black - additional_dependencies: [black==21.7b0] - - id: nbqa-pyupgrade - additional_dependencies: [pyupgrade==2.7.3] - - id: nbqa-isort - additional_dependencies: [isort==v5.9.2] diff --git a/docs/source/conf.py b/docs/source/conf.py index bd59ae3..85db2f8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. @@ -87,9 +86,9 @@ master_doc = 'index' # General information about the project. -project = u'intake-thredds' -copyright = u'2019 onwards, intake-thredds developers' -author = u'intake-thredds developers' +project = 'intake-thredds' +copyright = '2019 onwards, intake-thredds developers' +author = 'intake-thredds 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 @@ -258,7 +257,7 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'intake-thredds.tex', u'intake-thredds Documentation', author, 'manual') + ('index', 'intake-thredds.tex', 'intake-thredds Documentation', author, 'manual') ] # The name of an image file (relative to this directory) to place at the top of @@ -286,7 +285,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [('index', 'intake-thredds', u'intake-thredds Documentation', [author], 1)] +man_pages = [('index', 'intake-thredds', 'intake-thredds Documentation', [author], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -301,7 +300,7 @@ ( 'index', 'intake-thredds', - u'intake-thredds Documentation', + 'intake-thredds Documentation', author, 'intake-thredds', 'One line description of project.', diff --git a/intake_thredds/source.py b/intake_thredds/source.py index 1ed3193..6dc828d 100644 --- a/intake_thredds/source.py +++ b/intake_thredds/source.py @@ -65,7 +65,7 @@ def __init__( metadata=None, ): - super(THREDDSMergedSource, self).__init__(metadata=metadata) + super().__init__(metadata=metadata) self.urlpath = url if 'simplecache::' in url: self.metadata.update({'fsspec_pre_url': 'simplecache::'}) diff --git a/pyproject.toml b/pyproject.toml index 09fa65a..fff3350 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,10 +3,5 @@ line-length = 100 target-version = ['py38'] skip-string-normalization = true -[tool.nbqa.mutate] -isort = 1 -black = 1 -pyupgrade = 1 - -[tool.nbqa.addopts] -pyupgrade = ["--py36-plus"] +[build-system] +requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] diff --git a/setup.cfg b/setup.cfg index 0984905..d9e6ab1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,3 +17,7 @@ line_length=100 skip= docs/source/conf.py setup.py + +[tool:pytest] +console_output_style = count +addopts = --cov=./ --cov-report=xml --verbose diff --git a/setup.py b/setup.py index bc05c47..cbb3c5e 100644 --- a/setup.py +++ b/setup.py @@ -54,6 +54,5 @@ zip_safe=False, keywords='intake thredds siphon catalogs', use_scm_version={'version_scheme': 'post-release', 'local_scheme': 'dirty-tag'}, - setup_requires=['setuptools_scm', 'setuptools>=30.3.0'], classifiers=CLASSIFIERS, ) diff --git a/tests/test_source.py b/tests/test_source.py index 1659023..dcc9e34 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -71,8 +71,8 @@ def test_THREDDSMergedSource(THREDDSMergedSource_cat): ds = cat.to_dask() assert dict(ds.dims) == {'lat': 73, 'lon': 144, 'time': 731} d = cat.discover() - assert set(d['metadata']['coords']) == set(('lat', 'lon', 'time')) - assert set(d['metadata']['data_vars'].keys()) == set(['air']) + assert set(d['metadata']['coords']) == {'lat', 'lon', 'time'} + assert set(d['metadata']['data_vars'].keys()) == {'air'} def test_THREDDSMergedSource_long_short(THREDDSMergedSource_cat, THREDDSMergedSource_cat_short):