diff options
Diffstat (limited to 'src/setuptools_scm/integration.py')
-rw-r--r-- | src/setuptools_scm/integration.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/setuptools_scm/integration.py b/src/setuptools_scm/integration.py index c623db7..ffd4521 100644 --- a/src/setuptools_scm/integration.py +++ b/src/setuptools_scm/integration.py @@ -1,7 +1,7 @@ from pkg_resources import iter_entry_points from .version import _warn_if_setuptools_outdated -from .utils import do, trace_exception +from .utils import do, trace_exception, trace from . import _get_version, Configuration @@ -13,7 +13,12 @@ def version_keyword(dist, keyword, value): value = {} if getattr(value, "__call__", None): value = value() - config = Configuration(**value) + assert ( + "dist_name" not in value + ), "dist_name may not be specified in the setup keyword " + trace("dist name", dist, dist.name) + dist_name = dist.name if dist.name != 0 else None + config = Configuration(dist_name=dist_name, **value) dist.metadata.version = _get_version(config) @@ -32,7 +37,7 @@ def find_files(path=""): def _args_from_toml(name="pyproject.toml"): # todo: more sensible config initialization - # move this elper back to config and unify it with the code from get_config + # move this helper back to config and unify it with the code from get_config with open(name) as strm: defn = __import__("toml").load(strm) |