pkpython 0.0.54__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pkpython-0.0.54/.github/workflows/ci.yml +43 -0
- pkpython-0.0.54/.github/workflows/publish.yml +93 -0
- pkpython-0.0.54/.gitignore +11 -0
- pkpython-0.0.54/CHANGELOG.md +49 -0
- pkpython-0.0.54/Cargo.lock +2005 -0
- pkpython-0.0.54/Cargo.toml +20 -0
- pkpython-0.0.54/LICENSE +674 -0
- pkpython-0.0.54/Makefile +94 -0
- pkpython-0.0.54/PKG-INFO +874 -0
- pkpython-0.0.54/README.md +855 -0
- pkpython-0.0.54/demo.py +218 -0
- pkpython-0.0.54/docs/STACK.md +35 -0
- pkpython-0.0.54/docs/pypi-publishing-plan.md +228 -0
- pkpython-0.0.54/docs/superpowers/plans/2026-04-28-pkpy-0.0.52-upgrade.md +1742 -0
- pkpython-0.0.54/docs/superpowers/plans/2026-04-29-pkpy-pokersession-tablenocell.md +1215 -0
- pkpython-0.0.54/docs/superpowers/specs/2026-04-28-pkpy-0.0.52-upgrade-design.md +137 -0
- pkpython-0.0.54/docs/superpowers/specs/2026-04-29-pkpy-pokersession-tablenocell-design.md +319 -0
- pkpython-0.0.54/examples/calc.py +150 -0
- pkpython-0.0.54/examples/gto.py +90 -0
- pkpython-0.0.54/examples/the_hand.py +125 -0
- pkpython-0.0.54/pyproject.toml +34 -0
- pkpython-0.0.54/python/pkpy/__init__.py +143 -0
- pkpython-0.0.54/src/bot.rs +7 -0
- pkpython-0.0.54/src/hand_history.rs +7 -0
- pkpython-0.0.54/src/lib.rs +4070 -0
- pkpython-0.0.54/src/session.rs +212 -0
- pkpython-0.0.54/src/stats.rs +7 -0
- pkpython-0.0.54/src/table_no_cell.rs +232 -0
- pkpython-0.0.54/tests/test_pkpy.py +1136 -0
- pkpython-0.0.54/tests/test_session.py +157 -0
- pkpython-0.0.54/tests/test_table_no_cell.py +140 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.13"
|
|
19
|
+
|
|
20
|
+
- name: Set up Rust
|
|
21
|
+
uses: dtolnay/rust-toolchain@stable
|
|
22
|
+
|
|
23
|
+
- name: Cache Rust build
|
|
24
|
+
uses: actions/cache@v4
|
|
25
|
+
with:
|
|
26
|
+
path: |
|
|
27
|
+
~/.cargo/registry
|
|
28
|
+
~/.cargo/git
|
|
29
|
+
target
|
|
30
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
31
|
+
restore-keys: ${{ runner.os }}-cargo-
|
|
32
|
+
|
|
33
|
+
- name: Create virtualenv
|
|
34
|
+
run: python -m venv .venv
|
|
35
|
+
|
|
36
|
+
- name: Install maturin and pytest
|
|
37
|
+
run: .venv/bin/pip install maturin pytest
|
|
38
|
+
|
|
39
|
+
- name: Build and install wheel
|
|
40
|
+
run: .venv/bin/maturin develop
|
|
41
|
+
|
|
42
|
+
- name: Run tests
|
|
43
|
+
run: .venv/bin/pytest
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write # required for PyPI trusted publishing
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
linux:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
target: [x86_64, aarch64]
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: PyO3/maturin-action@v1
|
|
20
|
+
with:
|
|
21
|
+
target: ${{ matrix.target }}
|
|
22
|
+
args: --release --out dist --find-interpreter
|
|
23
|
+
sccache: "true"
|
|
24
|
+
manylinux: auto
|
|
25
|
+
- uses: actions/upload-artifact@v4
|
|
26
|
+
with:
|
|
27
|
+
name: wheels-linux-${{ matrix.target }}
|
|
28
|
+
path: dist
|
|
29
|
+
|
|
30
|
+
macos:
|
|
31
|
+
runs-on: macos-latest
|
|
32
|
+
strategy:
|
|
33
|
+
matrix:
|
|
34
|
+
target: [x86_64, aarch64]
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
- uses: PyO3/maturin-action@v1
|
|
38
|
+
with:
|
|
39
|
+
target: ${{ matrix.target }}
|
|
40
|
+
args: --release --out dist --find-interpreter
|
|
41
|
+
sccache: "true"
|
|
42
|
+
- uses: actions/upload-artifact@v4
|
|
43
|
+
with:
|
|
44
|
+
name: wheels-macos-${{ matrix.target }}
|
|
45
|
+
path: dist
|
|
46
|
+
|
|
47
|
+
windows:
|
|
48
|
+
runs-on: windows-latest
|
|
49
|
+
strategy:
|
|
50
|
+
matrix:
|
|
51
|
+
target: [x86_64]
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
- uses: PyO3/maturin-action@v1
|
|
55
|
+
with:
|
|
56
|
+
target: ${{ matrix.target }}
|
|
57
|
+
args: --release --out dist --find-interpreter
|
|
58
|
+
sccache: "true"
|
|
59
|
+
- uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: wheels-windows-${{ matrix.target }}
|
|
62
|
+
path: dist
|
|
63
|
+
|
|
64
|
+
sdist:
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v4
|
|
68
|
+
- uses: PyO3/maturin-action@v1
|
|
69
|
+
with:
|
|
70
|
+
command: sdist
|
|
71
|
+
args: --out dist
|
|
72
|
+
- uses: actions/upload-artifact@v4
|
|
73
|
+
with:
|
|
74
|
+
name: wheels-sdist
|
|
75
|
+
path: dist
|
|
76
|
+
|
|
77
|
+
publish:
|
|
78
|
+
name: Publish to PyPI
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
needs: [linux, macos, windows, sdist]
|
|
81
|
+
environment:
|
|
82
|
+
name: pypi
|
|
83
|
+
url: https://pypi.org/project/pkpython/
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/download-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
pattern: wheels-*
|
|
88
|
+
merge-multiple: true
|
|
89
|
+
path: dist
|
|
90
|
+
- uses: PyO3/maturin-action@v1
|
|
91
|
+
with:
|
|
92
|
+
command: upload
|
|
93
|
+
args: --non-interactive --skip-existing dist/*
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project tracks [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
The crate version is kept in lockstep with the underlying `pkcore` dependency.
|
|
8
|
+
|
|
9
|
+
## [0.0.54] - 2026-04-30
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Bumped `pkcore` dependency from `0.0.53` to `0.0.54`.
|
|
14
|
+
- Bumped `pkpy` crate version to `0.0.54` to stay in lockstep with `pkcore`.
|
|
15
|
+
|
|
16
|
+
### Fixed (inherited from `pkcore` 0.0.54)
|
|
17
|
+
|
|
18
|
+
No pkpy code was modified for this release, but the upstream fix changes
|
|
19
|
+
observable behavior on one Python-exposed method, `TableNoCell.to_call()`.
|
|
20
|
+
|
|
21
|
+
- **Short-stacked big blind — call target now anchored to the configured BB.**
|
|
22
|
+
When the BB is all-in for less than the configured big blind (e.g. BB=100
|
|
23
|
+
but stack=30), `TableNoCell.to_call()` now returns the full configured BB
|
|
24
|
+
(`100`) instead of the amount the BB physically posted (`30`). Other
|
|
25
|
+
players must call the full configured amount; chip conservation is
|
|
26
|
+
preserved at showdown via side-pot stratification (multiway) or
|
|
27
|
+
uncalled-bet returns (heads-up / no second contestant at that tier).
|
|
28
|
+
This matches standard cardroom rules (TDA, WSOP).
|
|
29
|
+
- **`act_call` now degrades gracefully when the caller is short.** When a
|
|
30
|
+
caller cannot cover the call target, the action is converted to an
|
|
31
|
+
all-in for the caller's remaining stack rather than erroring on
|
|
32
|
+
insufficient chips. Surfaced through pkpy via `PokerSession.apply_action`.
|
|
33
|
+
- **`min_raise` stays anchored to the configured BB** even when the BB is
|
|
34
|
+
all-in for less. Prior behavior could allow under-sized raises in the
|
|
35
|
+
short-BB scenario.
|
|
36
|
+
|
|
37
|
+
### Migration notes
|
|
38
|
+
|
|
39
|
+
- Public Rust API of `pkcore` is **unchanged**. No method signatures, types,
|
|
40
|
+
or imports moved. pkpy compiles clean against `pkcore 0.0.54` with no
|
|
41
|
+
source changes.
|
|
42
|
+
- If you have Python code that asserts specific chip math against a
|
|
43
|
+
short-stacked-BB scenario built on pkcore 0.0.53 semantics, those
|
|
44
|
+
assertions will need to be updated. The pkpy test suite does not
|
|
45
|
+
currently exercise this scenario, so the in-tree tests remain green.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
Earlier releases pre-date this changelog. See `git log` for prior history.
|