Skip to content

tlestang/septembrse_example

Repository files navigation

This repository holds the example material for the walkthrough What’s the deal with Python wheels? presented at the SeptembRSE conference in September 2021.

The walkthrough is also available as a post on the Oxford RSE group’s blog: https://www.rse.ox.ac.uk/tech_post/python_wheels/.

Abstract

If you’ve ever installed a Python package, you’ve used them before. Python wheels are the recommended format for distribution python code. They allow for a safer, faster easier installation of Python packages. But do you know how wheels are made? Could you tell the difference between wheels and other distribution formats like sdists and eggs? Do you know what “manylinux” means?

This walkthrough takes you on a tour of the Python wheel format. Particularly, we will illustrate how Python wheels come ready to install, effectively bypassing the need to run any setup script or to compile extension module(s). This makes scientific packages that rely on C/C++/Fortran libraries much more accessible, as users do not require to compile the package themselves. This walktrough will demonstrate how to build a self-contained wheel with compiled modules and their library dependencies. If time allows, we’ll have a glance at how you can automate wheel building for several Python versions, on various platforms, using cibuildwheel.

Further reading

https://pythonwheels.com/

Daniel Holth, ‘PEP 427 – The Wheel Binary Package Format 1.0’. Sep. 20, 2012. Available: https://www.python.org/dev/peps/pep-0427/

Elana Hashman, ‘The Black Magic of Python Wheels’, presented at the PyCon 2019 Cleveland, Jun. 04, 2019. Available: https://www.youtube.com/watch?v=02aAZ8u3wEQ

manylinux. Python Packaging Authority. Available: https://github.com/pypa/manylinux

Robert T. McGibbon, Nathaniel J. Smith, ‘PEP 513 – A Platform Tag for Portable Linux Built Distributions’. Jan. 19, 2016. Available: https://www.python.org/dev/peps/pep-0513/

Nathaniel J. Smith, Thomas Kluyver, ‘PEP 600 – Future “manylinux” Platform Tags for Portable Linux Built Distributions’. Jun. 03, 2019. Available: https://www.python.org/dev/peps/pep-0600/

Matthew Brett, delocate. Accessed: Sep. 06, 2021. Available: https://github.com/matthew-brett/delocate

cibuildwheel. Python Packaging Authority. Accessed: Sep. 06, 2021. Available: https://github.com/pypa/cibuildwheel/

Micheal Kerrisk, ‘Fundamentals of Shared Libraries’, in The Linux Programming Interface, no starch press, 2010. Available: https://man7.org/tlpi/

Micheal Kerrisk, ‘Advanced Features of Shared Shared Libraries’, in The Linux Programming Interface, no starch press, 2010. Available: https://man7.org/tlpi/