From 93f51d5e875211133baa6f20d9129b4dd37f08f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Alexandre=20C=C3=B4t=C3=A9?= Date: Thu, 10 Oct 2024 14:42:02 -0400 Subject: [PATCH] WIP --- .github/workflows/prerelease.yml | 51 ++++++++++++++++++-------------- .github/workflows/test_pypi.yml | 41 +++++++++++++++++++++++++ MANIFEST.in | 5 ++-- setup.sh | 8 ++--- textworld/version.py | 2 +- 5 files changed, 76 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/test_pypi.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 86af7ebe..ee1648ce 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -32,16 +32,16 @@ jobs: manylinux_image: manylinux2014 # MacOS x86_64 - - os: macos-12 + - os: macos-13 python: 39 platform_id: macosx_x86_64 - - os: macos-12 - python: 310 - platform_id: macosx_x86_64 - - os: macos-12 - python: 311 - platform_id: macosx_x86_64 - - os: macos-12 + # - os: macos-13 + # python: 310 + # platform_id: macosx_x86_64 + # - os: macos-13 + # python: 311 + # platform_id: macosx_x86_64 + - os: macos-13 python: 312 platform_id: macosx_x86_64 @@ -49,12 +49,12 @@ jobs: - os: macos-14 python: 39 platform_id: macosx_arm64 - - os: macos-14 - python: 310 - platform_id: macosx_arm64 - - os: macos-14 - python: 311 - platform_id: macosx_arm64 + # - os: macos-14 + # python: 310 + # platform_id: macosx_arm64 + # - os: macos-14 + # python: 311 + # platform_id: macosx_arm64 - os: macos-14 python: 312 platform_id: macosx_arm64 @@ -68,13 +68,6 @@ jobs: with: python-version: "3.12" - - name: Install dependencies on macos - if: startsWith(matrix.os, 'macos') - run: | - brew install glkclient - brew install glkview - brew install zoomview - - name: Install cibuildwheel run: python -m pip install cibuildwheel @@ -140,11 +133,14 @@ jobs: merge-multiple: true - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true test: needs: release runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest] python: ['3.9', '3.10', '3.11', '3.12'] @@ -154,7 +150,16 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install dependencies + + - name: Install dependencies (Linux) + run: sudo apt update && sudo apt install -y --no-install-recommends graphviz + if: startsWith(matrix.os, 'ubuntu') + + - name: Install dependencies (MacOS) + run: brew install graphviz + if: startsWith(matrix.os, 'macos') + + - name: Install TextWorld run: | python -m pip install --upgrade pip pip install pytest pytest-azurepipelines pytest-cov @@ -162,7 +167,7 @@ jobs: - name: Run tests run: | pytest --durations=10 --junitxml=junit/test-results.xml --cov=textworld --cov-report=xml --cov-report=html tests/ textworld/ - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: test-results path: junit/test-results.xml diff --git a/.github/workflows/test_pypi.yml b/.github/workflows/test_pypi.yml new file mode 100644 index 00000000..8a2495fb --- /dev/null +++ b/.github/workflows/test_pypi.yml @@ -0,0 +1,41 @@ +name: "Test from PyPi" + +# Trigger the create release workflow +on: + workflow_dispatch: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + python: ['3.9', '3.10', '3.11', '3.12'] + steps: + - uses: actions/checkout@v4 + - name: Use Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies (Linux) + run: sudo apt update && sudo apt install -y --no-install-recommends graphviz + if: startsWith(matrix.os, 'ubuntu') + + - name: Install dependencies (MacOS) + run: brew install graphviz + if: startsWith(matrix.os, 'macos') + + - name: Install TextWorld + run: | + python -m pip install --upgrade pip + pip install pytest pytest-azurepipelines pytest-cov + pip install --pre textworld[full] + - name: Run tests + run: | + pytest --durations=10 --junitxml=junit/test-results.xml --cov=textworld --cov-report=xml --cov-report=html tests/ textworld/ + - uses: actions/upload-artifact@v4 + with: + name: test-results + path: junit/test-results.xml diff --git a/MANIFEST.in b/MANIFEST.in index c16f3221..c6b9ab2b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -25,10 +25,9 @@ recursive-include textworld/render/tmpl * recursive-include textworld/thirdparty/glulx * recursive-include textworld/thirdparty/inform7 * -recursive-include textworld/thirdparty/inform7-6M62/bin * -recursive-include textworld/thirdparty/inform7-6M62/share/inform7/Compilers * +include textworld/thirdparty/inform7-6M62/share/inform7/Compilers/inform6 +include textworld/thirdparty/inform7-6M62/share/inform7/Compilers/ni recursive-include textworld/thirdparty/inform7-6M62/share/inform7/Internal * -recursive-include textworld/thirdparty/inform7-6M62/share/inform7/Interpreters * global-exclude *.o *.a global-exclude */__pycache__/* diff --git a/setup.sh b/setup.sh index 68ce2cae..4bbae39b 100755 --- a/setup.sh +++ b/setup.sh @@ -55,10 +55,10 @@ if [ "${machine}" == 'Mac' ] && [ -e inform7-6M62 ]; then current_dir="$(pwd)" cd /Volumes/Inform/Inform.app/Contents/MacOS mkdir -p "$current_dir/inform7-6M62/share/inform7/Compilers/" - mkdir -p "$current_dir/inform7-6M62/share/inform7/Interpreters/" - cp cBlorb inform6 Inform intest ni "$current_dir/inform7-6M62/share/inform7/Compilers/" - cp ./git* "$current_dir/inform7-6M62/share/inform7/Interpreters/dumb-git" - cp ./glulxe* "$current_dir/inform7-6M62/share/inform7/Interpreters/dumb-glulxe" + # mkdir -p "$current_dir/inform7-6M62/share/inform7/Interpreters/" + cp inform6 ni "$current_dir/inform7-6M62/share/inform7/Compilers/" + # cp ./git* "$current_dir/inform7-6M62/share/inform7/Interpreters/dumb-git" + # cp ./glulxe* "$current_dir/inform7-6M62/share/inform7/Interpreters/dumb-glulxe" cd "$current_dir" diff --git a/textworld/version.py b/textworld/version.py index dd74ba88..886a5e53 100644 --- a/textworld/version.py +++ b/textworld/version.py @@ -1 +1 @@ -__version__ = '1.6.2rc2' +__version__ = '1.6.2rc4'