Skip to content

Commit

Permalink
Update pre-commit hooks for black and isort. (#894)
Browse files Browse the repository at this point in the history
* Bump pre-commit hooks.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* ci: Update pre-commit

---------

Co-authored-by: Bradley Dice <bdice@bradleydice.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 4, 2023
1 parent b1c50d7 commit 9a20713
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ repos:
args:
- --py38-plus
- repo: https://github.com/PyCQA/isort
rev: '5.11.4'
rev: '5.12.0'
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: '22.12.0'
rev: '23.1.0'
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand Down
1 change: 0 additions & 1 deletion .sync-zenodo-metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def as_zenodo_creator(self):
"-i", "--in-place", type=bool, is_flag=True, help="Modify metadata in place."
)
def sync(ctx, in_place=False, check=True):

with open("CITATION.cff", "rb") as file:
citation = load(file.read(), Loader=Loader)
authors = [
Expand Down
1 change: 0 additions & 1 deletion signac/h5store.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def _h5get(store, grp, key, path=None):


class _ensure_open:

__slots__ = ["file", "open", "kwargs"]

def __init__(self, file, **kwargs):
Expand Down
1 change: 0 additions & 1 deletion signac/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ def _make_path_function(jobs, path):
path_function = _make_schema_based_path_function(jobs=jobs)

elif path is False:

# Just use the job id as path.
def path_function(job):
"""Use job id to construct path.
Expand Down
1 change: 0 additions & 1 deletion tests/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class TestDiffBase:

project_class = signac.Project

@pytest.fixture(autouse=True)
Expand Down
5 changes: 0 additions & 5 deletions tests/test_h5store.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def test_open_write_and_read_only(self):


class TestH5Store(TestH5StoreBase):

valid_types = {
"int": 123,
"float": 123.456,
Expand Down Expand Up @@ -630,7 +629,6 @@ def get_testdata(self, size=None):


class TestH5StoreClosed(TestH5Store):

valid_types = {
"int": 123,
"float": 123.456,
Expand Down Expand Up @@ -761,7 +759,6 @@ def read():
read()

def test_multiple_reader_different_process_no_swmr(self):

read_cmd = (
r'python -c "from signac.h5store import H5Store; '
r"h5s = H5Store({}, mode=\"r\"); list(h5s); "
Expand All @@ -779,7 +776,6 @@ def test_multiple_reader_different_process_no_swmr(self):
raise

def test_single_writer_multiple_reader_different_process_no_swmr(self):

read_cmd = (
r'python -c "from signac.h5store import H5Store; '
r"h5s = H5Store({}, mode=\"r\"); list(h5s); "
Expand All @@ -794,7 +790,6 @@ def test_single_writer_multiple_reader_different_process_no_swmr(self):
python_implementation() != "CPython", reason="SWMR mode not available."
)
def test_single_writer_multiple_reader_different_process_swmr(self):

read_cmd = (
r'python -c "from signac.h5store import H5Store; '
r"h5s = H5Store({}, mode=\"r\", swmr=True); list(h5s); "
Expand Down
1 change: 0 additions & 1 deletion tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def builtins_dict():


class TestJobBase:

project_class = signac.Project

@pytest.fixture(autouse=True)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,6 @@ def add_jobs_heterogeneous(project, num_jobs):


class TestProjectRepresentation(TestProjectBase):

num_few_jobs = 10
num_many_jobs = 200

Expand Down Expand Up @@ -2086,7 +2085,6 @@ def open_job(self, *args, **kwargs):


class TestCachedProject(TestProject):

project_class = UpdateCacheAfterInitJobProject

def test_repr(self):
Expand Down Expand Up @@ -2432,7 +2430,6 @@ def test_pickle_jobs_directly(self):


class TestProjectStoreBase(test_h5store.TestH5StoreBase):

project_class = signac.Project

@pytest.fixture(autouse=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_searchindexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def test_find_type_expression(self):
(True, "bool"),
(None, "null"),
]
for (v, t) in types:
for v, t in types:
assert len(self.c.find({"a": {"$type": t}})) == 0
for i, (v, t) in enumerate(types):
self.c[str(i)] = {str(i): v}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,20 +829,16 @@ class TestBufferedJSONListWriteConcern(TestBufferedJSONList):


class TestBufferedJSONAttrDict(TestBufferedJSONDict, AttrDictTest):

_collection_type = BufferedJSONAttrDict # type: ignore


class TestBufferedJSONAttrList(TestBufferedJSONList, AttrListTest):

_collection_type = BufferedJSONAttrList # type: ignore


class TestMemoryBufferedJSONAttrDict(TestMemoryBufferedJSONDict, AttrDictTest):

_collection_type = MemoryBufferedJSONAttrDict # type: ignore


class TestMemoryBufferedJSONAttrList(TestMemoryBufferedJSONList, AttrListTest):

_collection_type = MemoryBufferedJSONAttrList # type: ignore
5 changes: 0 additions & 5 deletions tests/test_synced_collections/test_json_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class JSONCollectionTest:

_write_concern = False
_fn = "test.json"

Expand Down Expand Up @@ -55,12 +54,10 @@ def test_multithreaded(self, synced_collection):


class TestJSONDict(JSONCollectionTest, SyncedDictTest):

_collection_type = JSONDict


class TestJSONList(JSONCollectionTest, SyncedListTest):

_collection_type = JSONList


Expand All @@ -73,10 +70,8 @@ class TestJSONListWriteConcern(TestJSONList):


class TestJSONAttrDict(TestJSONDict, AttrDictTest):

_collection_type = JSONAttrDict


class TestJSONAttrList(TestJSONList, AttrListTest):

_collection_type = JSONAttrList
1 change: 0 additions & 1 deletion tests/test_synced_collections/test_mongodb_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@


class MongoDBCollectionTest:

_uid = {"MongoDBCollection::name": "test"}

def store(self, synced_collection, data):
Expand Down
1 change: 0 additions & 1 deletion tests/test_synced_collections/test_redis_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@


class RedisCollectionTest:

_key = "test"

def store(self, synced_collection, data):
Expand Down
1 change: 0 additions & 1 deletion tests/test_synced_collections/test_zarr_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class ZarrCollectionTest:

_name = "test"

def store(self, synced_collection, data):
Expand Down

0 comments on commit 9a20713

Please sign in to comment.