From beeb86ca154c35b75c8fe0132b3e0946a3973b5d Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 9 Mar 2022 09:13:22 +0000 Subject: [PATCH] use latest maturin 0.12.10, fixes issue with embedding LICENSE text file in wheel https://github.com/PyO3/maturin/pull/836 --- .github/workflows/ci.yml | 32 -------------------------------- add_license_file_to_wheels.py | 26 -------------------------- pyproject.toml | 5 +++-- requirements.txt | 3 +-- 4 files changed, 4 insertions(+), 62 deletions(-) delete mode 100755 add_license_file_to_wheels.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25eca8d..c4dd87c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,38 +144,6 @@ jobs: name: dist path: dist - postfix: - name: Fix up wheels - needs: [build_sdist, build_macos, build_windows, build_linux ] - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - uses: actions/download-artifact@v2 - with: - name: dist - path: dist - - # https://github.com/PyO3/maturin/issues/829 - - name: Add license text file to wheels - run: | - pip install -r requirements.txt - python add_license_file_to_wheels.py dist/*.whl - - - name: Upload wheels - uses: actions/upload-artifact@v2 - with: - name: dist - path: dist - release: name: Release on tags if: startsWith(github.ref, 'refs/tags/v') diff --git a/add_license_file_to_wheels.py b/add_license_file_to_wheels.py deleted file mode 100755 index 852f31b..0000000 --- a/add_license_file_to_wheels.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/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:]: - print(f"Adding '{license.name}' to '{wheel_file}'") - 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()) diff --git a/pyproject.toml b/pyproject.toml index 7868487..8ab8979 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.12,<0.13"] +requires = ["maturin>=0.12.10,<0.13"] build-backend = "maturin" [tool.maturin] @@ -13,9 +13,10 @@ bindings = "bin" [project] name = "pngquant-cli" # by default, use the same 'version' as Cargo.toml, but can override if needed -version = "2.17.0.post5" +version = "2.17.0.post6" description = "Precompiled binaries for pngquant, the lossy PNG compressor based on libimagequant." maintainers = [{name = "Cosimo Lupo", email = "cosimo@anthrotype.com"}] +license = {file = "COPYRIGHT"} [project.urls] repository = "https://github.com/anthrotype/pngquant-wheels" diff --git a/requirements.txt b/requirements.txt index 9b77ee3..0423f19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -maturin +maturin>=0.12.10,<0.13 tomli tomli-w twine -wheeltools