Skip to content

Commit

Permalink
fixed AttributeError: 'module' object has no attribute '__file__'
Browse files Browse the repository at this point in the history
  • Loading branch information
Avelino committed Jan 11, 2017
1 parent 1812aec commit 61852fe
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
13 changes: 8 additions & 5 deletions opps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pkg_resources

pkg_resources.declare_namespace(__name__)
# this is a namespace package
# http://stackoverflow.com/questions/24347094/python-setuptools-init-py-does-not-call-declare-namespace
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
13 changes: 1 addition & 12 deletions opps/comments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,5 @@
# -*- coding: utf-8 -*-
import pkg_resources

pkg_resources.declare_namespace(__name__)

VERSION = (0, 1, 1)

__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"comments App for Opps CMS"

__author__ = u"Bruno Cezar Rocha"
__credits__ = []
__email__ = u"rochacbruno@gmail.com"
__license__ = u"YACOWS LICENSE"
__copyright__ = u"Copyright 2013, YACOWS"
pkg_resources.declare_namespace(__name__)
25 changes: 19 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
from opps import comments


VERSION = (0, 1, 2)

__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"comments App for Opps CMS"

__author__ = u"Bruno Cezar Rocha"
__credits__ = []
__email__ = u"rochacbruno@gmail.com"
__license__ = u"YACOWS LICENSE"
__copyright__ = u"Copyright 2013, YACOWS"


install_requires = ["opps"]

classifiers = ["Development Status :: 4 - Beta",
Expand All @@ -26,17 +39,17 @@

setup(
name='opps-comments',
namespace_packages=['opps', 'opps.comments'],
version=comments.__version__,
description=comments.__description__,
namespace_packages=['opps'],
version=__version__,
description=__description__,
long_description=long_description,
classifiers=classifiers,
keywords='comments opps cms django apps magazines websites',
author=comments.__author__,
author_email=comments.__email__,
author=__author__,
author_email=__email__,
url='http://oppsproject.org',
download_url="https://github.com/opps/opps-comments/tarball/master",
license=comments.__license__,
license=__license__,
packages=find_packages(exclude=('doc', 'docs',)),
package_dir={'opps': 'opps'},
install_requires=install_requires,
Expand Down

0 comments on commit 61852fe

Please sign in to comment.