Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

protorpc source distributions (.tar.gz) do not include subdirectories, e.g. "wsgi" #31

@barrywhart

Description

@barrywhart

This results in errors like the following when using the App Engine "endpoints" library:

ERROR    2018-05-21 14:00:19,811 wsgi.py:263]
Traceback (most recent call last):
  File "/root/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/root/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/root/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
    obj = __import__(path[0])
  File "/opt/root/src/appengine-cloudsql-benchmark/main.py", line 27, in <module>
    import endpoints
  File "/opt/root/src/appengine-cloudsql-benchmark/lib/endpoints/__init__.py", line 27, in <module>
    from .apiserving import *
  File "/opt/root/src/appengine-cloudsql-benchmark/lib/endpoints/apiserving.py", line 81, in <module>
    from protorpc.wsgi import service as wsgi_service
ImportError: No module named wsgi

The solution is to do make the following change to setup.py:

diff --git a/setup.py b/setup.py
index 2c83901..0ff14c0 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@

 import platform

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

 # Configure the required packages and scripts to install, depending on
 # Python version and OS.
@@ -34,9 +34,6 @@ if py_version < '2.6':
   REQUIRED_PACKAGES.append('simplejson')

 _PROTORPC_VERSION = '0.12.0'
-packages = [
-    'protorpc',
-]

 setup(
     name='protorpc',
@@ -46,7 +43,7 @@ setup(
     author='Google Inc.',
     author_email='rafek@google.com',
     # Contained modules and scripts.
-    packages=packages,
+    packages=find_packages(),
     entry_points={
         'console_scripts': CONSOLE_SCRIPTS,
         },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions