Build Python Wheel which contains c library (pytidylib)

258
January 16, 2018, at 4:28 PM

I found a nice Python library which I would like to use to check html:

https://github.com/countergram/pytidylib

It wraps a library written in C with ctypes.

According to the docs of pytidylib you need to install the library via apt/rpm:

You must have both HTML Tidy and PyTidyLib installed in order to use the > functionality described here.

Source: http://countergram.github.io/pytidylib/#installing-html-tidy

I would like to have a self contained wheel.

How to build a self contained wheel which does not need the html-tidy library from apt/rpm?

Answer 1

1) There is no magic here - you need a machine with both HTML Tidy and PyTidyLib installed to compile the package. You can temporary install them and uninstall after you finish the process.
2) Run pip install wheel
3) Run pip wheel pytidylib
4) The wheel is created in the ./wheelhouse directory

Rent Charter Buses Company
READ ALSO
Use dynamic SASS function names inside a loop

Use dynamic SASS function names inside a loop

I am creating some utility classes via a loop but wan't to use the functions that already exist

183
CSS - input:invalid not

CSS - input:invalid not

I'm having a validation problem

245