Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Python wheel contains two copies of LICENSE #766

Closed
simonw opened this issue Dec 10, 2023 · 5 comments
Closed

[bug] Python wheel contains two copies of LICENSE #766

simonw opened this issue Dec 10, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@simonw
Copy link

simonw commented Dec 10, 2023

Download ast_grep_cli-0.14.2-py3-none-macosx_10_7_x86_64.whl from https://pypi.org/project/ast-grep-cli/#files and run the following command:

unzip -l ast_grep_cli-0.14.2-py3-none-macosx_10_7_x86_64.whl

Output:

  Length      Date    Time    Name
---------  ---------- -----   ----
     6207  12-03-2023 07:34   ast_grep_cli-0.14.2.dist-info/METADATA
      102  12-03-2023 07:34   ast_grep_cli-0.14.2.dist-info/WHEEL
     1077  12-03-2023 07:34   ast_grep_cli-0.14.2.dist-info/license_files/LICENSE
     1077  12-03-2023 07:34   ast_grep_cli-0.14.2.dist-info/license_files/LICENSE
 32865880  12-03-2023 07:34   ast_grep_cli-0.14.2.data/scripts/sg
 32865880  12-03-2023 07:34   ast_grep_cli-0.14.2.data/scripts/ast-grep
      639  12-03-2023 07:34   ast_grep_cli-0.14.2.dist-info/RECORD
---------                     -------
 65740862                     7 files

The LICENSE file is listed twice. I didn't know zip files could do that!

I'm pretty sure this doesn't actually matter - the wheel installs just fine. I only noticed this because I got this message when I tried to unzip the wheel myself:

unzip ast_grep_cli-0.14.2-py3-none-macosx_10_7_x86_64.whl
Archive:  ast_grep_cli-0.14.2-py3-none-macosx_10_7_x86_64.whl
  inflating: ast_grep_cli-0.14.2.dist-info/METADATA  
  inflating: ast_grep_cli-0.14.2.dist-info/WHEEL  
  inflating: ast_grep_cli-0.14.2.dist-info/license_files/LICENSE  
replace ast_grep_cli-0.14.2.dist-info/license_files/LICENSE? [y]es, [n]o, [A]ll, [N]one, [r]ename: 
@simonw simonw added the bug Something isn't working label Dec 10, 2023
@HerringtonDarkholme
Copy link
Member

Hi Simon! Thanks for reporting. I will investigate it when I have time :)

By the way, I truly appreciate your words on HN. I am so grateful you find the ast-grep's packaging useful. I spent a lot of time designing and making the tool usable for many scenarios.

@simonw
Copy link
Author

simonw commented Dec 11, 2023

It's really cool!

I blogged it https://simonwillison.net/2023/Dec/10/ast-grep/ and sent it out in my newsletter too: https://simonw.substack.com/p/datasette-enrichments-a-new-plugin

@HerringtonDarkholme
Copy link
Member

HerringtonDarkholme commented May 3, 2024

This is caused by #473

Removing the license-file in the crate Cargo.toml fixes this. However, the license file is critical for void-linux packaging.

@icp1994 is it possible to use the license = "MIT" in TOML instead of license-file?

@HerringtonDarkholme
Copy link
Member

I created an upstream issue for duplicate license. PyO3/maturin#2066

Track the issue in the maturin repo and close the issue for now.

@icp1994
Copy link
Contributor

icp1994 commented May 3, 2024

Instead of using license-file, I tried include = ["/src/", "/tests/", "../../LICENSE"] but it doesn't work according to the output of cargo package --list --allow-dirty. So maybe relative paths aren't supported under include? I could get it working by copying the root license file into the cli crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants