diff --git a/.circleci/config.yml b/.circleci/config.yml index e78c17015..a9490cf11 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,10 +10,10 @@ orbs: references: restore_keys: &restore_keys keys: - - python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }} + - python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }} save_key: &save_key - key: python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }} + key: python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }} jobs: pre-checks: @@ -70,9 +70,9 @@ jobs: if [[ "${CIRCLE_JOB}" != *"pypy"* ]]; then sudo apt update -qq && sudo apt install -y -qq libhdf5-dev fi - ${PYTHON} -m pip install --progress-bar off -U pip==20.2 + ${PYTHON} -m pip install --progress-bar off -U pip>=20.3 ${PYTHON} -m pip install --progress-bar off -U codecov - ${PYTHON} -m pip install --progress-bar off -U -e . -r requirements-dev.txt + ${PYTHON} -m pip install --progress-bar off -U -e . -r requirements-test.txt - save_cache: <<: *save_key @@ -144,7 +144,7 @@ jobs: name: Install dependencies command: | ${PYTHON} -m pip install --progress-bar off -U codecov - ${PYTHON} -m pip install --progress-bar off -U -e . -r requirements-dev.txt + ${PYTHON} -m pip install --progress-bar off -U -e . -r requirements-test.txt - run: name: Run tests command: | @@ -168,7 +168,7 @@ jobs: . test_env/bin/activate python --version python -m pip install --progress-bar off -U codecov - python -m pip install --progress-bar off -U -e . -r requirements-dev.txt + python -m pip install --progress-bar off -U -e . -r requirements-test.txt python -m pytest --cov=signac --cov-report=xml tests/ -v codecov diff --git a/.circleci/deploy.bash b/.circleci/deploy.bash index 37dc772b3..65bd85d03 100755 --- a/.circleci/deploy.bash +++ b/.circleci/deploy.bash @@ -3,7 +3,7 @@ set -e set -u -python -m pip install --progress-bar off --user -U -r requirements-dev.txt +python -m pip install --progress-bar off --user -U -r requirements-test.txt python -m pip install --progress-bar off --user -U twine wheel setuptools # PYPI_USERNAME - (Required) Username for the publisher's account on PyPI diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4811e941..b8a878e3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,19 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v3.3.0' + rev: 'v3.4.0' hooks: - id: end-of-file-fixer exclude: 'setup.cfg' - id: trailing-whitespace exclude: 'setup.cfg' + - id: check-builtin-literals + - id: check-executables-have-shebangs + - id: check-json + - id: check-yaml - id: debug-statements + - id: requirements-txt-fixer - repo: https://github.com/asottile/pyupgrade - rev: 'v2.7.3' + rev: 'v2.7.4' hooks: - id: pyupgrade exclude: '(?:configobj/.*)' diff --git a/.zenodo.json b/.zenodo.json index 40eba5562..588fe1b9d 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -124,5 +124,5 @@ "id": "http://www.opensource.org/licenses/BSD-3-Clause" }, "title": "signac", - "version": "1.5.0" + "version": "1.5.1" } diff --git a/CITATION.cff b/CITATION.cff index 5c8fa4a7d..e9ae65bbc 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ --- cff-version: "1.0.3" title: signac -version: 1.5.0 +version: 1.5.1 abstract: | The signac framework helps users manage and scale file-based workflows, facilitating data reuse, sharing, and reproducibility. It provides a simple and robust data model to create diff --git a/benchmark.py b/benchmark.py index e392007d3..832f55a3a 100755 --- a/benchmark.py +++ b/benchmark.py @@ -75,7 +75,7 @@ def calc_project_metadata_size(project): def get_partition(path): path = os.path.realpath(path) - candidates = dict() + candidates = {} for partition in psutil.disk_partitions(all=True): mp = os.path.realpath(partition.mountpoint) if path.startswith(mp): diff --git a/changelog.txt b/changelog.txt index 45ae016b2..6faed04b9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,8 +7,8 @@ The **signac** package follows `semantic versioning `_. Version 1 ========= -next ----- +[1.5.1] -- 2020-12-19 +--------------------- Added +++++ diff --git a/doc/conf.py b/doc/conf.py index cae31a643..362ed2c80 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -80,9 +80,9 @@ def __getattr__(cls, name): # built documents. # # The short X.Y version. -version = "1.5.0" +version = "1.5.1" # The full version, including alpha/beta/rc tags. -release = "1.5.0" +release = "1.5.1" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/requirements.txt b/doc/requirements.txt index 0125d97bf..e70d764f3 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ -nbconvert -nbsphinx>=0.3 +deprecation>=2 IPython jupyter_client -deprecation>=2 +nbconvert +nbsphinx>=0.3 sphinxcontrib-programoutput diff --git a/doc/support.rst b/doc/support.rst index a40c066e6..f9cd03720 100644 --- a/doc/support.rst +++ b/doc/support.rst @@ -46,7 +46,7 @@ Then clone your fork and install the package from source with: .. code-block:: bash (signac-dev) ~ $ cd path/to/my/fork/of/signac - (signac-dev) signac $ pip install -e . -r requirements-dev.txt + (signac-dev) signac $ pip install -e . The ``-e`` option stands for *editable*, which means that the package is directly loaded from the source code repository. That means any changes made to the source code are immediately reflected upon reloading the Python interpreter. diff --git a/requirements-benchmark.txt b/requirements-benchmark.txt index 045219b53..91e22149c 100644 --- a/requirements-benchmark.txt +++ b/requirements-benchmark.txt @@ -1,6 +1,6 @@ click>=7.0 -numpy==1.19.4 gitdb2==4.0.2 GitPython==3.1.11 +numpy==1.19.4 pandas==1.1.4; implementation_name=='cpython' --no-binary :none: psutil==5.7.3 diff --git a/requirements-dev.txt b/requirements-test.txt similarity index 100% rename from requirements-dev.txt rename to requirements-test.txt index c68ef1088..e92550c7e 100644 --- a/requirements-dev.txt +++ b/requirements-test.txt @@ -4,7 +4,7 @@ h5py==3.1.0; implementation_name=='cpython' numpy==1.19.4 pandas==1.1.4; implementation_name=='cpython' pymongo==3.11.1; implementation_name=='cpython' -pytest-cov==2.10.1 pytest==6.1.2 +pytest-cov==2.10.1 ruamel.yaml==0.16.12 tables==3.6.1; implementation_name=='cpython' diff --git a/setup.cfg b/setup.cfg index b4da3ca3b..76c54c4f1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.5.0 +current_version = 1.5.1 commit = True tag = False message = Bump up to version {new_version}. @@ -13,9 +13,7 @@ python-tag = py3 [flake8] max-line-length = 100 exclude = configobj -# Use select to ignore unwanted flake8 plugins select = E,F,W -# Specify errors to ignore by default ignore = E123,E126,E203,E226,E241,E704,W503,W504 [pydocstyle] diff --git a/setup.py b/setup.py index 69a645c89..3db3c96af 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ setup( name="signac", - version="1.5.0", + version="1.5.1", packages=find_packages(), zip_safe=True, maintainer="signac Developers", diff --git a/signac/__main__.py b/signac/__main__.py index c29f4205f..6e90342b5 100644 --- a/signac/__main__.py +++ b/signac/__main__.py @@ -635,7 +635,7 @@ def _main_import_interactive(project, origin, args): with _prepare_import_into_project( origin, tmp_project, args.schema_path ) as data_mapping: - paths = dict() + paths = {} for src, copy_executor in tqdm( dict(data_mapping).items(), desc="Import to temporary project" ): @@ -671,7 +671,7 @@ def _main_import_non_interactive(project, origin, args): from .contrib.import_export import _prepare_import_into_project try: - paths = dict() + paths = {} if args.sync: with project.temporary_project() as tmp_project: _print_err("Prepare data space for import...") @@ -738,7 +738,7 @@ def main_export(args): project = get_project() jobs = [project.open_job(id=job_id) for job_id in find_with_filter(args)] - paths = dict() + paths = {} with tqdm(total=len(jobs), desc="Export") as pbar: try: for src, dst in export_jobs( @@ -919,7 +919,7 @@ def main_config_set(args): args.value = args.value[0] sec = cfg for key in keys[:-1]: - sec = sec.setdefault(key, dict()) + sec = sec.setdefault(key, {}) try: sec[keys[-1]] = args.value _print_err(f"Updated value '{args.key}'='{args.value}'.") @@ -959,7 +959,7 @@ def main_config_host(args): cfg = config.get_config(fn_config) def hostcfg(): - return cfg.setdefault("hosts", dict()).setdefault(args.hostname, dict()) + return cfg.setdefault("hosts", {}).setdefault(args.hostname, {}) if sum((args.test, args.remove, args.show_pw)) > 1: raise ValueError( diff --git a/signac/common/crypt.py b/signac/common/crypt.py index 6522e17d4..9db4516b3 100644 --- a/signac/common/crypt.py +++ b/signac/common/crypt.py @@ -66,7 +66,7 @@ class SimpleKeyring: """Simple in-memory keyring for caching.""" def __init__(self): - self._cache = dict() + self._cache = {} @classmethod def _encode(cls, msg): diff --git a/signac/common/host.py b/signac/common/host.py index 61e616c3b..baa3f8722 100644 --- a/signac/common/host.py +++ b/signac/common/host.py @@ -18,7 +18,7 @@ SESSION_PASSWORD_HASH_CACHE = SimpleKeyring() -SESSION_USERNAME_CACHE = dict() # type: ignore +SESSION_USERNAME_CACHE = {} # type: ignore """ THIS MODULE IS DEPRECATED! diff --git a/signac/contrib/collection.py b/signac/contrib/collection.py index 2f078bdfd..aded5b45a 100644 --- a/signac/contrib/collection.py +++ b/signac/contrib/collection.py @@ -450,9 +450,9 @@ def __init__(self, docs=None, primary_key="_id", compresslevel=0, _trust=False): self._compresslevel = compresslevel self._requires_flush = False self._dirty = set() - self._indexes = dict() + self._indexes = {} self._next_default_id_ = None - self._docs = dict() + self._docs = {} if docs is not None: for doc in docs: if self._primary_key not in doc: diff --git a/signac/contrib/filesystems.py b/signac/contrib/filesystems.py index 205fd22bf..c23b39461 100644 --- a/signac/contrib/filesystems.py +++ b/signac/contrib/filesystems.py @@ -24,7 +24,7 @@ GRIDFS = True GRIDFS_LARGE_FILE_WARNING_THRSHLD = int(1e9) # 1GB -FILESYSTEM_REGISTRY = dict() +FILESYSTEM_REGISTRY = {} """ THIS MODULE IS DEPRECATED! diff --git a/signac/contrib/filterparse.py b/signac/contrib/filterparse.py index dc0163d3c..c58c5a0cd 100644 --- a/signac/contrib/filterparse.py +++ b/signac/contrib/filterparse.py @@ -220,7 +220,7 @@ def parse_filter_arg(args, file=sys.stderr): else: return _with_message(_parse_simple(args[0]), file) else: - q = dict() + q = {} for i in range(0, len(args), 2): key = args[i] if i + 1 < len(args): diff --git a/signac/contrib/import_export.py b/signac/contrib/import_export.py index d80afb963..d0b6e380e 100644 --- a/signac/contrib/import_export.py +++ b/signac/contrib/import_export.py @@ -66,7 +66,7 @@ def _make_schema_based_path_function(jobs, exclude_keys=None, delimiter_nested=" jsi = _build_job_statepoint_index(exclude_const=True, index=index) sp_index = OrderedDict(jsi) - paths = dict() + paths = {} for key_tokens, values in sp_index.items(): key = key_tokens.replace(".", delimiter_nested) if exclude_keys and key in exclude_keys: @@ -548,7 +548,7 @@ def _convert_schema_path_to_regex(schema_path): # in the schema path. re_key_type_field = r"\{(?P[\.\w]+)(?::(?P[a-z]+))?\}" schema_regex = "" # the return value - types = dict() # maps values to their designated types + types = {} # maps values to their designated types index = 0 while True: m = re.search(re_key_type_field, schema_path[index:]) @@ -948,7 +948,7 @@ def read_sp_manifest_file(path): else: raise TypeError("The schema variable must be None, callable, or a string.") - mappings = dict() + mappings = {} skip_subdirs = set() dirs = {os.path.dirname(name) for name in names} @@ -1097,7 +1097,7 @@ def read_sp_manifest_file(path): else: raise TypeError("The schema variable must be None, callable, or a string.") - mappings = dict() + mappings = {} skip_subdirs = set() dirs = [member.name for member in tarfile.getmembers() if member.isdir()] diff --git a/signac/contrib/indexing.py b/signac/contrib/indexing.py index 803aeb4c0..a682fc9af 100644 --- a/signac/contrib/indexing.py +++ b/signac/contrib/indexing.py @@ -168,7 +168,7 @@ class RegexFileCrawler(BaseCrawler): MyCrawler.define('.*\/a_(?P\d+)\.txt', 'TextFile') """ "Mapping of compiled regex objects and associated formats." - definitions = dict() # type: ignore + definitions = {} # type: ignore @classmethod @deprecated( @@ -302,8 +302,9 @@ def process(self, doc, dirpath, fn): :param fn: The filename. :type fn: str :returns: An index document, that means an instance of mapping. - :rtype: mapping""" - result = dict() + :rtype: mapping + """ + result = {} for key, value in doc.items(): if value is None or isinstance(value, bool): result[key] = value @@ -430,7 +431,7 @@ def __init__(self, root): from .project import get_project root = get_project(root=root).workspace() - self._statepoints = dict() + self._statepoints = {} return super().__init__(root=root) def _get_job_id(self, dirpath): diff --git a/signac/contrib/job.py b/signac/contrib/job.py index b9e3800a9..96fe021a0 100644 --- a/signac/contrib/job.py +++ b/signac/contrib/job.py @@ -102,7 +102,7 @@ def __init__(self, project, statepoint, _id=None): self._stores = H5StoreManager(self._wd) # Prepare current working directory for context management - self._cwd = list() + self._cwd = [] @deprecated( deprecated_in="1.3", @@ -210,7 +210,7 @@ def reset_statepoint(self, new_statepoint): self._fn_doc = dst._fn_doc self._document = None self._data = None - self._cwd = list() + self._cwd = [] logger.info(f"Moved '{self}' -> '{dst}'.") def _reset_sp(self, new_sp=None): diff --git a/signac/contrib/linked_view.py b/signac/contrib/linked_view.py index b0dfe019c..1a96e3e38 100644 --- a/signac/contrib/linked_view.py +++ b/signac/contrib/linked_view.py @@ -100,7 +100,7 @@ def create_linked_view(project, prefix=None, job_ids=None, index=None, path=None path_function = _make_path_function(jobs, path) - links = dict() + links = {} for job in jobs: paths = os.path.join(path_function(job), "job") links[paths] = job.workspace() @@ -251,7 +251,7 @@ class _Node: def __init__(self, name=None, value=None): self.name = name self.value = value - self.children = dict() + self.children = {} def get_child(self, name): """Get child node corresponding to the name passed. @@ -316,7 +316,7 @@ def _get_branches(root, branch=None): """ if branch is None: - branch = list() + branch = [] else: branch = list(branch) + [root] if root.children: @@ -362,7 +362,7 @@ def _find_dead_branches(root, branch=None): """ if branch is None: - branch = list() + branch = [] else: branch = list(branch) + [root] if root.children: diff --git a/signac/contrib/project.py b/signac/contrib/project.py index 0d9fce619..8d3ac5eb8 100644 --- a/signac/contrib/project.py +++ b/signac/contrib/project.py @@ -230,8 +230,8 @@ def __init__(self, config=None, _ignore_schema_version=False): raise # Internal caches - self._index_cache = dict() - self._sp_cache = dict() + self._index_cache = {} + self._sp_cache = {} self._sp_cache_misses = 0 self._sp_cache_warned = False self._sp_cache_miss_warning_threshold = self._config.get( @@ -1158,7 +1158,7 @@ def write_statepoints(self, statepoints=None, fn=None, indent=2): except OSError as error: if not error.errno == errno.ENOENT: raise - tmp = dict() + tmp = {} if statepoints is None: job_ids = self._job_dirs() _cache = {_id: self._get_statepoint(_id) for _id in job_ids} diff --git a/signac/contrib/schema.py b/signac/contrib/schema.py index 1a9883649..a524e3784 100644 --- a/signac/contrib/schema.py +++ b/signac/contrib/schema.py @@ -115,7 +115,7 @@ class ProjectSchema: def __init__(self, schema=None): if schema is None: - schema = dict() + schema = {} self._schema = schema @classmethod @@ -340,7 +340,7 @@ def __call__(self, jobs_or_statepoints): Schema of the project. """ - s = dict() + s = {} iterators = itertools.tee(jobs_or_statepoints, len(self)) for key, it in zip(self, iterators): values = [] diff --git a/signac/contrib/utility.py b/signac/contrib/utility.py index d738de96a..662351701 100644 --- a/signac/contrib/utility.py +++ b/signac/contrib/utility.py @@ -389,13 +389,13 @@ def _dotted_dict_to_nested_dicts(dotted_dict, delimiter_nested="."): A mapping instance with nested dicts, e.g. {'a': {'b': 'c'}}. """ - nested_dict = dict() + nested_dict = {} for key, value in dotted_dict.items(): tokens = key.split(delimiter_nested) if len(tokens) > 1: - tmp = nested_dict.setdefault(tokens[0], dict()) + tmp = nested_dict.setdefault(tokens[0], {}) for token in tokens[1:-1]: - tmp = tmp.setdefault(token, dict()) + tmp = tmp.setdefault(token, {}) tmp[tokens[-1]] = value else: nested_dict[tokens[0]] = value diff --git a/signac/core/dict_manager.py b/signac/core/dict_manager.py index 60ebd3443..d2f845e22 100644 --- a/signac/core/dict_manager.py +++ b/signac/core/dict_manager.py @@ -29,7 +29,7 @@ def __init__(self, prefix): self.suffix is not None ), "Subclasses of DictManager must define the suffix variable." self._prefix = os.path.abspath(prefix) - self._dict_registry = dict() + self._dict_registry = {} @property def prefix(self): diff --git a/signac/core/jsondict.py b/signac/core/jsondict.py index b09ef7a6c..c97bb59af 100644 --- a/signac/core/jsondict.py +++ b/signac/core/jsondict.py @@ -25,9 +25,9 @@ _BUFFERED_MODE_FORCE_WRITE = None _BUFFER_SIZE = None _BUFFER_LOAD = 0 -_JSONDICT_BUFFER = dict() -_JSONDICT_HASHES = dict() -_JSONDICT_META = dict() +_JSONDICT_BUFFER = {} +_JSONDICT_HASHES = {} +_JSONDICT_META = {} class BufferException(Error): @@ -286,7 +286,7 @@ def _load(self): # Just load from disk blob = self._load_from_disk() - return dict() if blob is None else json.loads(blob.decode()) + return {} if blob is None else json.loads(blob.decode()) def _save(self, data=None): assert self._filename is not None diff --git a/signac/core/synceddict.py b/signac/core/synceddict.py index 45f2f43c0..3e30e800c 100644 --- a/signac/core/synceddict.py +++ b/signac/core/synceddict.py @@ -84,7 +84,7 @@ def __init__(self, initialdata=None, parent=None): self._parent = parent super().__init__() if initialdata is None: - self._data = dict() + self._data = {} else: self._data = { self._validate_key(k): self._dfs_convert(v) @@ -142,7 +142,7 @@ def _convert_to_dict(cls, root): # checks instead of isinstance() to avoid catching NumPy values. return root elif type(root) is cls: - ret = dict() + ret = {} with root._suspend_sync(): for k in root: ret[k] = cls._convert_to_dict(root[k]) diff --git a/signac/version.py b/signac/version.py index 36dcc481d..3a0649bc1 100644 --- a/signac/version.py +++ b/signac/version.py @@ -4,7 +4,7 @@ """Define signac version.""" -__version__ = "1.5.0" +__version__ = "1.5.1" SCHEMA_VERSION = "1" diff --git a/tests/test_indexing.py b/tests/test_indexing.py index fdacde50d..63521f6c9 100644 --- a/tests/test_indexing.py +++ b/tests/test_indexing.py @@ -73,7 +73,7 @@ def close(self): class _TestFS: name = "inmemorytestgrid" - files: Dict[str, Dict] = dict() + files: Dict[str, Dict] = {} class FileExistsError(IOError): pass diff --git a/tests/test_job.py b/tests/test_job.py index 8be19f3bc..0855b3010 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -47,7 +47,7 @@ def builtins_dict(): random.shuffle(BUILTINS) - d = dict() + d = {} for b in BUILTINS: d.update(b[0]) return d @@ -428,7 +428,7 @@ class A: job.sp[key] = "test" with pytest.raises(KeyTypeError): job.sp = {key: "test"} - for key in ([], {}, dict()): + for key in ([], {}): with pytest.raises(TypeError): job.sp[key] = "test" with pytest.raises(TypeError): @@ -455,7 +455,7 @@ class A: job.doc[key] = "test" with pytest.raises(KeyTypeError): job.doc = {key: "test"} - for key in ([], {}, dict()): + for key in ([], {}): with pytest.raises(TypeError): job.doc[key] = "test" with pytest.raises(TypeError): diff --git a/tests/test_jsondict.py b/tests/test_jsondict.py index cddd70060..241b44b2a 100644 --- a/tests/test_jsondict.py +++ b/tests/test_jsondict.py @@ -54,7 +54,7 @@ def test_set_get_explicit_nested(self): jsd = self.get_json_dict() key = "setgetexplicitnested" d = self.get_testdata() - jsd.setdefault("a", dict()) + jsd.setdefault("a", {}) child1 = jsd["a"] child2 = jsd["a"] assert child1 == child2 @@ -244,7 +244,7 @@ class A: for key in (0.0, A(), (1, 2, 3)): with pytest.raises(KeyTypeError): jsd[key] = self.get_testdata() - for key in ([], {}, dict()): + for key in ([], {}): with pytest.raises(TypeError): jsd[key] = self.get_testdata() diff --git a/tests/test_project.py b/tests/test_project.py index 759efe3f8..23e383faf 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -578,13 +578,13 @@ def test_signac_project_crawler(self): for sp in statepoints: self.project.open_job(sp).document["test"] = True job_ids = {job.id for job in self.project.find_jobs()} - index = dict() + index = {} for doc in self.project.index(): index[doc["_id"]] = doc assert len(index) == len(job_ids) assert set(index.keys()) == set(job_ids) crawler = signac.contrib.SignacProjectCrawler(self.project.root_directory()) - index2 = dict() + index2 = {} for doc in crawler.crawl(): index2[doc["_id"]] = doc for _id, _id2 in zip(index, index2): @@ -595,7 +595,7 @@ def test_signac_project_crawler(self): with open(job.fn("test.txt"), "w") as file: file.write("test\n") formats = {r".*" + re.escape(os.path.sep) + r"test\.txt": "TextFile"} - index = dict() + index = {} for doc in self.project.index(formats): index[doc["_id"]] = doc assert len(index) == 2 * len(job_ids) @@ -613,7 +613,7 @@ def process(self_, doc, dirpath, fn): for p, fmt in formats.items(): with pytest.deprecated_call(): Crawler.define(p, fmt) - index2 = dict() + index2 = {} for doc in Crawler(root=self.project.root_directory()).crawl(): index2[doc["_id"]] = doc assert index == index2 diff --git a/tests/test_sync.py b/tests/test_sync.py index 3297ba919..f6bd713a1 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -204,7 +204,7 @@ def test_create_backup_dryrun(self): class TestFileModifyProxyDocBackup: @pytest.fixture(autouse=True) def setUp(self): - self.doc = dict() + self.doc = {} def test_create_doc_dict(self): proxy = _FileModifyProxy()