Code Monkey home page Code Monkey logo

protoactor-python's People

Contributors

alexpantyukhin avatar cpx86 avatar ipinak avatar lucasvfventura avatar rogeralsing avatar valentin-miroshnichenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protoactor-python's Issues

Virtualenv installation failure due to existing build file

OS = Windows 10
Shell = PowerShell
Python = 3.8
Version = current master HEAD: 94bb422

While installing the library into a virtualenv I encountered the following error:

PS C:\Users\alnes\dev\protoactor-python> python -m venv .venv        
PS C:\Users\alnes\dev\protoactor-python> .\.venv\Scripts\Activate.ps1
(.venv) PS C:\Users\alnes\dev\protoactor-python> pip install .               
Processing c:\users\alnes\dev\protoactor-python
Installing collected packages: ProtoActor-Python
  Running setup.py install for ProtoActor-Python ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\alnes\dev\protoactor-python\.venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alnes\\AppData\\Local\\Temp\\pip-req-build-_pv65mo5\\setup.py'"'"'; __file__='"'"'C:\\Users\\alnes\\AppData\\Local\\Temp\\pip-req-build-_pv65mo5\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, 
'"'"'exec'"'"'))' install --record 'C:\Users\alnes\AppData\Local\Temp\pip-record-k8zzc2w7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\alnes\dev\protoactor-python\.venv\include\site\python3.8\ProtoActor-Python'
         cwd: C:\Users\alnes\AppData\Local\Temp\pip-req-build-_pv65mo5\
    Complete output (5 lines):
    running install
    running build
    running build_py
    creating build
    error: could not create 'build': Cannot create a file when that file already exists
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\alnes\dev\protoactor-python\.venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alnes\\AppData\\Local\\Temp\\pip-req-build-_pv65mo5\\setup.py'"'"'; __file__='"'"'C:\\Users\\alnes\\AppData\\Local\\Temp\\pip-req-build-_pv65mo5\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\alnes\AppData\Local\Temp\pip-record-k8zzc2w7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\alnes\dev\protoactor-python\.venv\include\site\python3.8\ProtoActor-Python' Check the logs for full command output.

This appears to have been caused by the build file in the root of the repository.

I'm not sure how important this file is but after removing it the installation continues but fails due to a different error noted in another issue: #58.

ProcessDispatcher not working

While running a different process the function passed to the child process and all the objects it needs to execute must be pickle. Because of this the current implementation doesn't work with the ProcessDispatcher

Second life

Hi Guys,

I read about proto.actor the past few days, and I want to give a second life to the python implementation. Do you see any problem if I start sending PR to modernize and bring to parity the python implementation?

Queue type isn't thread safe

Python provide several queues implementation as queue, asyncio.queue and multiprocessing.queue.

Due Python features we will provide several dispatcher which one may be more appropriate than the other depending on the scenario. This way the queue being used and all logic around it must take into account this different execution scenarios and yet be simple to understand

Virtualenv installation failure due to U+0441 character

OS = Windows 10
Shell = PowerShell
Python = 3.8
Version = current master HEAD: 94bb422

While installing the library into a virtualenv I encountered the following error:

PS C:\Users\user\dev\protoactor-python> python -m venv .venv
PS C:\Users\user\dev\protoactor-python> .\.venv\Scripts\Activate.ps1
(.venv) PS C:\Users\user\dev\protoactor-python> pip install .
Processing c:\users\user\dev\protoactor-python
Installing collected packages: ProtoActor-Python
  Running setup.py install for ProtoActor-Python ... error
    ERROR: Command errored out with exit status 1:
<snip>
byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\grain_call_options.py to grain_call_options.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\hash_algorithms\fnv1a32.py to fnv1a32.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\member_status.py to member_status.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\member_status_events.py to member_status_events.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\member_strategy.py to member_strategy.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\messages.py to messages.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\pid_cache.py to pid_cache.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\protos_grpc.py to protos_grpc.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\protos_pb2.py to protos_pb2.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\providers\abstract_cluster_provider.py to abstract_cluster_provider.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\providers\consul\consul_client.py to consul_client.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\providers\consul\consul_provider.py to consul_provider.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\providers\single_remote_instance\protos_grpc.py to protos_grpc.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\providers\single_remote_instance\protos_pb2.py to protos_pb2.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\providers\single_remote_instance\single_remote_instance_provider.py to single_remote_instance_provider.cpython-38.pyc     
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\rendezvous.py to rendezvous.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\round_robin.py to round_robin.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\__init__.py to __init__.cpython-38.pyc
    byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\\u0441luster\\u0441luster.py to \u0441luster.cpython-38.pyc
    running install_egg_info
    Copying ProtoActor_Python.egg-info to c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\ProtoActor_Python-0.0.1-py3.8.egg-info
    running install_scripts
    writing list of installed files to 'C:\Users\user\AppData\Local\Temp\pip-record-tvyx015h\install-record.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\pip-req-build-mln533kl\setup.py", line 13, in <module>
        setup(
      File "c:\users\user\dev\protoactor-python\.venv\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "C:\Python38\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Python38\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Python38\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\user\dev\protoactor-python\.venv\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\Python38\lib\distutils\command\install.py", line 569, in run
        self.execute(write_file,
      File "C:\Python38\lib\distutils\cmd.py", line 335, in execute
        util.execute(func, args, msg, dry_run=self.dry_run)
      File "C:\Python38\lib\distutils\util.py", line 303, in execute
        func(*args)
      File "C:\Python38\lib\distutils\file_util.py", line 236, in write_file
        f.write(line + "\n")
      File "C:\Python38\lib\encodings\cp1252.py", line 19, in encode
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]
    UnicodeEncodeError: 'charmap' codec can't encode character '\u0441' in position 80: character maps to <undefined>
<snip>

According to the output this appeared to be caused by a unicode U+0441 character in the protoactor-python.cluster module name.

I saw that the module protoactor-python.cluster module was duplicated. This is presumably because of the U+0441 character used in place of the c character in one of them. I removed the directory with the unicode character and left the other directory intact.

After removing the virtualenv, re-creating and running pip install . again the operation failed with a similar error:

PS C:\Users\user\dev\protoactor-python> python -m venv .venv
PS C:\Users\user\dev\protoactor-python> .\.venv\Scripts\Activate.ps1
(.venv) PS C:\Users\user\dev\protoactor-python> pip install .
Processing c:\users\user\dev\protoactor-python
Installing collected packages: ProtoActor-Python
  Running setup.py install for ProtoActor-Python ... error
    ERROR: Command errored out with exit status 1:
<snip>
byte-compiling c:\users\user\dev\protoactor-python\.venv\Lib\site-packages\protoactor\cluster\\u0441luster.py to \u0441luster.cpython-38.pyc
<snip>
 Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\pip-req-build-hpnot7yh\setup.py", line 13, in <module>
        setup(
      File "c:\users\user\dev\protoactor-python\.venv\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "C:\Python38\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Python38\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Python38\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\user\dev\protoactor-python\.venv\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\Python38\lib\distutils\command\install.py", line 569, in run
        self.execute(write_file,
      File "C:\Python38\lib\distutils\cmd.py", line 335, in execute
        util.execute(func, args, msg, dry_run=self.dry_run)
      File "C:\Python38\lib\distutils\util.py", line 303, in execute
        func(*args)
      File "C:\Python38\lib\distutils\file_util.py", line 236, in write_file
        f.write(line + "\n")
      File "C:\Python38\lib\encodings\cp1252.py", line 19, in encode
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]
    UnicodeEncodeError: 'charmap' codec can't encode character '\u0441' in position 80: character maps to <undefined>
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\user\dev\protoactor-python\.venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-build-hpnot7yh\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-build-hpnot7yh\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-_chmkv9x\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\user\dev\protoactor-python\.venv\include\site\python3.8\ProtoActor-Python' Check the logs for full command output.

This was due to the U+0441 character in the remaining protoactor-python.cluster module's cluster.py module name.

After renaming this module to use c instead of U+0441 the installation completed successfully:

(.venv) PS C:\Users\user\dev\protoactor-python> pip install .
Processing c:\users\user\dev\protoactor-python
Installing collected packages: ProtoActor-Python
  Found existing installation: ProtoActor-Python 0.0.1
    Uninstalling ProtoActor-Python-0.0.1:
      Successfully uninstalled ProtoActor-Python-0.0.1
  Running setup.py install for ProtoActor-Python ... done
Successfully installed ProtoActor-Python-0.0.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.