Skip to content

Commit

Permalink
Release/1.5.1 (#441)
Browse files Browse the repository at this point in the history
* Update changelog.

* Update pre-commit hooks.

* Move requirements-dev.txt to requirements-test.txt to reflect that its purpose is only for CI.

* Use pip>=20.3.

* Bump up to version 1.5.1.
  • Loading branch information
bdice committed Dec 20, 2020
1 parent 5b053c0 commit ed5d1d6
Show file tree
Hide file tree
Showing 36 changed files with 82 additions and 78 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .circleci/deploy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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/.*)'
Expand Down
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@
"id": "http://www.opensource.org/licenses/BSD-3-Clause"
},
"title": "signac",
"version": "1.5.0"
"version": "1.5.1"
}
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ The **signac** package follows `semantic versioning <https://semver.org/>`_.
Version 1
=========

next
----
[1.5.1] -- 2020-12-19
---------------------

Added
+++++
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nbconvert
nbsphinx>=0.3
deprecation>=2
IPython
jupyter_client
deprecation>=2
nbconvert
nbsphinx>=0.3
sphinxcontrib-programoutput
2 changes: 1 addition & 1 deletion doc/support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion requirements-benchmark.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion requirements-dev.txt → requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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}.
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

setup(
name="signac",
version="1.5.0",
version="1.5.1",
packages=find_packages(),
zip_safe=True,
maintainer="signac Developers",
Expand Down
10 changes: 5 additions & 5 deletions signac/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
):
Expand Down Expand Up @@ -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...")
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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}'.")
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion signac/common/crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion signac/common/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


SESSION_PASSWORD_HASH_CACHE = SimpleKeyring()
SESSION_USERNAME_CACHE = dict() # type: ignore
SESSION_USERNAME_CACHE = {} # type: ignore

"""
THIS MODULE IS DEPRECATED!
Expand Down
4 changes: 2 additions & 2 deletions signac/contrib/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion signac/contrib/filesystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
GRIDFS = True

GRIDFS_LARGE_FILE_WARNING_THRSHLD = int(1e9) # 1GB
FILESYSTEM_REGISTRY = dict()
FILESYSTEM_REGISTRY = {}

"""
THIS MODULE IS DEPRECATED!
Expand Down
2 changes: 1 addition & 1 deletion signac/contrib/filterparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions signac/contrib/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -548,7 +548,7 @@ def _convert_schema_path_to_regex(schema_path):
# in the schema path.
re_key_type_field = r"\{(?P<key>[\.\w]+)(?::(?P<type>[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:])
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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()]
Expand Down
9 changes: 5 additions & 4 deletions signac/contrib/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class RegexFileCrawler(BaseCrawler):
MyCrawler.define('.*\/a_(?P<a>\d+)\.txt', 'TextFile')
"""
"Mapping of compiled regex objects and associated formats."
definitions = dict() # type: ignore
definitions = {} # type: ignore

@classmethod
@deprecated(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions signac/contrib/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions signac/contrib/linked_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ed5d1d6

Please sign in to comment.