Mercurial > public > mercurial-scm > hg
comparison setup.py @ 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 | 2960b7fac966 |
comparison
equal
deleted
inserted
replaced
45304:41ff8a463e10 | 45305:e2320bb7a99f |
---|---|
1633 return p and p[0] != '.' and p[-1] != '~' | 1633 return p and p[0] != '.' and p[-1] != '~' |
1634 | 1634 |
1635 | 1635 |
1636 for root in ('templates',): | 1636 for root in ('templates',): |
1637 for curdir, dirs, files in os.walk(os.path.join('mercurial', root)): | 1637 for curdir, dirs, files in os.walk(os.path.join('mercurial', root)): |
1638 curdir = curdir.split(os.sep, 1)[1] | 1638 packagename = curdir.replace(os.sep, '.') |
1639 for f in filter(ordinarypath, files): | 1639 packagedata[packagename] = list(filter(ordinarypath, files)) |
1640 f = os.path.join(curdir, f) | |
1641 packagedata['mercurial'].append(f) | |
1642 | 1640 |
1643 datafiles = [] | 1641 datafiles = [] |
1644 | 1642 |
1645 # distutils expects version to be str/unicode. Converting it to | 1643 # distutils expects version to be str/unicode. Converting it to |
1646 # unicode on Python 2 still works because it won't contain any | 1644 # unicode on Python 2 still works because it won't contain any |