From aa44fe7a60a4f3326cc47877b3e246b56d46d6ac Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 20 Jun 2020 13:41:35 -0500 Subject: Add python 3.5 support, ConfigFileError, and more type hints Also, get_all, set_all, and delete_all in JsonParser have been renamed to just all. --- pyproject.toml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 9cf335a..97c98c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,10 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", + "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", ] @@ -20,8 +23,8 @@ classifiers = [ test = "poetry run pytest -v --cov=config_file/ --cov-report term-missing tests/" [tool.poetry.dependencies] -python = "^3.6" -nested-lookup = "^0.2.19" +python = "^3.5" +nested-lookup = "^0.2.21" toml = { version = "^0.10.0", optional = true } pyyaml = { version = "^5.3.1", optional = true } @@ -33,19 +36,20 @@ yaml = ["pyyaml"] pre-commit = "^1.20" autoflake = "^1.3.1" isort = "^4.3.21" -seed-isort-config = "^1.9" +seed-isort-config = { version = "^2.1.1", python = "^3.6.1" } pytest = "^5.4.1" pytest-cov = "^2.8.1" +pytest-sugar = "^0.9.3" sphinx = "^2.4.4" sphinx_rtd_theme = "^0.4.3" -taskipy = "^1.2.1" +taskipy = { version = "^1.2.1", python = "^3.6" } bump2version = "^1.0.0" flake8 = "^3.7.9" -black = "^19.10b0" +black = { version = "^19.10b0", python = "^3.6" } [tool.black] line-length = 88 -target_version = ['py38'] +target_version = ['py35'] include = '\.pyi?$' [tool.isort] -- cgit v1.2.3 From 58808235ea6880c3a0ecfa976a700c81431dc902 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 20 Jun 2020 15:30:11 -0500 Subject: Revert Python 3.5 support --- pyproject.toml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 97c98c7..0f3bf5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,6 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", @@ -23,7 +22,7 @@ classifiers = [ test = "poetry run pytest -v --cov=config_file/ --cov-report term-missing tests/" [tool.poetry.dependencies] -python = "^3.5" +python = "^3.6" nested-lookup = "^0.2.21" toml = { version = "^0.10.0", optional = true } pyyaml = { version = "^5.3.1", optional = true } @@ -42,14 +41,14 @@ pytest-cov = "^2.8.1" pytest-sugar = "^0.9.3" sphinx = "^2.4.4" sphinx_rtd_theme = "^0.4.3" -taskipy = { version = "^1.2.1", python = "^3.6" } +taskipy = "^1.2.1" bump2version = "^1.0.0" flake8 = "^3.7.9" -black = { version = "^19.10b0", python = "^3.6" } +black = "^19.10b0" [tool.black] line-length = 88 -target_version = ['py35'] +target_version = ['py36'] include = '\.pyi?$' [tool.isort] -- cgit v1.2.3 From 484050afe95aa60f5e415e1c73e4ecf614bbc162 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 20 Jun 2020 15:56:03 -0500 Subject: Use xml cov report for pytest --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 0f3bf5f..5819885 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ ] [tool.taskipy.tasks] -test = "poetry run pytest -v --cov=config_file/ --cov-report term-missing tests/" +test = "poetry run pytest -v --cov=config_file/ --cov-report=xml term-missing tests/" [tool.poetry.dependencies] python = "^3.6" -- cgit v1.2.3 From 8d86ca0c8a00767257e7595c6f307827051faf7c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 20 Jun 2020 16:00:35 -0500 Subject: Add lint task and remove xml cov report --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 5819885..28f2acd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,8 @@ classifiers = [ ] [tool.taskipy.tasks] -test = "poetry run pytest -v --cov=config_file/ --cov-report=xml term-missing tests/" +test = "poetry run pytest -v --cov=config_file/ --cov-report term-missing tests/" +lint = "poetry run pre-commit run --all" [tool.poetry.dependencies] python = "^3.6" -- cgit v1.2.3 From e6d7aeeead256cf98b8fb4947424cf8ad26d0b9a Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 20 Jun 2020 16:10:07 -0500 Subject: Add test_ci taskipy task --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 28f2acd..bdf9ba3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,8 +19,11 @@ classifiers = [ ] [tool.taskipy.tasks] -test = "poetry run pytest -v --cov=config_file/ --cov-report term-missing tests/" +test = "task test_cov -- -v --cov-report term-missing" +test_cov = "task pytest -- --cov=config_file/" +test_ci = "task test_cov -- --cov-report=xml" lint = "poetry run pre-commit run --all" +pytest = "poetry run pytest tests/" [tool.poetry.dependencies] python = "^3.6" -- cgit v1.2.3 From bc1280444ea3d5d4e5b5afd4e39bfb9365689393 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 19 Jul 2020 13:17:09 -0500 Subject: Add nested-lookup to project russellballestrini is a python project in the public domain. Rather than installing it as a dependency, this adds it as part of the config-file package now, which allows more control. --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index bdf9ba3..dc93234 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,10 @@ description = "Modify configuration files of various formats with the same simpl authors = ["Eugene Triguba "] readme = "README.md" repository = "https://github.com/eugenetriguba/config_file" -keywords = ["configuration", "config file", "ini", "json", "toml", "yaml"] +documentation = "https://config-file.readthedocs.io/" +keywords = ["configuration", "ini", "json", "toml", "yaml"] classifiers = [ - "Development Status :: 2 - Pre-Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", @@ -27,7 +28,6 @@ pytest = "poetry run pytest tests/" [tool.poetry.dependencies] python = "^3.6" -nested-lookup = "^0.2.21" toml = { version = "^0.10.0", optional = true } pyyaml = { version = "^5.3.1", optional = true } @@ -59,7 +59,7 @@ include = '\.pyi?$' line_length = 88 multi_line_output = 3 include_trailing_comma = true -known_third_party = ["nested_lookup", "pytest"] +known_third_party = ["pytest", "pyyaml", "toml"] known_first_party = ["config_file"] [build-system] -- cgit v1.2.3 From 461cb78f0a56b9293b5ade10fe90ec4aa77d23ad Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 19 Jul 2020 15:02:13 -0500 Subject: Change name of BaseParser to AbstractParser --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index dc93234..4ac2043 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ include = '\.pyi?$' line_length = 88 multi_line_output = 3 include_trailing_comma = true -known_third_party = ["pytest", "pyyaml", "toml"] +known_third_party = ["pytest"] known_first_party = ["config_file"] [build-system] -- cgit v1.2.3 From 7309c0df45496e66007ea3838442413f4a3056f2 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 19 Jul 2020 20:09:35 -0500 Subject: Add napoleon to transition to Google docstring format --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 4ac2043..846059c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,12 +43,13 @@ seed-isort-config = { version = "^2.1.1", python = "^3.6.1" } pytest = "^5.4.1" pytest-cov = "^2.8.1" pytest-sugar = "^0.9.3" -sphinx = "^2.4.4" -sphinx_rtd_theme = "^0.4.3" taskipy = "^1.2.1" bump2version = "^1.0.0" flake8 = "^3.7.9" black = "^19.10b0" +sphinx = "^2.4.4" +sphinx_rtd_theme = "^0.4.3" +sphinxcontrib-napoleon = "^0.7" [tool.black] line-length = 88 -- cgit v1.2.3 From 18e714b63f5dbb3394a21baf51544f39b6ccf7ef Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 20 Jul 2020 22:06:28 -0500 Subject: Use tomlkit instead of toml & specify packages to include This constrains the public api to only what is in the __init__.py in config_file/, rather than all the other python packages in it. --- pyproject.toml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 846059c..0e883c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,11 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", ] +packages = [ + { include = "config_file" }, + { include = "tests", format = "sdist" } +] + [tool.taskipy.tasks] test = "task test_cov -- -v --cov-report term-missing" test_cov = "task pytest -- --cov=config_file/" @@ -28,11 +33,11 @@ pytest = "poetry run pytest tests/" [tool.poetry.dependencies] python = "^3.6" -toml = { version = "^0.10.0", optional = true } +tomlkit = { version = "^0.6.0", optional = true } pyyaml = { version = "^5.3.1", optional = true } [tool.poetry.extras] -toml = ["toml"] +toml = ["tomlkit"] yaml = ["pyyaml"] [tool.poetry.dev-dependencies] -- cgit v1.2.3 From d369373e8edb4f150d227d26563bb61ca48747b9 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 29 Jul 2020 17:03:48 -0500 Subject: Use ruamel.yaml instead of PyYAML for YamlParser --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 0e883c7..a6d098b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,11 +34,11 @@ pytest = "poetry run pytest tests/" [tool.poetry.dependencies] python = "^3.6" tomlkit = { version = "^0.6.0", optional = true } -pyyaml = { version = "^5.3.1", optional = true } +"ruamel.yaml" = { version = "^0.16.10", optional = true } [tool.poetry.extras] toml = ["tomlkit"] -yaml = ["pyyaml"] +yaml = ["ruamel.yaml"] [tool.poetry.dev-dependencies] pre-commit = "^1.20" -- cgit v1.2.3 From 4f26a57b16d9b87891c36a3b5d23643f2c46c90e Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 29 Jul 2020 21:27:37 -0500 Subject: Remove -v from `task test` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index a6d098b..7f05d3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ packages = [ ] [tool.taskipy.tasks] -test = "task test_cov -- -v --cov-report term-missing" +test = "task test_cov -- --cov-report term-missing" test_cov = "task pytest -- --cov=config_file/" test_ci = "task test_cov -- --cov-report=xml" lint = "poetry run pre-commit run --all" -- cgit v1.2.3 From 70851cf40e33c08c0b2728a0ef3cac20482905d5 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 7 Aug 2020 19:38:38 -0500 Subject: Add mypy, update pytest, and add lint tasks --- pyproject.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 7f05d3e..810e5c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,9 @@ packages = [ test = "task test_cov -- --cov-report term-missing" test_cov = "task pytest -- --cov=config_file/" test_ci = "task test_cov -- --cov-report=xml" -lint = "poetry run pre-commit run --all" +lint = "task lint_types && task lint_precommit" +lint_types = "poetry run mypy config_file/ tests/" +lint_precommit = "poetry run pre-commit run --all" pytest = "poetry run pytest tests/" [tool.poetry.dependencies] @@ -45,7 +47,7 @@ pre-commit = "^1.20" autoflake = "^1.3.1" isort = "^4.3.21" seed-isort-config = { version = "^2.1.1", python = "^3.6.1" } -pytest = "^5.4.1" +pytest = "^6.0.0" pytest-cov = "^2.8.1" pytest-sugar = "^0.9.3" taskipy = "^1.2.1" @@ -55,6 +57,7 @@ black = "^19.10b0" sphinx = "^2.4.4" sphinx_rtd_theme = "^0.4.3" sphinxcontrib-napoleon = "^0.7" +mypy = "^0.782" [tool.black] line-length = 88 -- cgit v1.2.3