diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8629a34..d1f381a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,41 +24,41 @@ jobs: ./cpp_example ./omaha_example ./unit_tests - - name: Setup Zig - uses: goto-bus-stop/setup-zig@v1.3.0 - with: - version: master - - name: zig build -Drelease-fast - run: | - cd cpp - zig build -Drelease-fast - - name: zig build -Ddynamic -Drelease-fast - run: | - cd cpp - zig build -Ddynamic -Drelease-fast - - name: zig build -Dtarget=x86_64-windows -Drelease-fast - run: | - cd cpp - zig build -Dtarget=x86_64-windows -Drelease-fast - - name: zig build -Domaha -Drelease-fast - run: | - cd cpp - zig build -Domaha -Drelease-fast - - name: zig build -Domaha -Ddynamic -Drelease-fast - run: | - cd cpp - zig build -Domaha -Ddynamic -Drelease-fast - - name: zig build -Domaha -Ddynamic -Dtarget=x86_64-windows -Drelease-fast - run: | - cd cpp - zig build -Domaha -Ddynamic -Dtarget=x86_64-windows -Drelease-fast - - name: zig build and run examples - run: | - cd cpp - zig build examples - zig-out/bin/c_example - # FIXME: zig-out/bin/cpp_example - # FIXME: zig-out/bin/omaha_example +# - name: Setup Zig +# uses: goto-bus-stop/setup-zig@v1.3.0 +# with: +# version: master +# - name: zig build -Drelease-fast +# run: | +# cd cpp +# zig build -Drelease-fast +# - name: zig build -Ddynamic -Drelease-fast +# run: | +# cd cpp +# zig build -Ddynamic -Drelease-fast +# - name: zig build -Dtarget=x86_64-windows -Drelease-fast +# run: | +# cd cpp +# zig build -Dtarget=x86_64-windows -Drelease-fast +# - name: zig build -Domaha -Drelease-fast +# run: | +# cd cpp +# zig build -Domaha -Drelease-fast +# - name: zig build -Domaha -Ddynamic -Drelease-fast +# run: | +# cd cpp +# zig build -Domaha -Ddynamic -Drelease-fast +# - name: zig build -Domaha -Ddynamic -Dtarget=x86_64-windows -Drelease-fast +# run: | +# cd cpp +# zig build -Domaha -Ddynamic -Dtarget=x86_64-windows -Drelease-fast +# - name: zig build and run examples +# run: | +# cd cpp +# zig build examples +# zig-out/bin/c_example +# zig-out/bin/cpp_example +# zig-out/bin/omaha_example cpp_benchmark: name: C++ Benchmark runs-on: ubuntu-latest @@ -76,12 +76,15 @@ jobs: python-test: name: Python test runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - name: Set up Python 3.x uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: ${{ matrix.python-version }} - name: Install package run: | cd python diff --git a/LICENSE b/LICENSE index 40aca2c..1f22fa3 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2021 Henry Lee + Copyright 2016-2023 Henry Lee Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 0b8493e..04055b0 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.14) -project(PokerHandEvaluator VERSION 0.5.1) +project(PokerHandEvaluator VERSION 0.5.2) set(CMAKE_BUILD_TYPE "Release") diff --git a/python/LICENSE b/python/LICENSE index 40aca2c..1f22fa3 100644 --- a/python/LICENSE +++ b/python/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2021 Henry Lee + Copyright 2016-2023 Henry Lee Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/python/phevaluator/evaluator_omaha.py b/python/phevaluator/evaluator_omaha.py index bc153bc..67c1162 100644 --- a/python/phevaluator/evaluator_omaha.py +++ b/python/phevaluator/evaluator_omaha.py @@ -51,7 +51,7 @@ def evaluate_omaha_cards(*cards: Union[int, str, Card]) -> int: return _evaluate_omaha_cards(community_cards, hole_cards) -def _evaluate_omaha_cards(community_cards: list[int], hole_cards: list[int]) -> int: +def _evaluate_omaha_cards(community_cards: [int], hole_cards: [int]) -> int: value_flush = 10000 value_noflush = 10000 suit_count_board = [0] * 4 diff --git a/python/phevaluator/hash.py b/python/phevaluator/hash.py index 41e5414..da23b07 100644 --- a/python/phevaluator/hash.py +++ b/python/phevaluator/hash.py @@ -4,11 +4,11 @@ from .tables import CHOOSE, DP -def hash_quinary(quinary: list[int], num_cards: int) -> int: +def hash_quinary(quinary: [int], num_cards: int) -> int: """Hash list of cards. Args: - quinary (list[int]): List of the count of the cards. + quinary ([int]): List of the count of the cards. num_cards (int): The number of cards. Returns: diff --git a/python/phevaluator/utils.py b/python/phevaluator/utils.py index c20d326..17701eb 100644 --- a/python/phevaluator/utils.py +++ b/python/phevaluator/utils.py @@ -4,6 +4,6 @@ import random -def sample_cards(size: int) -> list[int]: +def sample_cards(size: int) -> [int]: """Sample random cards with size.""" return random.sample(range(52), k=size) diff --git a/python/setup.cfg b/python/setup.cfg index 5f10033..08a12df 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = phevaluator -version = 0.5.1 +version = 0.5.2 description = PH Evaluator - an efficient Poker Hand Evaluator based on a Perfect Hash algorithm long_description = file: README.md long_description_content_type = text/markdown @@ -32,7 +32,7 @@ project_urls = Source = https://github.com/HenryRLee/PokerHandEvaluator/tree/master/python [options] -python_requires= >=3.6, <4 +python_requires= >=3.7, <4 packages = find: install_requires = numpy diff --git a/python/tests/table_tests/test_hashtable.py b/python/tests/table_tests/test_hashtable.py index c2843e6..c1fcb87 100644 --- a/python/tests/table_tests/test_hashtable.py +++ b/python/tests/table_tests/test_hashtable.py @@ -11,8 +11,8 @@ class TestFlushTable(unittest.TestCase): VISIT = [0] * len(FLUSH) CUR_RANK = 1 - CACHE: list[int] = [] - BINARIES: list[int] = [] + CACHE: [int] = [] + BINARIES: [int] = [] @classmethod def setUpClass(cls): diff --git a/python/tests/table_tests/utils.py b/python/tests/table_tests/utils.py index a3d6d48..9729582 100644 --- a/python/tests/table_tests/utils.py +++ b/python/tests/table_tests/utils.py @@ -8,8 +8,8 @@ class BaseTestNoFlushTable(unittest.TestCase): - TABLE: list[int] = NotImplemented - VISIT: list[int] = NotImplemented + TABLE: [int] = NotImplemented + VISIT: [int] = NotImplemented NUM_CARDS: int = NotImplemented @classmethod diff --git a/python/tests/test_evalator_omaha.py b/python/tests/test_evalator_omaha.py index f9232a1..eb4470a 100644 --- a/python/tests/test_evalator_omaha.py +++ b/python/tests/test_evalator_omaha.py @@ -12,7 +12,7 @@ ) -def evaluate_omaha_exhaustive(community_cards: list[int], hole_cards: list[int]) -> int: +def evaluate_omaha_exhaustive(community_cards: [int], hole_cards: [int]) -> int: """Evaluate omaha cards with `_evaluate_cards`.""" best_rank = min( _evaluate_cards(c1, c2, c3, h1, h2)