pyodbc icon indicating copy to clipboard operation
pyodbc copied to clipboard

Wheel support for linux aarch64

Open odidev opened this issue 3 years ago • 3 comments

Summary Installing pyodbc on aarch64 via pip using command "pip3 install pyodbc" tries to build wheel from source code.

Problem description pyodbc doesn't have wheel for aarch64 on PyPI repository. So, while installing pyodbc via pip on aarch64, pip builds wheel for same resulting in it takes more time to install pyodbc. Making wheel available for aarch64 will benefit aarch64 users by minimizing pyodbc installation time.

Expected Output Pip should be able to download pyodbc wheel from PyPI repository rather than building it from source code.

@pyodbc-team, please let me know if I can help you building wheel/uploading to PyPI repository. I am curious to make pyodbc wheel available for aarch64. It will be a great opportunity for me to work with you.

odidev avatar Nov 02 '20 08:11 odidev

@keitherskine Is this something we can get from Travis-CI integration? They let us test in different environments - can we get artifacts from those tests?

mkleehammer avatar Jan 22 '21 03:01 mkleehammer

As far as I can tell, Travis does have the ability to upload artifacts to a cloud provider of your choice (e.g. AWS S3, PyPI, and many others) at the end of the CI job cycle. Unlike AppVeyor though, Travis doesn't seem to have support for artifacts built into its web portal so you have to provide your own credentials for the cloud provider. Travis will upload the files to wherever you want them, but do nothing more. Also, if we want to generate artifacts for aarch64 in Travis, we'd probably have to run all the unit tests on aarch64 too. That's not necessarily an issue, but I don't think Travis is designed to just build artifacts on specific platforms.

On the wider issue of generating builds for multiple platforms, perhaps a better approach might be to use cibuildwheel to do the heavy lifting. (Here's an example from the scikit-learn project of building aarch64 on Travis with cibuildwheel.)

keitherskine avatar Jan 26 '21 02:01 keitherskine

I forgot about cibuildwheel. Great idea.

mkleehammer avatar Jan 26 '21 15:01 mkleehammer

Noticed that pyodbc now uses cibuildwheel, does it mean it should be fairly easy to add linux aarch64 wheels?

I'd love to contribute but I'm fairly inept in everything Travis/AppVeyor

AlexandreArpin avatar Dec 03 '22 23:12 AlexandreArpin

Hi @AlexandreArpin , could you try installing pyodbc from a linux aarch64 wheel by downloading the file called "wheels_2e3765ca3e4ead41e6ad11a57329fbddcaa17d8d.zip" from here, unzipping it and installing pyodbc using the relevant wheel? Many thanks.

For example, in Python 3.10:

python -m pip install pyodbc-4.0.35-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
python -c "import pyodbc; print(pyodbc.version)"

If that works for your scenario, do let me know.

keitherskine avatar Dec 08 '22 00:12 keitherskine

Hey, sorry for the delay. Seems like it works pretty well.

Spun up a new machine on AWS using aarch64, did the usuall apt-get update & apt-get update

Installed unixodbc with apt install unixodbc (and not the dev package)

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.15.0-1026-aws aarch64)
ubuntu@host:~$ python3 --version
Python 3.8.10
ubuntu@host:~$ python3 -m pip install pyodbc-4.0.35-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Processing ./pyodbc-4.0.35-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Installing collected packages: pyodbc
Successfully installed pyodbc-4.0.35
ubuntu@host:~$ python3 -c "import pyodbc; print(pyodbc.version)"
4.0.35

A bit harder to try on "real" running instances but I don't see any reasons why it wouldn't just work out of the box.

I saw the diff, didn't look like too much trouble to add aarch64, it could be nice to ship the wheels, it'd be a nice improvement for folks running on aarch64.

AlexandreArpin avatar Dec 12 '22 20:12 AlexandreArpin

Many thanks for testing this, @AlexandreArpin . I had a few completely separate issues getting the tests to pass but PR #1135 should cover this.

keitherskine avatar Dec 17 '22 23:12 keitherskine

Hi, thread was informative and works well. When can we see the aarch files in pypi?

cagdasbu avatar Jan 12 '23 09:01 cagdasbu

Yes, please bring this to PyPi! ;-)

ThorstenEngel avatar Feb 16 '23 17:02 ThorstenEngel