Metadata-Version: 2.1
Name: pyo3_poker_eval
Version: 0.1.0
Summary: Poker eval library
Author-email: firstname lastname <author@gmail.com>
License: MIT
Project-URL: repository, https://github.com/oscar6echo/pyo3-poker-eval.git
Keywords: poker,rust
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"

# Poker Eval

## Overview

Python [PyO3](https://pyo3.rs/) wrapper package over Rust crate [poker_eval](https://crates.io/crates/poker_eval).  
Cross compilation "linux2win" is done with [cross](https://github.com/cross-rs/cross).  

## Build

Commands:

```sh
# prerequisite
mm activate work
pip install -U 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=pc_windows_gnu_x86_64" > $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:

```sh
ls -1  dist
pyo3_poker_eval-0.1.0-cp310-cp310-linux_x86_64.whl
pyo3_poker_eval-0.1.0-cp310-cp310-pc_windows_gnu_x86_64.whl
pyo3_poker_eval-0.1.0.tar.gz
```

## Publish

Commands:

```sh
# prerequisite
mm activate work
pip install -U twine auditwheel

twine check dist/*

# assuming .pypirc configured
twine upload dist/*
```

## Install

Commands:

```sh
############ TBD - no ready yet
pip install pyo3_poker_eval
```

## Ref

Python packaging offical recommendation: [Is setup.py deprecated?](https://packaging.python.org/en/latest/discussions/setup-py-deprecated/).
