diff --git a/.plzconfig b/.plzconfig index 07b6b70c..179a7932 100644 --- a/.plzconfig +++ b/.plzconfig @@ -154,6 +154,14 @@ Optional = true Inherit = true Help = The tool used to resolve wheels with using the pypi API. +[PluginConfig "wheel_dist_info"] +ConfigKey = WheelDistInfo +Type = bool +DefaultValue = false +Optional = true +Inherit = true +Help = Controls whether python_wheel outputs the module's .dist-info directory by default. + [PluginConfig "prereleases"] DefaultValue = false Type = bool diff --git a/build_defs/python.build_defs b/build_defs/python.build_defs index 6076dc67..2657f0db 100644 --- a/build_defs/python.build_defs +++ b/build_defs/python.build_defs @@ -602,6 +602,10 @@ def python_wheel(name:str, version:str, labels:list=[], hashes:list=None, packag """ binary = binary or entry_points package_name = package_name or name.replace('-', '_') + if not outs: + outs = [name] + if CONFIG.PYTHON.WHEEL_DIST_INFO: + outs += [f"{package_name}-{version}.dist-info"] initial = package_name[0] url_base = repo or CONFIG.PYTHON.WHEEL_REPO if not tool and not url_base: @@ -667,7 +671,7 @@ def python_wheel(name:str, version:str, labels:list=[], hashes:list=None, packag cmd += [ # N.B. we need -b for legacy locations because that's all zipimport knows to look for :( '$TOOLS_PYTHON -m compileall -b -f .', - '$TOOLS_ARCAT z -d --prefix $PKG -i ' + ' -i '.join(outs or [name]), + '$TOOLS_ARCAT z -d --prefix $PKG -i ' + ' -i '.join(outs), ] label = f'whl:{package_name}=={version}' @@ -704,7 +708,7 @@ def python_wheel(name:str, version:str, labels:list=[], hashes:list=None, packag name = name, tag = "lib_rule" if binary else None, srcs = [wheel_rule], - outs = outs or [name], + outs = outs, tools = [CONFIG.ARCAT_TOOL], cmd = cmd, deps = deps,