AOT compilation inside

Hi I have a python library that we have now migrated from jit compilation to AOT compilation. My now contains the following code from the docs:

from distutils.core import setup

from source_module import cc


It installs locally using pip install -e . with no problems. However when I try to upload this package to pypi I get the following error message

error: Error: setup script specifies an absolute path:


setup() arguments must *always* be /-separated paths relative to the directory, *never* absolute paths.

I have tried lots of things to fix including


which did change the path but still gave the same error.

Is there anything you suggest?


This specific problem I fixed by setting include_package_data=False in setup(...) however i have since changed it back and works fine so who knows.

Another important thing I found is that using the method described above ext_modules=[cc.distutils_extension()] only works when running locally but cannot be uploaded to pypi as it will not recognize the compiled binary file (the auditwheels trick didnt work because of linux version issues). It will also only be compiled for your local architecture so dosent make sense to upload the binaries.

I have found a work around where I only upload a source distribution to pypi (no wheels) using

python sdist
twine upload --repository pypi dist/*

This means that it runs my when i pip install module where i have added a post install script that compiles my AOT functions.

Maybe this is worth adding to the AOT docs?