Skip to content

dist-info data ignored in favour of file found in the package #330

Description

@llimeht

Between pip-licenses 5.5.0 and 5.5.5, the licence output from the SasView wheel changed; I suspect this is due to now finding lowercase filenames (#208) accidentally meaning that other files were found.

SasView wheel correctly declares:

License: BSD-3-Clause
License-File: LICENSE.TXT

and sasview-[version].dist-info/licenses/LICENSE.TXT exists, with v5.5.0 returning that file:

$ pip-licenses -v
pip-licenses 5.5.0

$ pip-licenses -p sasview --with-license-file --format=json
[
  {
    "License": "BSD License",
    "LicenseFile": ".../.venv/lib/python3.13/site-packages/sasview-[VERSION].dist-info/licenses/LICENSE.TXT",
    "LicenseText": "Copyright (c) 2009-2025, ...

However, the sasview wheel also includes the file sas/docs/_sources/user/license.rst.txt (sasview ships its documentation inside the wheel as it needs to be displayed at runtime and while offline). That's an rst file with other text in, not just the licence text. That's not the version we want pip-licenses to return, but suddenly v5.5.5 has started doing so:

$ pip-licenses -v
pip-licenses 5.5.5

$ pip-licenses -p sasview --with-license-file --format=json
[
  {
    "License": "BSD License",
    "LicenseFile": ".../.venv/lib/python3.13/site-packages/sas/docs/_sources/user/license.rst.txt",
    "LicenseText": ".. _license:\n\n...

My expectation (and how pip-licenses used to behave) is that pip-licenses would give me the licence file defined in the wheel metadata, not some other file that happened to be in the wheel which could be entirely unrelated data, or as in this case, the correct data but in an unwanted rst format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonPull requests that update python codeuser requestedThis request came from a user, not the project maintainers

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions