Skip to content

v0.7

Compare
Choose a tag to compare
@aleivag aleivag released this 08 Dec 02:53
Include .pyx files in source distribution (#35)

Summary:
This commit adds .pyx files in MANIFEST.in, thus includes Cython files
in pystemd source distribution (sdist).

The rationale behind this change is based on the following:

- Cython documentation [1] suggests distributing "the generated .c
  files as well as your Cython sources so that users can install your
  module without needing to have Cython available." Distributing .c
  files should be considered a helpful addition to the source
  distribution, they do not actually replace the .pyx files.
- Including .pyx files in source distribution is in accordance with
  LGPL 2.1 terms [2] reading: "Source code" for a work means the
  preferred form of the work for making modifications to it.
- Including .pyx files in sdist is especially important for Debian
  packaging where we need to be sure all binaries are able to be built
  reproducibly from their source.

Additionally, current commit restructures setup.py external_modules by
inversing their logic: if no pystemd/*.c files are found then cythonize
is called on .pyx files. Both file types which will be anyway included
in sdist.

[1]https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#distributing-cython-modules
[2]https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
Pull Request resolved: https://github.com/facebookincubator/pystemd/pull/35

Differential Revision: D17283090

Pulled By: aleivag

fbshipit-source-id: cce431d7e24587d3c6c69bf32c3857103da451e5