setup: Fix install of subpackages when pip-installed from git repositories

It seems setuptools needs to be explicitly told to include subpackages
in this case.
This commit is contained in:
Valentin Lorentz 2022-06-22 20:31:53 +02:00
parent d04e8161d5
commit b3443a5a4c

View File

@ -79,7 +79,14 @@ if setuptools:
break
module_name = kwargs['name'].replace('-', '_')
kwargs.setdefault('packages', [module_name])
if 'packages' not in kwargs:
kwargs["packages"] = [module_name] + [
"%s.%s" % (module_name, package_name.replace('-', '_'))
for package_name
in setuptools.find_packages(where=".")
]
kwargs.setdefault('package_dir', {module_name: '.'})
kwargs.setdefault('entry_points', {
'limnoria.plugins': '%s = %s' % (capitalized_name, module_name)})