Skip to main content

Package with some fast Rust functions for use with FRC resolution determination for microscopy. TU Delft BEP 2021-2022.

Project description

rustfrc

Installation

Wheel (Windows)

There is a Windows-compatible .whl file available in releases. Use pip install <.whl filename> in your Python environment, for example: pip install rustfrc-0.1.0-cp39-none-win_amd64.whl, to install it. Then, use import rustfrc in your Python script to be able to use the Rust functions.

From source (using maturin)

rustfrc uses poetry as its Python dependency manager. For best results, create a poetry virtualenv with the pyproject.toml and run poetry update to install the required packages. Otherwise, installing maturin manually should also work.

Build a wheel file like this (if using poetry, append poetry run before the command) from the project directory:

maturin build --release

If you want to choose which versions of Python to build for, you can append e.g. -i python3.9 python3.8 python3.7

This generates .whl files in \target\wheels. Then, create a Python environment of your choosing (with numpy ^1.18 and python ^3.7), drop the .whl file in it and run pip install <.whl filename>, for example: pip install rustfrc-0.1.0-cp39-none-win_amd64.whl. Then, use import rustfrc in your Python script to be able to use the Rust functions. Building for Linux is a bit more challenging, take a look at the maturin page.

Take a look at PyO3 for other installation options as the only true requirement for building is using a tool that understands PyO3 bindings, as those are used in the Rust code.

Manylinux

If you want to build .whl files that are compatible with a wide range of Linux distributions, using a manylinux container is necessary.

Go into the rustfrc/docker directory and run:

docker pull quay.io/pypa/manylinux2014_x86_64
docker build -t tmtenbrink/manylinux2014-rustfrc --build-arg PY_ABI=cp39-cp39 .

After the image is built, run it as a container:

docker run -it tmtenbrink/manylinux2014-rustfrc

Then follow the same steps as above, but when the wheels are built do, which should resolve any issues:

find . -name '*.whl' -exec auditwheel repair {} \;

Uploading to PyPI (test)

(Again, use poetry run)

twine upload --repository testpypi wheelhouse/*

Project details


Download files

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

Source Distribution

rustfrc-0.1.2.tar.gz (1.4 MB view hashes)

Uploaded Source

Built Distributions

rustfrc-0.1.2-cp39-none-win_amd64.whl (178.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

rustfrc-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (985.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

rustfrc-0.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (566.4 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustfrc-0.1.2-cp39-cp39-macosx_10_7_x86_64.whl (287.7 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

rustfrc-0.1.2-cp38-none-win_amd64.whl (178.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rustfrc-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (986.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

rustfrc-0.1.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustfrc-0.1.2-cp38-cp38-macosx_10_7_x86_64.whl (288.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

rustfrc-0.1.2-cp37-none-win_amd64.whl (178.7 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

rustfrc-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (985.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

rustfrc-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustfrc-0.1.2-cp37-cp37m-macosx_10_7_x86_64.whl (288.0 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

Supported by

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