Skip to content

Commit

Permalink
Fix RECORD file in python wheels
Browse files Browse the repository at this point in the history
See #43.
  • Loading branch information
robamler committed Dec 14, 2023
1 parent 3d00502 commit c86b2f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 34 deletions.
44 changes: 11 additions & 33 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ jobs:
- name: generate license file
run: |
cargo install cargo-about
cargo install cargo-quickinstall
cargo quickinstall cargo-about
cargo about generate --features=pybindings about.hbs > website/license.html
wc -l website/license.html
Expand Down Expand Up @@ -322,6 +323,15 @@ jobs:
with:
python-version: "3.12"

- name: generate license file
run: |
rm LICENSE.*
cargo install cargo-quickinstall
cargo quickinstall cargo-about
cargo about generate --features=pybindings about.hbs > LICENSE.html
ls -l LICENSE*
wc -l LICENSE*
- name: Build wheels (unix)
if: matrix.os != 'windows-latest'
uses: messense/maturin-action@v1
Expand All @@ -337,12 +347,6 @@ jobs:
command: build
args: --release --strip --features pybindings -i C:\hostedtoolcache\windows\Python\${{ steps.setup-python-3-7.outputs.python-version }}\x64\python3.exe C:\hostedtoolcache\windows\Python\${{ steps.setup-python-3-8.outputs.python-version }}\x64\python3.exe C:\hostedtoolcache\windows\Python\${{ steps.setup-python-3-9.outputs.python-version }}\x64\python3.exe C:\hostedtoolcache\windows\Python\${{ steps.setup-python-3-10.outputs.python-version }}\x64\python3.exe C:\hostedtoolcache\windows\Python\${{ steps.setup-python-3-11.outputs.python-version }}\x64\python3.exe C:\hostedtoolcache\windows\Python\${{ steps.setup-python-3-12.outputs.python-version }}\x64\python3.exe

# For some reason, manylinux builds create wheels owned by the root user,
# which breaks our attempts to add the license file below.
- name: Fix wheel ownership on linux
if: matrix.os == 'ubuntu-latest'
run: sudo chown -R runner:docker target

- name: Cross-build wheels for Apple Silicon
if: matrix.os == 'macos-latest'
uses: messense/maturin-action@v1
Expand All @@ -366,32 +370,6 @@ jobs:
if: matrix.os == 'windows-latest'
run: dir target\wheels\

- name: generate license file
run: |
cargo install cargo-about
cargo about generate --features=pybindings about.hbs > LICENSE.html
ls -l LICENSE.html
wc -l LICENSE.html
- name: Add LICENSE.html to all wheels (unix)
if: matrix.os != 'windows-latest'
run: |
for wheel in target/wheels/*.whl; do
zip -ur $wheel LICENSE.html
done
- name: Add LICENSE.html to all wheels (windows)
if: matrix.os == 'windows-latest'
run: |
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') | Out-Null
Get-ChildItem "target\wheels\" -Filter *.whl |
Foreach-Object {
$zip = [System.IO.Compression.ZipFile]::Open($_.FullName, "Update")
$licenseFile = [System.IO.Path]::GetFileName("LICENSE.html")
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zip, "LICENSE.html", $licenseFile, "Optimal") | Out-Null
$zip.Dispose()
}
- name: Save artifact with wheels for ${{ matrix.os }}
uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
dependencies = [
"numpy~=1.16",
]
license = {text = "various (see LICENSE.html)"}
maintainers = [
{name = "Robert Bamler", email = "robert.bamler@uni-tuebingen.de"},
]
Expand All @@ -35,7 +36,6 @@ description = "Entropy coders for research and production (Python and Rust)."
documentation = "https://bamler-lab.github.io/constriction/apidoc/python/"
homepage = "https://bamler-lab.github.io/constriction/"
keywords = ["compression", "machine-learning", "entropy-coding", "range-coding", "ANS"]
license = "MIT OR Apache-2.0 OR BSL-1.0"
name = "constriction"
repository = "https://github.com/bamler-lab/constriction/"
version = "1.2.2"
Expand Down

0 comments on commit c86b2f8

Please sign in to comment.