stackvana / microcule

SDK and CLI for spawning streaming stateless HTTP microservices in multiple programming languages
Other
480 stars 29 forks source link

Discrepancy in Github and npm installation #45

Closed Dalfoss closed 6 years ago

Dalfoss commented 6 years ago

I have run in to a problem, trying to use microcule with python 3.5.3 in virtualenv.

I am currently on Debian 9 Stretch (stable). My version of npm was installed from https://deb.nodesource.com/setup_9.x And not from the official apt repository, as it wasn't properly maintained, and therefore isn't present in the official apt repo.

When trying to use use Microcule with python3, i was presented with the following error.

Traceback (most recent call last):
  File "/usr/lib/node_modules/microcule/bin/binaries/micro-python3", line 16, in <module>
    __prepare()
  File "/usr/lib/node_modules/microcule/bin/binaries/micro-python3", line 12, in __prepare
    import microcule
  File "/usr/lib/node_modules/microcule/bin/binaries/lib/python/microcule/__init__.py", line 10, in <module>
    fd3 = os.fdopen(3, 'w+')
  File "/home/morten/.virtualenvs/DSEnv/lib/python3.5/os.py", line 1072, in fdopen
    return io.open(fd, *args, **kwargs)
io.UnsupportedOperation: File or stream is not seekable.

Looking in to it a little, i found that, there seems to be a discrepancy in the content of the file microcule/bin/binaries/lib/python/microcule/__init__.py on github, and the file one gets when microcule is installed according to the recommended "npm install -g microcule"

On Github there is an if else statement, distinguishing between python versions < 3 and others.

# open incoming connection from fd3
if sys.version_info[0] < 3:
  fd3 = os.fdopen(3, 'w+')
else:
  fd3 = os.fdopen(3, 'wb+', buffering=0)

This if else statement is not present in the microcule installed by npm, the first lines of my local file looks like this instead.

# open incoming connection from fd3
fd3 = os.fdopen(3, 'w+')
Marak commented 6 years ago

Probably because the latest version is on Github and not npm.

JokerQyou commented 5 years ago

That's right, microcule on npm was last updated two years ago (6.0.0), and is outdated. I think the README needs an update on how to install this package.

karanrajpal commented 3 years ago

Seems like this project isn't being actively maintained but it looks amazing and I hope the npm package can be updated 🤞