packaging: include templates with their package as key in package_data
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 31 Jul 2020 10:05:07 -0700
changeset 45305 e2320bb7a99f
parent 45304 41ff8a463e10
child 45306 9a5c4875a88c
packaging: include templates with their package as key in package_data This is similar to an earlier patch in this series. It seems more correct to use `mercurial.templates.coal` etc as keys in the `package_data` dict now that those modules are packages. Differential Revision: https://phab.mercurial-scm.org/D8858
setup.py
--- a/setup.py	Fri Jul 31 09:49:52 2020 -0700
+++ b/setup.py	Fri Jul 31 10:05:07 2020 -0700
@@ -1635,10 +1635,8 @@
 
 for root in ('templates',):
     for curdir, dirs, files in os.walk(os.path.join('mercurial', root)):
-        curdir = curdir.split(os.sep, 1)[1]
-        for f in filter(ordinarypath, files):
-            f = os.path.join(curdir, f)
-            packagedata['mercurial'].append(f)
+        packagename = curdir.replace(os.sep, '.')
+        packagedata[packagename] = list(filter(ordinarypath, files))
 
 datafiles = []