'Include files in sdist but not wheel

I have a Python C extension that contains header files in the include folder. I am currently trying to build wheels and a source distribution. Because wheels are pre-compiled, they don't need to contain header files but the sdist does. According to the Python docs, the following files are included in a sdist:

  1. all Python source files implied by the py_modules and packages options
  2. all C source files mentioned in the ext_modules or libraries options
  3. scripts identified by the scripts option See Installing Scripts.
  4. anything that looks like a test script: test/test*.py (currently, the Distutils don’t do anything with test scripts except include them in source distributions, but in the future there will be a standard for testing Python module distributions)
  5. Any of the standard README files (README, README.txt, or README.rst), setup.py (or whatever you called your setup script), and setup.cfg.
  6. all files that matches the package_data metadata. See Installing Package Data.
  7. all files that matches the data_files metadata. See Installing Additional Files.

These files are also included in the wheels as well. How can I add the header files to a sdist but not a wheel?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source