From 0b2b66f1f633ace00460d8965f081140fe4ebe68 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 25 Jun 2021 11:51:01 +0200 Subject: [PATCH] fix #585: switch to tomli --- CHANGELOG.rst | 1 + setup.cfg | 2 +- src/setuptools_scm/integration.py | 3 ++- tox.ini | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 581e3a9e..bac5af4b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,7 @@ In progress =========== * fix #524: new parameters ``normalize`` and ``version_cls`` to customize the version normalization class. +* fix #585: switch from toml to tomli v6.0.1 ======= diff --git a/setup.cfg b/setup.cfg index bca42997..b26e945f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -69,4 +69,4 @@ setuptools_scm.version_scheme = [options.extras_require] toml = - toml + tomli~=1.0.0 diff --git a/src/setuptools_scm/integration.py b/src/setuptools_scm/integration.py index c103eb76..2e0e1e0b 100644 --- a/src/setuptools_scm/integration.py +++ b/src/setuptools_scm/integration.py @@ -38,9 +38,10 @@ def find_files(path=""): def _args_from_toml(name="pyproject.toml"): # todo: more sensible config initialization # move this helper back to config and unify it with the code from get_config + import tomli with open(name) as strm: - defn = __import__("toml").load(strm) + defn = tomli.load(strm) return defn.get("tool", {})["setuptools_scm"] diff --git a/tox.ini b/tox.ini index f3a97a94..a507de3c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py{27,34,35,36,37,38,39}-test,flake8,check_readme,check-dist,py{27,37}-selfcheck,docs +envlist=py{36,37,38,39,310}-test,flake8,check_readme,check-dist,py{37}-selfcheck,docs [pytest] testpaths=testing @@ -30,7 +30,6 @@ skip_install= deps= pytest setuptools >= 42 - toml commands= test: pytest [] selfcheck: python setup.py --version