From d1bf8d168e5e276cb0ca1a6af2a3e1c84ec03a08 Mon Sep 17 00:00:00 2001 From: Evyn Machi <32499767+SirRender00@users.noreply.github.com> Date: Tue, 19 Apr 2022 21:18:37 -0700 Subject: [PATCH] bump to 0.7.1 (#103) --- .github/workflows/pylint.yml | 2 +- .../workflows/{core-tests.yml => pytest.yml} | 4 +- .github/workflows/python-publish.yml | 2 +- .github/workflows/windows-gui-tests.yml | 42 +++++++++++++++++++ README.md | 8 ++-- docs/conf.py | 2 +- pyproject.toml | 2 +- tests/gui/conftest.py | 4 +- texasholdem/game/game.py | 4 +- 9 files changed, 56 insertions(+), 14 deletions(-) rename .github/workflows/{core-tests.yml => pytest.yml} (89%) create mode 100644 .github/workflows/windows-gui-tests.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 412022a..30abc66 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -35,7 +35,7 @@ jobs: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies - run: poetry install --no-interaction --no-root + run: poetry install --no-interaction if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: Analysing the code with pylint run: | diff --git a/.github/workflows/core-tests.yml b/.github/workflows/pytest.yml similarity index 89% rename from .github/workflows/core-tests.yml rename to .github/workflows/pytest.yml index 69cab01..e407828 100644 --- a/.github/workflows/core-tests.yml +++ b/.github/workflows/pytest.yml @@ -1,4 +1,4 @@ -name: Core Tests +name: Pytest on: push: @@ -35,7 +35,7 @@ jobs: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies - run: poetry install --no-interaction --no-root + run: poetry install --no-interaction if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: Run tests with pytest run: poetry run pytest --workers auto diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 60a46d6..3bfc1ba 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -35,7 +35,7 @@ jobs: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies - run: poetry install --no-interaction --no-root + run: poetry install --no-interaction if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: Build package run: poetry build diff --git a/.github/workflows/windows-gui-tests.yml b/.github/workflows/windows-gui-tests.yml new file mode 100644 index 0000000..116b0e3 --- /dev/null +++ b/.github/workflows/windows-gui-tests.yml @@ -0,0 +1,42 @@ +name: Windows GUI Tests + +on: + push: + branches: + - "main" + - "[0-9]+.[0-9]+" + pull_request: + branches: + - "main" + - "[0-9]+.[0-9]+" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install poetry + run: | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + - name: Load cached venv + id: cached-pip-wheels + uses: actions/cache@v2 + with: + path: ~/.cache + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + run: $HOME/.poetry/bin/poetry install --no-interaction + - name: Run tests with pytest + run: $HOME/.poetry/bin/poetry run pytest ./tests/gui/text_gui.py diff --git a/README.md b/README.md index e4dc951..ddcf77f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # texasholdem -![Core Tests Status](https://github.com/SirRender00/texasholdem/actions/workflows/core-tests.yml/badge.svg) +![Pytest Status](https://github.com/SirRender00/texasholdem/actions/workflows/pytest.yml/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://raw.githubusercontent.com/SirRender00/texasholdem/main/LICENSE) [![Documentation Status](https://readthedocs.org/projects/texasholdem/badge/?version=stable)](https://texasholdem.readthedocs.io/en/stable/?badge=stable) ![Pylint Status](https://github.com/SirRender00/texasholdem/actions/workflows/pylint.yml/badge.svg) -A python package for Texas Hold 'Em Poker, providing +A python package for Texas Hold 'Em Poker providing - Fast evaluation of hand strengths - Export & import human-readable game history - GUIs to view games and game history @@ -14,8 +14,8 @@ A python package for Texas Hold 'Em Poker, providing | Version Name | Latest Tag | Release Notes | Patch Notes | Documentation | Release Date | End Support Date | | ------------ | ---------- | ------------- | ----------- | ------------- | ------------ | ---------------- | -| 0.7 | v0.7.0 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.0) | [Documentation](https://texasholdem.readthedocs.io/en/0.7/) | 16 April 2022 | | -| 0.6 | v0.6.3 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.3) | [Documentation](https://texasholdem.readthedocs.io/en/0.6/) | 24 March 2022 | | +| 0.7 | v0.7.1 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.1) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.0) | [Documentation](https://texasholdem.readthedocs.io/en/0.7/) | 16 April 2022 | | +| 0.6 | v0.6.4 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.4) | [Documentation](https://texasholdem.readthedocs.io/en/0.6/) | 24 March 2022 | | | 0.5 | v0.5.2 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.5.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.5.2) | [Documentation](https://texasholdem.readthedocs.io/en/0.5/) | 21 March 2022 | | Current Roadmap \ diff --git a/docs/conf.py b/docs/conf.py index 8178b50..2f6fc3a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,7 +23,7 @@ author = 'Evyn Machi' # The full version, including alpha/beta/rc tags -release = 'v0.7.0' +release = 'v0.7.1' # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 155068e..d163ab7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "texasholdem" -version = "0.7.0" +version = "0.7.1" description = "A texasholdem python package" authors = ["Evyn Machi "] keywords = ['texasholdem', 'holdem', 'poker'] diff --git a/tests/gui/conftest.py b/tests/gui/conftest.py index 644f882..c5706b6 100644 --- a/tests/gui/conftest.py +++ b/tests/gui/conftest.py @@ -9,8 +9,8 @@ _SCREEN_SIZE = (100, 300) -BASIC_GUI_RUNS = 25 -COMPLETE_GUI_RUNS = 10 +BASIC_GUI_RUNS = 10 +COMPLETE_GUI_RUNS = 5 @pytest.fixture(scope='session') diff --git a/texasholdem/game/game.py b/texasholdem/game/game.py index 0026f70..c8ab803 100644 --- a/texasholdem/game/game.py +++ b/texasholdem/game/game.py @@ -586,14 +586,14 @@ def _settle(self): settle_history.pot_winners[i] = (pot.get_total_amount(), best_rank, winners) - win_amount = int((pot.get_total_amount()) / len(winners)) + win_amount = pot.get_total_amount() // len(winners) for player_id in winners: self.players[player_id].chips += win_amount # leftover chip goes to player left of the button WSOP Rule 73 leftover = pot.get_total_amount() - (win_amount * len(winners)) if leftover: - for j in self.in_pot_iter(loc=self.btn_loc): + for j in self.in_pot_iter(loc=self.btn_loc + 1): if j in winners: self.players[j].chips += leftover break