From 8752f02566d509b9f4098281a4b147f26c8e69b0 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 1 Oct 2022 12:45:48 -0500 Subject: [PATCH 1/7] build: vcspull/_internal: Add __init__.py for mypy --- src/vcspull/_internal/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/vcspull/_internal/__init__.py diff --git a/src/vcspull/_internal/__init__.py b/src/vcspull/_internal/__init__.py new file mode 100644 index 00000000..e69de29b From 521670a9a5e8825fcaa7344787d06e2fcef33a83 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 1 Oct 2022 10:15:23 -0500 Subject: [PATCH 2/7] feat: Add ConfigReader --- src/vcspull/_internal/config_reader.py | 200 +++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 src/vcspull/_internal/config_reader.py diff --git a/src/vcspull/_internal/config_reader.py b/src/vcspull/_internal/config_reader.py new file mode 100644 index 00000000..32ccbfe2 --- /dev/null +++ b/src/vcspull/_internal/config_reader.py @@ -0,0 +1,200 @@ +import json +import pathlib +import typing as t + +import yaml + +if t.TYPE_CHECKING: + from typing_extensions import Literal, TypeAlias + + FormatLiteral = Literal["json", "yaml"] + + RawConfigData: TypeAlias = t.Dict[t.Any, t.Any] + + +class ConfigReader: + r"""Parse string data (YAML and JSON) into a dictionary. + + >>> cfg = ConfigReader({ "session_name": "my session" }) + >>> cfg.dump("yaml") + 'session_name: my session\n' + >>> cfg.dump("json") + '{\n "session_name": "my session"\n}' + """ + + def __init__(self, content: "RawConfigData"): + self.content = content + + @staticmethod + def _load(format: "FormatLiteral", content: str): + """Load raw config data and directly return it. + + >>> ConfigReader._load("json", '{ "session_name": "my session" }') + {'session_name': 'my session'} + + >>> ConfigReader._load("yaml", 'session_name: my session') + {'session_name': 'my session'} + """ + if format == "yaml": + return yaml.load( + content, + Loader=yaml.SafeLoader, + ) + elif format == "json": + return json.loads(content) + else: + raise NotImplementedError(f"{format} not supported in configuration") + + @classmethod + def load(cls, format: "FormatLiteral", content: str): + """Load raw config data into a ConfigReader instance (to dump later). + + >>> cfg = ConfigReader.load("json", '{ "session_name": "my session" }') + >>> cfg + + >>> cfg.content + {'session_name': 'my session'} + + >>> cfg = ConfigReader.load("yaml", 'session_name: my session') + >>> cfg + + >>> cfg.content + {'session_name': 'my session'} + """ + return cls( + content=cls._load( + format=format, + content=content, + ), + ) + + @classmethod + def _from_file(cls, path: pathlib.Path): + r"""Load data from file path directly to dictionary. + + **YAML file** + + *For demonstration only,* create a YAML file: + + >>> yaml_file = tmp_path / 'my_config.yaml' + >>> yaml_file.write_text('session_name: my session', encoding='utf-8') + 24 + + *Read YAML file*: + + >>> ConfigReader._from_file(yaml_file) + {'session_name': 'my session'} + + **JSON file** + + *For demonstration only,* create a JSON file: + + >>> json_file = tmp_path / 'my_config.json' + >>> json_file.write_text('{"session_name": "my session"}', encoding='utf-8') + 30 + + *Read JSON file*: + + >>> ConfigReader._from_file(json_file) + {'session_name': 'my session'} + """ + assert isinstance(path, pathlib.Path) + content = open(path).read() + + if path.suffix in [".yaml", ".yml"]: + format: FormatLiteral = "yaml" + elif path.suffix == ".json": + format = "json" + else: + raise NotImplementedError(f"{path.suffix} not supported in {path}") + + return cls._load( + format=format, + content=content, + ) + + @classmethod + def from_file(cls, path: pathlib.Path): + r"""Load data from file path + + **YAML file** + + *For demonstration only,* create a YAML file: + + >>> yaml_file = tmp_path / 'my_config.yaml' + >>> yaml_file.write_text('session_name: my session', encoding='utf-8') + 24 + + *Read YAML file*: + + >>> cfg = ConfigReader.from_file(yaml_file) + >>> cfg + + + >>> cfg.content + {'session_name': 'my session'} + + **JSON file** + + *For demonstration only,* create a JSON file: + + >>> json_file = tmp_path / 'my_config.json' + >>> json_file.write_text('{"session_name": "my session"}', encoding='utf-8') + 30 + + *Read JSON file*: + + >>> cfg = ConfigReader.from_file(json_file) + >>> cfg + + + >>> cfg.content + {'session_name': 'my session'} + """ + return cls(content=cls._from_file(path=path)) + + @staticmethod + def _dump( + format: "FormatLiteral", + content: "RawConfigData", + indent: int = 2, + **kwargs: t.Any, + ) -> str: + r"""Dump directly. + + >>> ConfigReader._dump("yaml", { "session_name": "my session" }) + 'session_name: my session\n' + + >>> ConfigReader._dump("json", { "session_name": "my session" }) + '{\n "session_name": "my session"\n}' + """ + if format == "yaml": + return yaml.dump( + content, + indent=2, + default_flow_style=False, + Dumper=yaml.SafeDumper, + ) + elif format == "json": + return json.dumps( + content, + indent=2, + ) + else: + raise NotImplementedError(f"{format} not supported in config") + + def dump(self, format: "FormatLiteral", indent: int = 2, **kwargs: t.Any) -> str: + r"""Dump via ConfigReader instance. + + >>> cfg = ConfigReader({ "session_name": "my session" }) + >>> cfg.dump("yaml") + 'session_name: my session\n' + >>> cfg.dump("json") + '{\n "session_name": "my session"\n}' + """ + return self._dump( + format=format, + content=self.content, + indent=indent, + **kwargs, + ) From fc0d9e9c1dc36ef40ea1f72b1d79cdd617ecfa93 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 1 Oct 2022 10:36:10 -0500 Subject: [PATCH 3/7] docs(conf): Add defaults autodoc options --- docs/conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index f8d99a53..b75415ec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -98,6 +98,13 @@ autoclass_content = "both" autodoc_member_order = "bysource" toc_object_entries_show_parents = "hide" +autodoc_default_options = { + "undoc-members": True, + "members": True, + "private-members": True, + "show-inheritance": True, + "member-order": "bysource", +} # sphinx-autodoc-typehints autodoc_typehints = "description" # show type hints in doc body instead of signature From ffe0b6ecbb8fb533b1d2f4bf36a879ccbba13cb6 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 1 Oct 2022 12:31:44 -0500 Subject: [PATCH 4/7] refactor(config): Fix import typing --- src/vcspull/config.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/vcspull/config.py b/src/vcspull/config.py index e68836ef..18bcc976 100644 --- a/src/vcspull/config.py +++ b/src/vcspull/config.py @@ -10,7 +10,6 @@ import os import pathlib import typing as t -from typing import Literal, Optional, Union import kaptan @@ -161,10 +160,10 @@ def find_home_config_files( def find_config_files( - path: Optional[Union[list[pathlib.Path], pathlib.Path]] = None, - match: Union[list[str], str] = ["*"], - filetype: Union[ - Literal["json", "yaml", "*"], list[Literal["json", "yaml", "*"]] + path: t.Optional[t.Union[list[pathlib.Path], pathlib.Path]] = None, + match: t.Union[list[str], str] = ["*"], + filetype: t.Union[ + t.Literal["json", "yaml", "*"], list[t.Literal["json", "yaml", "*"]] ] = ["json", "yaml"], include_home: bool = False, ): @@ -325,9 +324,9 @@ def in_dir(config_dir=None, extensions: list[str] = [".yml", ".yaml", ".json"]): def filter_repos( config: list[ConfigDict], - dir: Union[pathlib.Path, Literal["*"], None] = None, - vcs_url: Union[str, None] = None, - name: Union[str, None] = None, + dir: t.Union[pathlib.Path, t.Literal["*"], None] = None, + vcs_url: t.Union[str, None] = None, + name: t.Union[str, None] = None, ) -> list[ConfigDict]: """Return a :py:obj:`list` list of repos from (expanded) config file. @@ -376,7 +375,7 @@ def filter_repos( def is_config_file( - filename: str, extensions: Union[list[str], str] = [".yml", ".yaml", ".json"] + filename: str, extensions: t.Union[list[str], str] = [".yml", ".yaml", ".json"] ): """Return True if file has a valid config file type. From 0000bfee9e2939120e3dacfa1a0277a953afa52a Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 1 Oct 2022 12:41:29 -0500 Subject: [PATCH 5/7] refactor!(config reader): kaptan -> ConfigReader --- src/vcspull/config.py | 8 +++----- tests/helpers.py | 9 ++------- tests/test_config_file.py | 29 ++++++++++++----------------- tests/test_sync.py | 12 +++++------- 4 files changed, 22 insertions(+), 36 deletions(-) diff --git a/src/vcspull/config.py b/src/vcspull/config.py index 18bcc976..d1f5c442 100644 --- a/src/vcspull/config.py +++ b/src/vcspull/config.py @@ -11,10 +11,9 @@ import pathlib import typing as t -import kaptan - from libvcs._internal.types import StrPath from libvcs.sync.git import GitRemote +from vcspull._internal.config_reader import ConfigReader from . import exc from .types import ConfigDict, RawConfigDict @@ -241,9 +240,8 @@ def load_configs(files: list[StrPath], cwd=pathlib.Path.cwd()): if isinstance(file, str): file = pathlib.Path(file) assert isinstance(file, pathlib.Path) - ext = file.suffix.lstrip(".") - conf = kaptan.Kaptan(handler=ext).import_config(str(file)) - newrepos = extract_repos(conf.export("dict"), cwd=cwd) + conf = ConfigReader._from_file(file) + newrepos = extract_repos(conf, cwd=cwd) if not repos: repos.extend(newrepos) diff --git a/tests/helpers.py b/tests/helpers.py index 35823cef..be496840 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,10 +1,9 @@ """Helpers for vcspull.""" import os import pathlib -import textwrap from typing import Literal -import kaptan +from vcspull._internal.config_reader import ConfigReader class EnvironmentVarGuard: @@ -48,9 +47,5 @@ def write_config(config_path: pathlib.Path, content: str) -> pathlib.Path: return config_path -def import_raw(data: str, format: Literal["yaml", "json"]) -> kaptan.Kaptan: - return kaptan.Kaptan(handler=format).import_config(textwrap.dedent(data)) - - def load_raw(data: str, format: Literal["yaml", "json"]) -> dict: - return import_raw(data=data, format=format).export("dict") + return ConfigReader._load(format=format, content=data) diff --git a/tests/test_config_file.py b/tests/test_config_file.py index e3b21aab..9219e2f5 100644 --- a/tests/test_config_file.py +++ b/tests/test_config_file.py @@ -5,13 +5,12 @@ import pytest -import kaptan - from vcspull import config, exc +from vcspull._internal.config_reader import ConfigReader from vcspull.config import expand_dir, extract_repos from .fixtures import example as fixtures -from .helpers import EnvironmentVarGuard, import_raw, load_raw, write_config +from .helpers import EnvironmentVarGuard, load_raw, write_config @pytest.fixture(scope="function") @@ -30,8 +29,9 @@ def json_config(config_path: pathlib.Path): def test_dict_equals_yaml(): # Verify that example YAML is returning expected dict format. - config = import_raw( - """\ + config = ConfigReader._load( + format="yaml", + content="""\ /home/me/myproject/study/: linux: git+git://git.kernel.org/linux/torvalds/linux.git freebsd: git+https://github.com/freebsd/freebsd.git @@ -52,37 +52,32 @@ def test_dict_equals_yaml(): shell_command_after: - ln -sf /home/me/.tmux/.tmux.conf /home/me/.tmux.conf """, - format="yaml", ) - assert fixtures.config_dict == config.export("dict") + assert fixtures.config_dict == config def test_export_json(tmp_path: pathlib.Path): json_config = tmp_path / ".vcspull.json" - json_config_file = str(json_config) - config = kaptan.Kaptan() - config.import_config(fixtures.config_dict) + config = ConfigReader(content=fixtures.config_dict) - json_config_data = config.export("json", indent=2) + json_config_data = config.dump("json", indent=2) json_config.write_text(json_config_data, encoding="utf-8") - new_config = kaptan.Kaptan().import_config(json_config_file).get() + new_config = ConfigReader._from_file(json_config) assert fixtures.config_dict == new_config def test_export_yaml(tmp_path: pathlib.Path): yaml_config = tmp_path / ".vcspull.yaml" - yaml_config_file = str(yaml_config) - config = kaptan.Kaptan() - config.import_config(fixtures.config_dict) + config = ConfigReader(content=fixtures.config_dict) - yaml_config_data = config.export("yaml", indent=2) + yaml_config_data = config.dump("yaml", indent=2) yaml_config.write_text(yaml_config_data, encoding="utf-8") - new_config = kaptan.Kaptan().import_config(yaml_config_file).get() + new_config = ConfigReader._from_file(yaml_config) assert fixtures.config_dict == new_config diff --git a/tests/test_sync.py b/tests/test_sync.py index b4319e74..78ae9531 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -4,11 +4,10 @@ import pytest -import kaptan - from libvcs._internal.shortcuts import create_project from libvcs.pytest_plugin import CreateProjectCallbackFixtureProtocol from libvcs.sync.git import GitRemote, GitSync +from vcspull._internal.config_reader import ConfigReader from vcspull.cli.sync import update_repo from vcspull.config import extract_repos, filter_repos, load_configs from vcspull.types import ConfigDict @@ -21,16 +20,15 @@ def test_makes_recursive( git_remote_repo: pathlib.Path, ): """Ensure that directories in pull are made recursively.""" - conf = kaptan.Kaptan(handler="yaml") - conf.import_config( - textwrap.dedent( + conf = ConfigReader._load( + format="yaml", + content=textwrap.dedent( f""" {tmp_path}/study/myrepo: my_url: git+file://{git_remote_repo} """ - ) + ), ) - conf = conf.export("dict") repos = extract_repos(conf) assert len(repos) > 0 From 505ac962629cdfa977c8d5f7b3c1dd208ee206e9 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 1 Oct 2022 12:47:21 -0500 Subject: [PATCH 6/7] build(deps): Remove kaptan dependency --- poetry.lock | 94 ++++++++++++++++++++++---------------------------- pyproject.toml | 7 ---- 2 files changed, 42 insertions(+), 59 deletions(-) diff --git a/poetry.lock b/poetry.lock index 161166d0..641bc396 100644 --- a/poetry.lock +++ b/poetry.lock @@ -223,7 +223,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "importlib-metadata" -version = "4.12.0" +version = "4.13.0" description = "Read metadata from Python packages" category = "dev" optional = false @@ -233,9 +233,9 @@ python-versions = ">=3.7" zipp = ">=0.5" [package.extras] -docs = ["jaraco.packaging (>=9)", "rst.linker (>=1.9)", "sphinx"] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] +testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] [[package]] name = "iniconfig" @@ -273,17 +273,6 @@ MarkupSafe = ">=2.0" [package.extras] i18n = ["Babel (>=2.7)"] -[[package]] -name = "kaptan" -version = "0.5.12" -description = "Configuration manager" -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -PyYAML = ">=3.13,<6" - [[package]] name = "libvcs" version = "0.17.0" @@ -574,11 +563,11 @@ python-versions = "*" [[package]] name = "PyYAML" -version = "5.4.1" +version = "6.0" description = "YAML parser and emitter for Python" -category = "main" +category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=3.6" [[package]] name = "requests" @@ -954,7 +943,7 @@ test = [] [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "9d6947f5fcb676e4b604b48bb6ea5076cd63f74408ee1dec44594d2389f85f64" +content-hash = "c551058abc184649683e8256fffc436d33ef57d679c341ea2de0bd93202c07c3" [metadata.files] alabaster = [ @@ -1103,8 +1092,8 @@ imagesize = [ {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, ] importlib-metadata = [ - {file = "importlib_metadata-4.12.0-py3-none-any.whl", hash = "sha256:7401a975809ea1fdc658c3aa4f78cc2195a0e019c5cbc4c06122884e9ae80c23"}, - {file = "importlib_metadata-4.12.0.tar.gz", hash = "sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670"}, + {file = "importlib_metadata-4.13.0-py3-none-any.whl", hash = "sha256:8a8a81bcf996e74fee46f0d16bd3eaa382a7eb20fd82445c3ad11f4090334116"}, + {file = "importlib_metadata-4.13.0.tar.gz", hash = "sha256:dd0173e8f150d6815e098fd354f6414b0f079af4644ddfe90c71e2fc6174346d"}, ] iniconfig = [ {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, @@ -1118,9 +1107,6 @@ Jinja2 = [ {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"}, ] -kaptan = [ - {file = "kaptan-0.5.12.tar.gz", hash = "sha256:1abd1f56731422fce5af1acc28801677a51e56f5d3c3e8636db761ed143c3dd2"}, -] libvcs = [ {file = "libvcs-0.17.0-py3-none-any.whl", hash = "sha256:c06ddfcd90d6b3ce80557bbaf91ee943dfbab51e00829be828c145032b78cac0"}, {file = "libvcs-0.17.0.tar.gz", hash = "sha256:f3ca617a688287d623a803da4e3e2fac4a4382aa7f62d3d246a669de14065660"}, @@ -1277,35 +1263,39 @@ pytz = [ {file = "pytz-2022.2.1.tar.gz", hash = "sha256:cea221417204f2d1a2aa03ddae3e867921971d0d76f14d87abb4414415bbdcf5"}, ] PyYAML = [ - {file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"}, - {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"}, - {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"}, - {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"}, - {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"}, - {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"}, - {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"}, - {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"}, - {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, + {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, + {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, + {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, + {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, + {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, + {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, + {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, + {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, + {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, + {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, + {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, + {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, + {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, ] requests = [ {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, diff --git a/pyproject.toml b/pyproject.toml index 6470d0a5..4ddd8123 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,6 @@ vcspull = 'vcspull:cli.cli' [tool.poetry.dependencies] python = "^3.9" click = "~8" -kaptan = "*" libvcs = "~0.17.0" colorama = ">=0.3.9" @@ -134,12 +133,6 @@ lint = [ python_version = 3.9 warn_unused_configs = true -[[tool.mypy.overrides]] -module = [ - "kaptan.*", -] -ignore_missing_imports = true - [tool.coverage.run] branch = true parallel = true From d29fa6df36dbd7f1001ec5db2f8c7d17f097bb50 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 1 Oct 2022 12:47:52 -0500 Subject: [PATCH 7/7] docs(CHANGES): Note move from kaptan to ConfigReader --- CHANGES | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index f946ee4b..2acdb96d 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,13 @@ $ pipx install --suffix=@next 'vcspull' --pip-args '\--pre' --force - Move test fixtures over to libvcs's pytest plugin (#398) - Move conftest.py to root directory (#399) +- Add `ConfigReader`: Our clean, typed parser for raw strings and files (#397) + + This is our shiny, new, 200-line, doctested and typed parser that replaces `kaptan`. + +### Packaging + +- Drop kaptan dependency (#397) ## vcspull v1.13.0 (2022-09-25)