Skip to main content

Option pricing library

Project description

Option Pricing

Overview

Python PyO3 wrapper package over Rust crate option-pricing.

3 builds:

Build

Commands:

# prerequisite
mm activate work
pip install build

# dev install
pip install -e .

# watch 
cargo watch --watch rust -- pip install -e .

# test
pytest

# install
pip install .

# ------- build native wheel
unset CARGO
unset CARGO_BUILD_TARGET
unset PYO3_CROSS_LIB_DIR
unset PYO3_CROSS_PYTHON_VERSION
unset DIST_EXTRA_CONFIG

python -m build .

# ------- build manylinux wheel
# image used by build
docker build -t builder-manylinux:local -f ./Dockerfile.manylinux .

# build wheels for several python versions
docker run --rm -v $(pwd):/io builder-manylinux:local /bin/bash /io/build-manylinux-wheels.sh

# ------- build windows wheel - using cross
# prerequisite
cargo install cross

export CARGO=cross
export CARGO_BUILD_TARGET=x86_64-pc-windows-gnu
export DIST_EXTRA_CONFIG=/tmp/build-opts.cfg

# set wheel suffix
echo -e "[bdist_wheel]\nplat_name=win-amd64" > $DIST_EXTRA_CONFIG

# image used by cross
docker build -t cross-pyo3:x86_64-pc-windows-gnu -f ./Dockerfile.win .

# build windows wheel
python -m build .

This produced wheels for linux and windows:

ls -1  dist
pyo3_option_pricing-0.1.0-cp310-cp310-linux_x86_64.whl
pyo3_option_pricing-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyo3_option_pricing-0.1.0-cp310-cp310-win_amd64.whl
pyo3_option_pricing-0.1.0-cp311-cp311-linux_x86_64.whl
pyo3_option_pricing-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyo3_option_pricing-0.1.0.tar.gz

Publish

Commands:

# prerequisite
mm activate work
pip install -U twine

twine check dist/*

# assuming .pypirc configured
# for linux only manylinux: the others will be refused
twine upload dist/*.tar.gz
twine upload dist/*manylinux*
twine upload dist/*win_amd64*

Install

Commands:

pip install pyo3_option_pricing

Ref

Packaging offical recommendation: Is setup.py deprecated?.

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

pyo3_option_pricing-0.1.0.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distributions

pyo3_option_pricing-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (239.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyo3_option_pricing-0.1.0-cp310-cp310-win_amd64.whl (213.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyo3_option_pricing-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (239.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ 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