Skip to main content

No project description provided

Project description

Python bindings for bliss-rs

This repo contains the bare minimum to create and upload a wheel to Pypi.

It is more of a personal reminder on how to do things, but can also be used as inspiration for other projects.

All of the below commands assume that you're in a fresh clone of this repository (and some docker commands may need to be run with sudo if docker is not configured to work as your current user).

Local build for your own python version

maturin build --release

Should be enough. You can then proceed to install the built wheel with

pip install target/wheels/<wheel_name>.whl

Local build for all python versions (3.6+)

Build the maturin docker image, with a couple additions (clang, ffmpeg...)

docker build -t polochon-street/bliss-python .

Then, still in the clone (replace "build --release" by "publish --no-sdist -f" if you have access to the Pypi repository and want to publish a new version):

docker run --rm -v $(pwd):/io polochon-street/bliss-python build --release -f

Finally, you can install the wheel with (or simply pip install bliss_audio, if you just used maturin publish).

pip install target/wheels/<wheel_name>.whl

Local cross-compilation from x64 to arm64:

You can make use of cross to cross-compile a wheel to a desired architecture.

For example, for arm64, install cross, and run

~/.cargo/bin/cross build --target aarch64-unknown-linux-gnu --verbose

as a test to check that you can build it properly.

Then copy/paste the last command - something like this:

sudo /usr/bin/docker run --userns host -e 'PKG_CONFIG_ALLOW_CROSS=1' -e 'XARGO_HOME=/root/.xargo' -e 'CARGO_HOME=/root/.cargo' -e 'CROSS_RUST_SYSROOT=/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu' -e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' -e TERM -e 'USER=root' -e 'CROSS_RUSTC_MAJOR_VERSION=1' -e 'CROSS_RUSTC_MINOR_VERSION=67' -e 'CROSS_RUSTC_PATCH_VERSION=1' --name cross-stable-x86_64-unknown-linux-gnu-53e1a-d5a82bbd2-aarch64-unknown-linux-gnu-e7d5d-1677439406313 --rm --user 0:0 -v /root/.xargo:/root/.xargo:z -v /root/.cargo:/root/.cargo:z -v /root/.cargo/bin -v path:path:z -v /root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu:z,ro -v path/target:/target:z -w patch -t localhost/cross-rs/cross-custom-bliss-python:aarch64-unknown-linux-gnu-e7d5d-pre-build sh -c 'PATH="$PATH":"/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin" cargo build --release --target aarch64-unknown-linux-gnu --verbose'

Don't forget to cargo clean! Otherwise cargo's previous build will be used, and the linking will fail.

Replace that last cargo with maturin (either keep maturin build --release -f or use maturin publish -f if you want to publish it directly - you probably want to build it and then test it on a virtual machine with the correct architecture).

Notice that we also need to add --features=pyo3/abi3-py38,pyo3/extension-module to prevent linking against libpython and make the build succeed.

It is ugly, and I'd be glad if someone has a better option to run custom commands with cross.

To install the wheel, as usual run

pip install target/wheels/<wheel_name>.whl

from a computer / virtual machine with the right architecture.

For me, following this https://wiki.ubuntu.com/ARM64/QEMU, replacing the command with

sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash /usr/share/AAVMF/AAVMF_CODE.fd -pflash flash1.img -drive if=none,file=jammy-server-cloudimg-arm64.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=08:00:27:33:5b:40

And then installing python3, pip and ffmpeg in the container worked a charm to test arm64.

Final check

To check that everything is working, you can run the following code:

python -c 'from bliss_audio import Song; print(Song(<path/to/a/valid/song>).analysis)'

If it completes and prints some numbers, congratulations! If is working properly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

bliss_audio-0.1.8-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

bliss_audio-0.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

Details for the file bliss_audio-0.1.8-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 76e0ad3a0953d5ac59b74cd6aca61e91ebaa192db6eafa31a5a621f4e733e8fd
MD5 f3f2cd46c46426a00b7b737692a1b752
BLAKE2b-256 793b796b73cc3d708fe74a0416dd5dd7b00e26e4036556598335d920512960e6

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9eb393557d7d6abe184518f1cecb2abd25cbd7cf4e1a591689f616987025fd6
MD5 259b67f04db1a7d2265608af97169f5e
BLAKE2b-256 63f4cf40800f18be26c1c06c63e22a5735bbb7374f76ace1a9095d516a3fa876

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8aae51dfb3b5db2ae8ac4a52f7da574bdbe392f6cfaf2035c0d23defc0ac21bb
MD5 03c5f70254b63104dce3de020810cb77
BLAKE2b-256 62b69aa02e63511cc91dd42fbdc36b5d46dfa8a3a8d15ebf73036aba625ac043

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0b3072bbf43be526d41068a51d207daf2f772975f00c9b3ae57ea21c09ba389
MD5 76d4f8b9435574f048ce5033a356dc87
BLAKE2b-256 a4b28958b7e12a07966422091051d52a74f6383f139ceb046f35000e07c35a8d

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 416ffe1d093fa47d2b9e23fe3efb7485aec1dc729356c86767614f78369f700e
MD5 afa12b3fedb2cfa1c32d747d04b29dff
BLAKE2b-256 5c1ea135c3326546cfe21f937f8d81325e4d93b9731230c64a689a6f03f27d29

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4df613a542d6fc05a83f8e0a2a691fec7aaf8c9953370167c88466670c2d8bfb
MD5 f558b54a406f1c12e1e2a2b8382b2114
BLAKE2b-256 3bdf53dd52a0c1d670d7093e1bc21eaf8069c7c13fceeab25c126d307198a62b

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ad0708c1937c63ebf0c2ee3053a6ff477067a5183e0c08bc07cd040da0fcd3e
MD5 0c4270954f60f0b8fd5ea041005a8b04
BLAKE2b-256 a40e65ce0d7a491614784d5af72a62acf541ce63bc6fd9e6a37f243292a9c0ed

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e0fdefc4d1203bc9ed8e4b6602bb12dcebfa0d7aa6a6fc944090b4999a7653b
MD5 dd593594e86bda3e521c646baa495ffa
BLAKE2b-256 6a83a089ec1b58b333e731e0d6382f66966e227bc2bd206f54ebe6fdf356e767

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e1bcabba0ab45a7076dbd6c9d9941dbd1b9784181686fb570e6b2c6a9cd44cc9
MD5 33b4f240809f1c61d9872d32c3533455
BLAKE2b-256 5194a39d6474d00c43bcf82ab8259b99e4da57a341fe8bda83a0c395ae62c1ff

See more details on using hashes here.

File details

Details for the file bliss_audio-0.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bliss_audio-0.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 470f6567b15780ff15a557c022ba654f01decba0569fbbd09eb3711dfde18c27
MD5 3251d8ef91456b622edc98ad5f43ea97
BLAKE2b-256 ec818ca5dcf7c5e6a9b5fae332208b0107d246a22e0ad0014239db86dacf7468

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page