Patchwork D8858: packaging: include templates with their package as key in package_data

login
register
mail settings
Submitter phabricator
Date July 31, 2020, 11:59 p.m.
Message ID <differential-rev-PHID-DREV-gxkpugvkyvuqxgo5khsz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46955/
State New
Headers show

Comments

phabricator - July 31, 2020, 11:59 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8858

AFFECTED FILES
  setup.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1638,10 +1638,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 = []