Upgrade from tomlkit to tomli
This commit is contained in:
parent
46030fc997
commit
9ecf784458
@ -16,8 +16,8 @@ from datetime import date
|
||||
from pathlib import Path
|
||||
from typing import Dict, List
|
||||
|
||||
import tomli
|
||||
from recommonmark.transform import AutoStructify
|
||||
from tomlkit import parse
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
@ -29,7 +29,7 @@ author = "Arjan J. Molenaar"
|
||||
version = ""
|
||||
project_dir = Path(__file__).resolve().parent.parent
|
||||
f = project_dir.joinpath("pyproject.toml")
|
||||
release = str(parse(f.read_text())["tool"]["poetry"]["version"])
|
||||
release = str(tomli.loads(f.read_text())["tool"]["poetry"]["version"])
|
||||
sys.path.append(str(project_dir))
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
@ -6,7 +6,7 @@ Sphinx==4.1.2
|
||||
sphinx-rtd-theme==0.5.2
|
||||
sphinxcontrib-websupport==1.2.4
|
||||
sphinxcontrib-images==0.9.4
|
||||
tomlkit==0.7.2
|
||||
tomli==1.2.1
|
||||
generic==1.0.0
|
||||
typing_extensions==3.10.0.2
|
||||
importlib_metadata==4.8.1
|
||||
|
@ -3,7 +3,7 @@ import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pyinstaller_versionfile
|
||||
import tomlkit
|
||||
import tomli
|
||||
|
||||
packaging_path = Path(__file__).resolve().parent
|
||||
|
||||
@ -11,13 +11,13 @@ packaging_path = Path(__file__).resolve().parent
|
||||
def get_version() -> str:
|
||||
project_dir = Path(__file__).resolve().parent.parent
|
||||
f = project_dir / "pyproject.toml"
|
||||
return str(tomlkit.parse(f.read_text())["tool"]["poetry"]["version"])
|
||||
return str(tomli.loads(f.read_text())["tool"]["poetry"]["version"])
|
||||
|
||||
|
||||
def make_gaphor_script():
|
||||
pyproject_toml = packaging_path.parent / "pyproject.toml"
|
||||
with open(pyproject_toml) as f:
|
||||
toml = tomlkit.parse(f.read())
|
||||
with open(pyproject_toml, "rb") as f:
|
||||
toml = tomli.load(f)
|
||||
|
||||
gaphor_script = packaging_path / "gaphor-script.py"
|
||||
with open(gaphor_script, "w") as file:
|
||||
|
@ -45,9 +45,10 @@ tinycss2 = "^1.0.2"
|
||||
pyinstaller = { version = "^4.3", optional = true }
|
||||
pyinstaller-versionfile = { version = "^2.0.0", optional = true }
|
||||
poethepoet = { version = "^0.10.0", optional = true }
|
||||
tomli = { version = "^1.2", optional = true }
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
tomlkit = "^0.7"
|
||||
tomli = "^1.2"
|
||||
pytest = "^6.2"
|
||||
pytest-cov = "^2.12"
|
||||
pytest-mock = "^3.6.1"
|
||||
@ -66,7 +67,7 @@ isort = "^5.9"
|
||||
poethepoet = "^0.10.0"
|
||||
|
||||
[tool.poetry.extras]
|
||||
pyinstall = ["poethepoet", "pyinstaller", "pyinstaller-versionfile"]
|
||||
pyinstall = ["poethepoet", "pyinstaller", "pyinstaller-versionfile", "tomli"]
|
||||
|
||||
[tool.poetry.scripts]
|
||||
gaphor = "gaphor.ui:main"
|
||||
|
Loading…
Reference in New Issue
Block a user