Skip to content

Commit deaec86

Browse files
committed
Make this a proper namespace package
GitHubMixin doesn't need to inherit from Component. All of the classes utilizing the mixin inherit from Component, and we don't need to support enabling/ disabling GitHubMixin. Fix test failures due to config section already present. The section is already present due to an `Option` defined on a class that doesn't inherit from Component: https://trac.edgewall.org/ticket/12457
1 parent 94c834d commit deaec86

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ Changelog
514514
515515
### 2.4 (not yet released)
516516
517+
* Fix improperly configured namespace package. (#131)
517518
* Add configuration option for path prefix of login and logout. (#127)
518519
* Add `GitHubPolicy` permission policy to make `[timeline]`
519520
`changeset_show_file` option work correctly. (#126)

runtests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def createTracEnvironment(cls, **kwargs):
124124
conf.set('git', 'cached_repository', 'true')
125125
conf.set('git', 'persistent_cache', 'true')
126126

127-
conf.add_section('github')
127+
if not conf.has_section('github'):
128+
conf.add_section('github')
128129
client_id = '01234567890123456789'
129130
if 'client_id' in kwargs:
130131
client_id = kwargs['client_id']

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This software is licensed as described in the file LICENSE, which
55
# you should have received as part of this distribution.
66

7-
from setuptools import setup
7+
from setuptools import setup, find_packages
88

99
setup(
1010
name='trac-github',
@@ -14,7 +14,8 @@
1414
url='https://github.com/trac-hacks/trac-github',
1515
description='Trac - GitHub integration',
1616
download_url='https://pypi.python.org/pypi/trac-github',
17-
packages=['tracext'],
17+
packages=find_packages(),
18+
namespace_packages=['tracext'],
1819
platforms='all',
1920
license='BSD',
2021
extras_require={'oauth': ['requests_oauthlib >= 0.5']},

tracext/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def _oauth_session(self, req, state=None):
210210

211211

212212

213-
class GitHubMixin(Component):
213+
class GitHubMixin(object):
214214

215215
webhook_secret = Option('github', 'webhook_secret', '',
216216
doc="""GitHub webhook secret token.

0 commit comments

Comments
 (0)