requests icon indicating copy to clipboard operation
requests copied to clipboard

`NOTICE` file missing in wheel

Open radoering opened this issue 3 months ago • 3 comments

The notice files is missing in wheels although (afaik) it is required to include it due to the APACHE license and it seemed to be the intention of the authors to include it:

https://github.com/psf/requests/blob/420d16bc7ef326f7b65f90e4644adc0f6a0e1d44/setup.py#L69

(This line has no effect because LICENSE and NOTICE are not located in the package folder.)

There is already #7012, which fixes the issue (and also includes AUTHORS.txt). If changing the build-backend (or just switching to pyproject.toml) is not imminent, please let me know if you want me to create a PR to fix the issue with minimal changes to setup.py/setup.cfg.

radoering avatar Sep 20 '25 06:09 radoering

I can fix this with a minimal PR! The issue is that package_data in setup.py looks for files inside the package directory (src/requests/), but LICENSE and NOTICE are in the root.

Proposed fix:

  1. Move LICENSE, NOTICE, and AUTHORS.txt into src/requests/
  2. Update package_data to: {"requests": ["LICENSE", "NOTICE", "AUTHORS.txt"]}

This will ensure the files are included in wheel packages without changing the build system.

@maintainers Should I proceed with this approach?

tommasobaiocchi avatar Oct 08 '25 19:10 tommasobaiocchi

I just created #7046.

@tommasobaiocchi I think your proposal may not lead to the desired result: If I do not miss anything, the license files would be put into the package itself. However, they should be put into the dist-info directory.

radoering avatar Oct 17 '25 15:10 radoering

@radoering Thanks for the correction and for creating #7046! You're right - the files need to go in the dist-info directory, not the package itself.

I'll follow your PR to learn the proper approach for including license files in Python packages.

tommasobaiocchi avatar Oct 23 '25 07:10 tommasobaiocchi