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

turbodbc does not play well with poetry #397

Closed
bgemmill opened this issue Nov 3, 2023 · 6 comments
Closed

turbodbc does not play well with poetry #397

bgemmill opened this issue Nov 3, 2023 · 6 comments

Comments

@bgemmill
Copy link

bgemmill commented Nov 3, 2023

When configuring a python project with poetry, issuing the command poetry add turbodbc fails with this error:

Using version ^4.7.0 for turbodbc

Updating dependencies
Resolving dependencies... (0.1s)

Package operations: 1 install, 0 updates, 0 removals

  • Installing turbodbc (4.7.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel
  
  Traceback (most recent call last):
...much backtrace spam goes here...
  ModuleNotFoundError: No module named 'pybind11'
  
Note: This error originates from the build backend, and is likely not a problem with poetry but with turbodbc (4.7.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "turbodbc (==4.7.0)"'.

Poetry seems right that this has something to do with turbodbc, in that running pip wheel --no-cache-dir --use-pep517 "turbodbc (==4.7.0)" produces the same error.

A straight pip install turbodbc does appear to work, where a wheel is compiled locally and installed.

Is this a pep517 thing, a lack of prebuilt wheel for ubuntu 22.04, or something else?

I'm happy to provide any sort of help to make this go; it would be great to get this into poetry.

@rxm7706
Copy link

rxm7706 commented Nov 18, 2023

cc @xhochy @cshaley

Hi @bgemmill
Thats an issue I was running into too - I believe the PR that just got merged #401 will address this - Version 4.8.0 when released should be installable via pip, poetry and eventually conda too.

@xhochy xhochy closed this as completed Nov 19, 2023
@rxm7706
Copy link

rxm7706 commented Nov 20, 2023

@bgemmill will you be able to test this -
I am getting still getting an error with Poetry & TurbODBC 4.9.0
If you are getting an error too - We should open a new issues

 creating build/temp.linux-x86_64-cpython-310/src/turbodbc/result_sets
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/column_description.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/column_description.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/connection.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/connection.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/cpp_odbc.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/cpp_odbc.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/environment.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/environment.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/error.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/error.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level1/api.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level1/api.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level1/level1.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level1/level1.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level1/unixodbc_backend.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level1/unixodbc_backend.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level1/unixodbc_backend_debug.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level1/unixodbc_backend_debug.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/api.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/api.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/handles.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/handles.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/input_string_buffer.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/input_string_buffer.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/input_u16string_buffer.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/input_u16string_buffer.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/level1_connector.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/level1_connector.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/level2.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/level2.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/string_buffer.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/string_buffer.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level2/u16string_buffer.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level2/u16string_buffer.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level3/level3.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level3/level3.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level3/raii_connection.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level3/raii_connection.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level3/raii_environment.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level3/raii_environment.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/level3/raii_statement.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/level3/raii_statement.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/make_environment.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/make_environment.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/multi_value_buffer.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/multi_value_buffer.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/cpp_odbc/statement.cpp -o build/temp.linux-x86_64-cpython-310/src/cpp_odbc/statement.o --std=c++17
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude/ -I/tmp/tmpok_bmpw7/.venv/lib/python3.10/site-packages/pybind11/include -I/tmp/tmpok_bmpw7/.venv/include -I/opt/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c src/turbodbc/buffer_size.cpp -o build/temp.linux-x86_64-cpython-310/src/turbodbc/buffer_size.o --std=c++17
  In file included from include/turbodbc/description.h:3,
                   from include/turbodbc/buffer_size.h:3,
                   from src/turbodbc/buffer_size.cpp:1:
  include/turbodbc/field.h:3:10: fatal error: boost/variant/variant.hpp: No such file or directory
      3 | #include <boost/variant/variant.hpp>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  

  at /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with turbodbc (4.9.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "turbodbc (==4.9.0)"'

@xhochy
Copy link
Collaborator

xhochy commented Nov 20, 2023

No, this error only signals that you have not installed the native dependencies required for building turbodbc on your system.

@rxm7706
Copy link

rxm7706 commented Nov 20, 2023

No, this error only signals that you have not installed the native dependencies required for building turbodbc on your system.

Ah makes sense -- do we have a list of these dependencies.. Can you point me that list.

@rxm7706
Copy link

rxm7706 commented Nov 21, 2023

I think I found what I was looking for - mostly..
#351 (comment)
https://turbodbc.readthedocs.io/en/latest/pages/contributing.html
https://turbodbc.readthedocs.io/en/latest/pages/contributing.html

# Install poetry package requirements
COPY poetry.lock pyproject.toml ./
RUN poetry install

# Hacky install turbodbc
RUN poetry run python -c "import pyarrow; pyarrow.create_library_symlinks()"
RUN CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" poetry run pip install --no-cache-dir turbodbc

@bgemmill
Copy link
Author

Dependencies are here

But if you have a local install of boost, it gets tricky with poetry and you may run into this python-poetry/poetry#8727

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants