Edgewall Software
Modify

Opened 5 years ago

Last modified 3 years ago

#13231 new defect

Egg files without SOURCES.txt not displayed correctly on plugin admin page

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.6.1
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Discussed in gmessage:trac-users:AUBRFehR83c/ZRjKm-SnCAAJ

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:

  • trac/util/__init__.py

    diff --git a/trac/util/__init__.py b/trac/util/__init__.py
    index 1d3485e09..8808ebf90 100644
    a b def get_sources(path):  
    700700     """Return a dictionary mapping Python module source paths to the
    701701     distributions that contain them.
    702702     """
     703    path = os.path.normpath(os.path.abspath(path))
    703704     sources = {}
    704705     for dist in find_distributions(path, only=True):
    705706         if not dist.has_metadata('top_level.txt'):
    def get_sources(path):  
    717718                            for row in reader if any(row[0].startswith(top)
    718719                                                     for top in toplevels))
    719720             continue
     721        for top in toplevels:
     722            dir_ = os.path.normpath(os.path.join(dist.location,
     723                                                 top.rstrip('/')))
     724            if not os.path.isdir(dir_):
     725                continue
     726            for root, dirs, files in os.walk(dir_):
     727                for filename in files:
     728                    if not filename.endswith('.py'):
     729                        continue
     730                    filename = os.path.join(root, filename)
     731                    sources[filename[len(path):].strip(os.sep)
     732                                                .replace(os.sep, '/')] = dist
    720733     return sources
  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

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 5 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:2 by Ryan J Ollos, 4 years ago

Milestone: next-stable-1.4.x1.4.3

comment:3 by Ryan J Ollos, 4 years ago

Milestone: 1.4.31.5.3

comment:4 by Ryan J Ollos, 4 years ago

Milestone: 1.5.31.5.4

comment:5 by Ryan J Ollos, 3 years ago

Milestone: 1.5.41.6.1

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.