跳转到主要内容

期权定价库

项目描述

期权定价

概述

Python PyO3 对Rust crate option-pricing 的包装包。

3个构建

构建

命令

# 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 .

这生成了Linux和Windows的wheel文件

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

发布

命令

# 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*

安装

命令

pip install pyo3_option_pricing

参考

打包官方推荐: setup.py 已弃用?.

项目详情


下载文件

下载适合您平台文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源分布

pyo3_option_pricing-0.1.0.tar.gz (6.1 kB 查看哈希值)

上传时间:

构建分布

pyo3_option_pricing-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (239.8 kB 查看哈希值)

上传时间 CPython 3.11 manylinux: glibc 2.17+ x86-64

pyo3_option_pricing-0.1.0-cp310-cp310-win_amd64.whl (213.8 kB 查看哈希值)

上传时间 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 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ x86-64

由以下支持

AWSAWS 云计算和安全赞助商 DatadogDatadog 监控 FastlyFastly CDN GoogleGoogle 下载分析 MicrosoftMicrosoft PSF赞助商 PingdomPingdom 监控 SentrySentry 错误日志 StatusPageStatusPage 状态页面