Skip to content

Missing license file in the 0.7.0 wheels #272

Closed
@oscarbenjamin

Description

@oscarbenjamin

It has been pointed out to me that the wheels distributed to PyPI for python-flint 0.7.0 are missing the LICENSE file:

$ ls python_flint-0.7.0.dist-info/
METADATA  RECORD  WHEEL
$ ls python_flint-0.6.0.dist-info/
DELVEWHEEL  LICENSE  METADATA  RECORD  top_level.txt  WHEEL

The source distribution has the LICENSE but it is not included in the wheels.

This is caused by switching the build system from setuptools to meson. Previously the MANIFEST.in file told setuptools to include the license file even though pyproject.toml does not mention the file:

license = {text = "MIT"}

I think it should be like

license = {file = 'LICENSE'}

Apparently though both of these are now the "legacy" way of doing it:
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license

So it should be:

license = 'MIT'
license-files = ['LICENSE']

Then I'm not sure if there should really be an AUTHORS file as well which python-flint so far does not have.

I am also now wondering about the fact that the python-flint wheels for PyPI include binaries for FLINT etc:

$ ls python_flint.libs/
libflint-c63d529f.so.20.0.0  libgmp-e0c82b6b.so.10.5.0  libmpfr-90ec1309.so.6.1.0

Looking at the way that numpy handles this it seems that the license for bundled libraries gets appended to the license file that ends up in the wheel:
https://github.com/numpy/numpy/blob/53f4cc5eb526b51cc01e25ca47bca68fff1e4b8f/tools/wheels/LICENSE_linux.txt#L2-L13
It seems that that is just appended to the license file during cibuildwheel:
https://github.com/numpy/numpy/blob/53f4cc5eb526b51cc01e25ca47bca68fff1e4b8f/tools/wheels/cibw_before_build.sh#L3-L20
So we should do something similar in python-flint.

The wheels for Linux and MacOS bundle GMP, MPFR and FLINT which are all LGPL. The wheels for Windows also bundle winpthread and libgcc_s_seh from mingw64.

winpthread is MIT/BSD:
https://packages.msys2.org/packages/mingw-w64-x86_64-winpthreads-git

I think that libgcc_s_seh is just needed when compiling with gcc and is expected to be freely distributed:
https://packages.msys2.org/packages/mingw-w64-x86_64-gcc-libs

What is needed is:

  • Copy the licenses for GMP, MPFR, FLINT and winpthread to a directory say vendored.
  • Have cibuildwheel append the license files to the main LICENSE file when building the PyPI wheels.
  • The license-files section in pyproject.toml should be used to tell meson-python to bundle the license into the wheels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions