Use the toml library instead

It was already be installed by `black`.
This commit is contained in:
MinchinWeb 2020-04-06 21:21:43 -06:00
parent ad7cf5378a
commit 9a94b08a32
3 changed files with 4 additions and 16 deletions

View file

@ -20,7 +20,7 @@ import tzlocal
import shlex
import sys
from pathlib import Path
import tomlkit
import toml
consts = pdt.Constants(usePyICU=False)
consts.DOWParseStyle = -1 # Prefers past weekdays
@ -213,7 +213,7 @@ def check_output_time_inline(context, text):
def check_output_version_inline(context):
out = context.stdout_capture.getvalue()
pyproject = (Path(__file__) / '..' / '..' / '..' / 'pyproject.toml').resolve()
pyproject_contents = tomlkit.parse(pyproject.open().read())
pyproject_contents = toml.load(pyproject)
pyproject_version = pyproject_contents['tool']['poetry']['version']
assert pyproject_version in out, pyproject_version

14
poetry.lock generated
View file

@ -481,14 +481,6 @@ optional = false
python-versions = "*"
version = "0.10.0"
[[package]]
category = "dev"
description = "Style preserving TOML library"
name = "tomlkit"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "0.5.11"
[[package]]
category = "dev"
description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed."
@ -530,7 +522,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
testing = ["jaraco.itertools", "func-timeout"]
[metadata]
content-hash = "cdaaa36d5431249548e74e1315f5288cbf2e0abf665fd71c462881d574fb28fa"
content-hash = "afeb906a1ba51bc9fc4e8c19c0b2c63bb5c9529697c9496d6edb64b509da9e0f"
python-versions = ">=3.6.0, <3.9.0"
[metadata.files]
@ -803,10 +795,6 @@ toml = [
{file = "toml-0.10.0-py2.py3-none-any.whl", hash = "sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e"},
{file = "toml-0.10.0.tar.gz", hash = "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c"},
]
tomlkit = [
{file = "tomlkit-0.5.11-py2.py3-none-any.whl", hash = "sha256:4e1bd6c9197d984528f9ff0cc9db667c317d8881288db50db20eeeb0f6b0380b"},
{file = "tomlkit-0.5.11.tar.gz", hash = "sha256:f044eda25647882e5ef22b43a1688fb6ab12af2fc50e8456cdfc751c873101cf"},
]
tornado = [
{file = "tornado-6.0.3-cp35-cp35m-win32.whl", hash = "sha256:c9399267c926a4e7c418baa5cbe91c7d1cf362d505a1ef898fde44a07c9dd8a5"},
{file = "tornado-6.0.3-cp35-cp35m-win_amd64.whl", hash = "sha256:398e0d35e086ba38a0427c3b37f4337327231942e731edaa6e9fd1865bbd6f60"},

View file

@ -35,7 +35,7 @@ behave = "^1.2"
mkdocs = "^1.0"
flake8 = "^3.7"
black = {version = "^19.10b0",allow-prereleases = true}
tomlkit = "^0.5.11"
toml = "^0.10.0"
[tool.poetry.scripts]
jrnl = 'jrnl.cli:run'