-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script to add license full text file to wheel dist-info
maturing has issues embedding license full text in the wheels so for now we do it ourselves. PyO3/maturin#829 There's another problem using wheeltools on windows (it creates zip files with backslashes...) so I run this on Linux after all the wheels have been built.
- Loading branch information
1 parent
2a89cde
commit 8274bbc
Showing
4 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
from pathlib import Path | ||
import shutil | ||
from wheeltools import InWheel | ||
|
||
|
||
root_dir = Path(__file__).parent.resolve() | ||
crate_dir = root_dir / "pngquant" | ||
license = crate_dir / "COPYRIGHT" | ||
|
||
|
||
def main(): | ||
# maturin has problems adding the license text to the wheel archive yet so we | ||
# have to do it ourselves: cf. https://github.com/PyO3/maturin/issues/829 | ||
for wheel_file in sys.argv[1:]: | ||
with InWheel(in_wheel=wheel_file, out_wheel=wheel_file) as tmpdir: | ||
distinfo = next(Path(tmpdir).glob("*.dist-info")) | ||
assert distinfo.is_dir() | ||
shutil.copyfile(license, distinfo / "LICENSE") | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ maturin | |
tomli | ||
tomli-w | ||
twine | ||
wheeltools |