On Thursday, November 21, 2019 at 3:32:35 AM UTC-8, Jun Omae wrote: > > Hi, > > On 2019/11/21 14:10, thos wrote: > > Found the problem. > > > > In the Debian distribution, the "Trac-1.2.3.egg-info" directory is > missing the SOURCES.txt file. A RECORD file will also do. > > > > One of them needs to be present for "get_sources" to associate the > bundled plug-ins as part of the same overall "Trac 1.2.3" plugin. From > trac.util (__init__.py): > > Thanks for the investigating. > > I think the Trac debian package should have *.egg-info/SOURCES.txt file. > Searching the SOURCES.txt file in debian packages, several packages have > SOURCES.txt file. > > https://packages.debian.org/file:.egg-info/SOURCES.txt > > (If *.dist-info structure is used, RECORD file must be included. [2]) > > However, according to The Internal Structure of Python Eggs [1], it seems > that it is > possible to have no SOURCES.txt file in egg-info structure. > > Work around: > ==== > diff --git a/trac/util/__init__.py b/trac/util/__init__.py > index 1d3485e09..8808ebf90 100644 > --- a/trac/util/__init__.py > +++ b/trac/util/__init__.py > @@ -700,6 +700,7 @@ def get_sources(path): > """Return a dictionary mapping Python module source paths to the > distributions that contain them. > """ > + path = os.path.normpath(os.path.abspath(path)) > sources = {} > for dist in find_distributions(path, only=True): > if not dist.has_metadata('top_level.txt'): > @@ -717,6 +718,18 @@ def get_sources(path): > for row in reader if > any(row[0].startswith(top) > for top in > toplevels)) > continue > + for top in toplevels: > + dir_ = os.path.normpath(os.path.join(dist.location, > + top.rstrip('/'))) > + if not os.path.isdir(dir_): > + continue > + for root, dirs, files in os.walk(dir_): > + for filename in files: > + if not filename.endswith('.py'): > + continue > + filename = os.path.join(root, filename) > + sources[filename[len(path):].strip(os.sep) > + .replace(os.sep, '/')] = > dist > return sources > > > ==== > > BTW, I noticed that Trac debian package has a weird file, > /usr/lib/python2.7/dist-packages/plugin1/__init__.py. > I believe that is an issue of the package. > > $ dpkg -L trac | grep /plugin1/ > /usr/lib/python2.7/dist-packages/plugin1/__init__.py > > > [1] > https://svn.python.org/projects/sandbox/trunk/setuptools/doc/formats.txt > [2] > https://www.python.org/dev/peps/pep-0376/#one-dist-info-directory-per-installed-distribution > > > > -- > Jun Omae <jun6...@gmail.com> (大前 潤) >
Created a ticket for this fix: https://trac.edgewall.org/ticket/13231 - Ryan -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/6bd819d5-50f9-4a58-b81c-fc0baa1c7f36%40googlegroups.com.