From 5093febef090d9b8438421085449a29607ba5b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20W=C3=B6lflein?= Date: Fri, 27 Nov 2020 19:36:46 +0000 Subject: [PATCH 1/4] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 81101a1..01969b9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![build](https://github.com/georgw777/recap/workflows/build/badge.svg) -_Recap_ is a tool for providing _REproducible Configurations for Any Project_. +_recap_ is a tool for providing _REproducible Configurations for Any Project_. Research should be reproducible. Especially in deep learning, it is important to keep track of hyperparameters and configurations used in experiments. @@ -25,7 +25,7 @@ from recap import URI, CfgNode as CN ``` The `CfgNode` is a subclass of [yacs](https://github.com/rbgirshick/yacs)' `CfgNode`. -It provides some additional features for parsing configurations that are inherited between files which is not possible with [yacs](https://github.com/rbgirshick/yacs). +It provides some additional features for parsing configurations that are inherited between files which is not possible with yacs. Recap's `URI` class provides a mechanism for handling logical paths within your project more conveniently with an interface that is fully compatible with `pathlib.Path`. From 7212a439321265f5d5b5df9e60cf5b76a47eaae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20W=C3=B6lflein?= Date: Wed, 16 Dec 2020 17:24:59 +0100 Subject: [PATCH 2/4] Add support for python 3.6 --- .github/workflows/build.yml | 2 +- poetry.lock | 54 ++++++++++++++++++++++++------------- pyproject.toml | 2 +- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37fa7b5..95b58c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/poetry.lock b/poetry.lock index 0508d9b..b6ca8f1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -66,14 +66,18 @@ marker = "python_version < \"3.8\"" name = "importlib-metadata" optional = false python-versions = ">=3.6" -version = "3.1.0" +version = "3.3.0" [package.dependencies] zipp = ">=0.5" +[package.dependencies.typing-extensions] +python = "<3.8" +version = ">=3.6.4" + [package.extras] -docs = ["sphinx", "rst.linker"] -testing = ["packaging", "pep517", "unittest2", "importlib-resources (>=1.3)"] +docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] +testing = ["pytest (>=3.5,<3.7.3 || >3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] [[package]] category = "dev" @@ -118,11 +122,10 @@ description = "Core utilities for Python packages" name = "packaging" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "20.4" +version = "20.8" [package.dependencies] pyparsing = ">=2.0.2" -six = "*" [[package]] category = "dev" @@ -146,7 +149,7 @@ description = "library with cross-python path, ini-parsing, io, code, log facili name = "py" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.9.0" +version = "1.10.0" [[package]] category = "dev" @@ -184,16 +187,16 @@ category = "dev" description = "pytest: simple powerful testing with Python" name = "pytest" optional = false -python-versions = ">=3.5" -version = "6.1.2" +python-versions = ">=3.6" +version = "6.2.1" [package.dependencies] atomicwrites = ">=1.0" -attrs = ">=17.4.0" +attrs = ">=19.2.0" colorama = "*" iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<1.0" +pluggy = ">=0.12,<1.0.0a1" py = ">=1.8.2" toml = "*" @@ -202,7 +205,6 @@ python = "<3.8" version = ">=0.12" [package.extras] -checkqa_mypy = ["mypy (0.780)"] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] [[package]] @@ -238,6 +240,15 @@ optional = false python-versions = "*" version = "1.4.1" +[[package]] +category = "dev" +description = "Backported and Experimental Type Hints for Python 3.5+" +marker = "python_version < \"3.8\"" +name = "typing-extensions" +optional = false +python-versions = "*" +version = "3.7.4.3" + [[package]] category = "dev" description = "Module for decorators, wrappers and monkey patching." @@ -296,8 +307,8 @@ colorama = [ {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, ] importlib-metadata = [ - {file = "importlib_metadata-3.1.0-py2.py3-none-any.whl", hash = "sha256:590690d61efdd716ff82c39ca9a9d4209252adfe288a4b5721181050acbd4175"}, - {file = "importlib_metadata-3.1.0.tar.gz", hash = "sha256:d9b8a46a0885337627a6430db287176970fff18ad421becec1d64cfc763c2099"}, + {file = "importlib_metadata-3.3.0-py3-none-any.whl", hash = "sha256:bf792d480abbd5eda85794e4afb09dd538393f7d6e6ffef6e9f03d2014cf9450"}, + {file = "importlib_metadata-3.3.0.tar.gz", hash = "sha256:5c5a2720817414a6c41f0a49993908068243ae02c1635a228126519b509c8aed"}, ] iniconfig = [ {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, @@ -335,16 +346,16 @@ mccabe = [ {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] packaging = [ - {file = "packaging-20.4-py2.py3-none-any.whl", hash = "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181"}, - {file = "packaging-20.4.tar.gz", hash = "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"}, + {file = "packaging-20.8-py2.py3-none-any.whl", hash = "sha256:24e0da08660a87484d1602c30bb4902d74816b6985b93de36926f5bc95741858"}, + {file = "packaging-20.8.tar.gz", hash = "sha256:78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093"}, ] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, ] py = [ - {file = "py-1.9.0-py2.py3-none-any.whl", hash = "sha256:366389d1db726cd2fcfc79732e75410e5fe4d31db13692115529d34069a043c2"}, - {file = "py-1.9.0.tar.gz", hash = "sha256:9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342"}, + {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, + {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, ] pycodestyle = [ {file = "pycodestyle-2.6.0-py2.py3-none-any.whl", hash = "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367"}, @@ -359,8 +370,8 @@ pyparsing = [ {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, ] pytest = [ - {file = "pytest-6.1.2-py3-none-any.whl", hash = "sha256:4288fed0d9153d9646bfcdf0c0428197dba1ecb27a33bb6e031d002fa88653fe"}, - {file = "pytest-6.1.2.tar.gz", hash = "sha256:c0a7e94a8cdbc5422a51ccdad8e6f1024795939cc89159a0ae7f0b316ad3823e"}, + {file = "pytest-6.2.1-py3-none-any.whl", hash = "sha256:1969f797a1a0dbd8ccf0fecc80262312729afea9c17f1d70ebf85c5e76c6f7c8"}, + {file = "pytest-6.2.1.tar.gz", hash = "sha256:66e419b1899bc27346cb2c993e12c5e5e8daba9073c1fbce33b9807abc95c306"}, ] pyyaml = [ {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, @@ -406,6 +417,11 @@ typed-ast = [ {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, ] +typing-extensions = [ + {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, + {file = "typing_extensions-3.7.4.3-py3-none-any.whl", hash = "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918"}, + {file = "typing_extensions-3.7.4.3.tar.gz", hash = "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"}, +] wrapt = [ {file = "wrapt-1.12.1.tar.gz", hash = "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"}, ] diff --git a/pyproject.toml b/pyproject.toml index 8dcc9c7..473adf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ include = [ ] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.6" yacs = "^0.1.8" pyyaml = "^5.3.1" From 12cd4414741b923505cacb75a0cf01cc531c6158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20W=C3=B6lflein?= Date: Wed, 16 Dec 2020 17:29:05 +0100 Subject: [PATCH 3/4] Fix annotations to ensure compatibility with python 3.6 --- recap/config.py | 3 +-- recap/path_manager.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/recap/config.py b/recap/config.py index ae0157d..683db2f 100644 --- a/recap/config.py +++ b/recap/config.py @@ -1,4 +1,3 @@ -from __future__ import annotations import os from typing import Dict, Any from pathlib import Path @@ -26,7 +25,7 @@ def ensure_cfgnode(item): super().__init__(init_dict=init_dict, key_list=key_list, new_allowed=new_allowed) @classmethod - def load_yaml_with_base(cls, filename: os.PathLike) -> CfgNode: + def load_yaml_with_base(cls, filename: os.PathLike) -> "CfgNode": uri = URI(filename) with uri.open("r") as f: cfg = cls.load_cfg(f) diff --git a/recap/path_manager.py b/recap/path_manager.py index 560a7af..200cf0b 100644 --- a/recap/path_manager.py +++ b/recap/path_manager.py @@ -1,4 +1,3 @@ -from __future__ import annotations from pathlib import Path, PurePath, _PosixFlavour from typing import Callable import logging @@ -66,7 +65,7 @@ def resolve(self, path: os.PathLike) -> Path: else: return Path(path.path) - def register_handler(self, scheme: str) -> Callable: + def register_handler(self, scheme: str) -> callable: def decorator(func: Callable[[os.PathLike], Path]): self._handlers[scheme] = func logger.debug(f"Registered path handler for scheme {scheme}") From 35b3516cb93db2ee9e83429f4d070c520c38637b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20W=C3=B6lflein?= Date: Wed, 16 Dec 2020 17:30:44 +0100 Subject: [PATCH 4/4] Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 473adf9..df09a2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "recap" -version = "0.1.2" +version = "0.1.3" description = "Reproducible configurations for any project" authors = ["Georg Wölflein "] license = "Apache-2.0"