mrkn / pycall.rb

Calling Python functions from the Ruby language
MIT License
1.05k stars 72 forks source link

Set up CI for conda on windows-latest and venv environment #139

Closed mrkn closed 3 years ago

mrkn commented 3 years ago

[Fixes GH-138]

mrkn commented 3 years ago

I confirmed that the issue #121 is reproduced on CI:

run:
  python -m venv ~/test-venv
  source ~/test-venv/bin/activate
  ruby -Ilib -Iext/pycall -rpycall -ePyCall.builtins
  shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.9.2/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.2/x64/lib
  PYCALL_DEBUG_FIND_LIBPYTHON: 1

DEBUG(find_libpython) find_libpython(nil)
DEBUG(find_libpython) investigate_python_config("python3")
DEBUG(find_libpython) libs: ["libpython3.9.so.1.0", "libpython3.9.so", "libpython3.9", "libpython"]
DEBUG(find_libpython) libpaths: ["/opt/hostedtoolcache/Python/3.9.2/x64/lib", "/home/runner/test-venv/lib", "", "/home/runner/test-venv", "/home/runner/test-venv/lib"]
DEBUG(find_libpython) dlopen("/opt/hostedtoolcache/Python/3.9.2/x64/lib/libpython3.9.so.1.0") = #<Fiddle::Handle:0x000055b7ca493040>
Python path configuration:
  PYTHONHOME = '/home/runner/test-venv:/home/runner/test-venv'
  PYTHONPATH = '/home/runner/work/pycall.rb/pycall.rb/lib/pycall/python'
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/home/runner/test-venv/bin/python3'
  sys.base_prefix = '/home/runner/test-venv'
  sys.base_exec_prefix = '/home/runner/test-venv'
  sys.platlibdir = 'lib'
  sys.executable = '/home/runner/test-venv/bin/python3'
  sys.prefix = '/home/runner/test-venv'
  sys.exec_prefix = '/home/runner/test-venv'
  sys.path = [
    '/home/runner/work/pycall.rb/pycall.rb/lib/pycall/python',
    '/home/runner/test-venv/lib/python39.zip',
    '/home/runner/test-venv/lib/python3.9',
    '/home/runner/test-venv/lib/python3.9/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007ff232c08ec0 (most recent call first):
<no Python frame>
Error: Process completed with exit code 1.
mrkn commented 3 years ago

I need more experiments with a real Windows machine. Giving up to support Conda on Windows in this pull-request.