Modify

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#14389 closed defect (fixed)

Refactor for Trac 1.6/Python 3

Reported by: Rob Hills Owned by: Rob Hills
Priority: normal Component: ComponentDependencyPlugin
Severity: blocker Keywords:
Cc: Trac Release: 1.6

Description

This plugin failed to load when used in Trac 1.6

Attachments (0)

Change History (5)

comment:1 Changed 3 weeks ago by Rob Hills

Proposed patch - fixes the issue in my test Trac 1.6:

diff --git a/componentdependencies/__init__.py b/componentdependencies/__init__.py
index 409b576..6cbe07f 100644
--- a/componentdependencies/__init__.py
+++ b/componentdependencies/__init__.py
@@ -1,4 +1,4 @@
 # 
-from componentdependency import *
-from interface import *
-from test import *
+from componentdependencies.componentdependency import *
+from componentdependencies.interface import *
+from componentdependencies.test import *
diff --git a/setup.py b/setup.py
index f8d58d5..7d5088a 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import find_packages, setup
 
 
 setup(name='TracComponentDependency',
-      version='0.3',
+      version='0.4',
       description="allows plugins to depend on other components being enabled",
       author='Jeff Hammel',
       author_email='jhammel@openplans.org',

comment:2 Changed 3 weeks ago by Jun Omae

We could use relative imports.

-from componentdependency import *
-from interface import *
-from test import *
+from .componentdependency import *
+from .interface import *
+from .test import *

comment:3 Changed 3 weeks ago by Rob Hills

So something like this works better?

diff --git a/componentdependencies/__init__.py b/componentdependencies/__init__.py
index 409b576..4c937bb 100644
--- a/componentdependencies/__init__.py
+++ b/componentdependencies/__init__.py
@@ -1,4 +1,4 @@
 # 
-from componentdependency import *
-from interface import *
-from test import *
+from .componentdependency import *
+from .interface import *
+from .test import *
diff --git a/setup.py b/setup.py
index f8d58d5..7d5088a 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import find_packages, setup
 
 
 setup(name='TracComponentDependency',
-      version='0.3',
+      version='0.4',
       description="allows plugins to depend on other components being enabled",
       author='Jeff Hammel',
       author_email='jhammel@openplans.org',

comment:4 Changed 3 weeks ago by Jun Omae

Owner: set to Jun Omae
Resolution: fixed
Status: newclosed

In 18701:

TracComponentDependency 0.4: make compatible with Python 3 and Trac 1.6 (closes #14389)

Patch by: Rob Hills

comment:5 Changed 3 weeks ago by Jun Omae

Owner: changed from Jun Omae to Rob Hills

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Rob Hills.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.