Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble figuring out how to use -s include_path=... when calling python3 -m Cython.Build.cythonize stanalone #3168

Open
jtc0de opened this issue Oct 7, 2019 · 0 comments

Comments

@jtc0de
Copy link

commented Oct 7, 2019

This might be just me doing things wrong, but I have trouble figuring out how to use the command line option -s include_path=... when calling python3 -m Cython.Build.cythonize for a standalone compilation in a separate process (to work around bug #2730 ).

I tried these two calls:

  1. As a list: /usr/bin/python3 -m Cython.Build.Cythonize /tmp/pip-req-build-liyrbm_y/src/wobblui/dragselection.pyx -s include_path=['/tmp/pip-req-build-liyrbm_y/src'] -s gdb_debug=False -X always_allow_keywords=True -X boundscheck=True -X language_level=3 -X profile=False -X linetrace=False

  2. As a string: /usr/bin/python3 -m Cython.Build.Cythonize /tmp/pip-req-build-zl7im29r/src/wobblui/dragselection.pyx -s include_path=/tmp/pip-req-build-zl7im29r/src -s gdb_debug=False -X always_allow_keywords=True -X boundscheck=True -X language_level=3 -X profile=False -X linetrace=False

Both give me this error, where Cython seems to become confused accessing the include directories internally:

  ERROR: Traceback (most recent call last):
  ERROR:   File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
  ERROR:     "__main__", mod_spec)
  ERROR:   File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
  ERROR:     exec(code, run_globals)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Cythonize.py", line 227, in <module>
  ERROR:     main()
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Cythonize.py", line 223, in main
  ERROR:     cython_compile(path, options)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Cythonize.py", line 106, in cython_compile
  ERROR:     **options.options)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Dependencies.py", line 966, in cythonize
  ERROR:     aliases=aliases)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Dependencies.py", line 824, in create_extension_list
  ERROR:     kwds = deps.distutils_info(file, aliases, base).values
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Dependencies.py", line 679, in distutils_info
  ERROR:     return (self.transitive_merge(filename, self.distutils_info0, DistutilsInfo.merge)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Dependencies.py", line 689, in transitive_merge
  ERROR:     node, extract, merge, seen, {}, self.cimported_files)[0]
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Dependencies.py", line 700, in transitive_merge_helper
  ERROR:     for next in outgoing(node):
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Utils.py", line 54, in wrapper
  ERROR:     res = cache[args] = f(self, *args)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Dependencies.py", line 601, in cimported_files
  ERROR:     pxd_file = self.find_pxd(module, filename)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Utils.py", line 54, in wrapper
  ERROR:     res = cache[args] = f(self, *args)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Build/Dependencies.py", line 583, in find_pxd
  ERROR:     pxd = self.context.find_pxd_file(relative, None)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Compiler/Main.py", line 250, in find_pxd_file
  ERROR:     pxd = self.search_include_directories(qualified_name, ".pxd", pos, sys_path=sys_path)
  ERROR:   File "/tmp/pip-build-env-c95g9yn8/overlay/lib64/python3.7/site-packages/Cython/Compiler/Main.py", line 292, in search_include_directories
  ERROR:     include_dirs = include_dirs + sys.path
  ERROR: TypeError: unsupported operand type(s) for +: 'bool' and 'list'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.