changeset 45305:e2320bb7a99f

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
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 31 Jul 2020 10:05:07 -0700
parents 41ff8a463e10
children 9a5c4875a88c
files setup.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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 = []