diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..b706ed1 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,36 @@ +name: publish-package + +on: + release: + types: [published] + +jobs: + ghcr: + runs-on: ubuntu-latest + steps: + - name: Set meta info + id: set-meta + run: | + echo ::set-output name=tag::${GITHUB_REF#refs/*/} + echo ::set-output name=repo::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.2.1 + with: + install: true + - name: Log in to GHCR + uses: docker/login-action@v2.1.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build Image and Push to GHCR + uses: docker/build-push-action@v3.2.0 + with: + file: ./docker/Dockerfile + pull: true + push: true + labels: | + org.opencontainers.image.source=https://github.com/${{ github.repository }} + tags: | + ghcr.io/${{ steps.set-meta.outputs.repo }}:latest + ghcr.io/${{ steps.set-meta.outputs.repo }}:${{ steps.set-meta.outputs.tag }} diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..f61d8d8 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,15 @@ +FROM ghcr.io/joshkarpel/spiel:v0.4.2 + +RUN : \ + && apt-get update \ + && apt-get install -y libasound2-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && : + +WORKDIR /app + +COPY .. /app/pytest-its-whats-for-testing +RUN pip install --no-cache-dir /app/pytest-its-whats-for-testing + +CMD ["spiel", "present", "pytest-its-whats-for-testing/pytest_its_whats_for_testing/slides.py"] diff --git a/docker/test.sh b/docker/test.sh new file mode 100755 index 0000000..161a034 --- /dev/null +++ b/docker/test.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -eux + +TAG="pytest-its-whats-for-testing:test" + +docker build -f docker/Dockerfile -t "$TAG" . +docker run -it --rm "$TAG" $@ diff --git a/poetry.lock b/poetry.lock index 2c8bfda..c3b9b24 100644 --- a/poetry.lock +++ b/poetry.lock @@ -152,14 +152,11 @@ python-versions = "*" [[package]] name = "packaging" -version = "21.3" +version = "22.0" description = "Core utilities for Python packages" category = "main" optional = false -python-versions = ">=3.6" - -[package.dependencies] -pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" +python-versions = ">=3.7" [[package]] name = "pillow" @@ -196,17 +193,6 @@ python-versions = ">=3.6" [package.extras] plugins = ["importlib-metadata"] -[[package]] -name = "pyparsing" -version = "3.0.9" -description = "pyparsing module - Classes and methods to define and execute parsing grammars" -category = "main" -optional = false -python-versions = ">=3.6.8" - -[package.extras] -diagrams = ["jinja2", "railroad-diagrams"] - [[package]] name = "pytest" version = "7.2.0" @@ -310,7 +296,7 @@ python-versions = "*" [[package]] name = "spiel" -version = "0.4.1" +version = "0.4.2" description = "A framework for building and presenting richly-styled presentations in your terminal using Python." category = "main" optional = false @@ -390,7 +376,7 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "532100ce07fe3064d5ec750770f59736d535688d4965fa69376d75fd9905c310" +content-hash = "9183412f4e3ab49bb2c68d4b4be62b924a54b9a5d6a48de51748c7b32f0b5c38" [metadata.files] anyio = [ @@ -442,8 +428,8 @@ nanoid = [ {file = "nanoid-2.0.0.tar.gz", hash = "sha256:5a80cad5e9c6e9ae3a41fa2fb34ae189f7cb420b2a5d8f82bd9d23466e4efa68"}, ] packaging = [ - {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, - {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, + {file = "packaging-22.0-py3-none-any.whl", hash = "sha256:957e2148ba0e1a3b282772e791ef1d8083648bc131c8ab0c1feba110ce1146c3"}, + {file = "packaging-22.0.tar.gz", hash = "sha256:2198ec20bd4c017b8f9717e00f0c8714076fc2fd93816750ab48e2c41de2cfd3"}, ] pillow = [ {file = "Pillow-9.3.0-1-cp37-cp37m-win32.whl", hash = "sha256:e6ea6b856a74d560d9326c0f5895ef8050126acfdc7ca08ad703eb0081e82b74"}, @@ -516,10 +502,6 @@ pygments = [ {file = "Pygments-2.13.0-py3-none-any.whl", hash = "sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42"}, {file = "Pygments-2.13.0.tar.gz", hash = "sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1"}, ] -pyparsing = [ - {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, - {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, -] pytest = [ {file = "pytest-7.2.0-py3-none-any.whl", hash = "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71"}, {file = "pytest-7.2.0.tar.gz", hash = "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59"}, @@ -558,8 +540,8 @@ sortedcontainers = [ {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, ] spiel = [ - {file = "spiel-0.4.1-py3-none-any.whl", hash = "sha256:335d0e2b643e97dc02f3a3a92fa0d4d8ea6ebd130946a2ac2d563544d1573988"}, - {file = "spiel-0.4.1.tar.gz", hash = "sha256:7e42946e762b336d576a19ff8ed154d7fc8d806239eb2cdff343078c33f159fe"}, + {file = "spiel-0.4.2-py3-none-any.whl", hash = "sha256:76d4e63023ae636424d4fa7e5d5816104ef36ce5aea94e2cc5ea50278db8ad47"}, + {file = "spiel-0.4.2.tar.gz", hash = "sha256:45f0af2f046d20284a71e48e24eba973d2de80b6bd115db3d8c239b941bef101"}, ] textual = [ {file = "textual-0.4.0-py3-none-any.whl", hash = "sha256:10aac2d244ef4a5aef89a38f9088382a5ce6914cec953d40a9527d729c300f53"}, diff --git a/pyproject.toml b/pyproject.toml index 9afc21d..a5155dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.1.0" description = "" authors = ["Josh Karpel "] readme = "README.md" -packages = [{include = "pytest_its_whats_for_testing"}] +include = ["images/*", "sounds/*"] [tool.poetry.dependencies] python = "^3.10" @@ -13,7 +13,7 @@ pytest-mock = "^3.10.0" pytest-timeout = "^2.1.0" pytest-xdist = "^3.0.2" simpleaudio = "^1.0.4" -spiel = "==0.4.1" +spiel = "==0.4.2" hypothesis = "^6.60.0" [build-system] diff --git a/talk/__init__.py b/pytest_its_whats_for_testing/__init__.py similarity index 100% rename from talk/__init__.py rename to pytest_its_whats_for_testing/__init__.py diff --git a/talk/examples/__init__.py b/pytest_its_whats_for_testing/examples/__init__.py similarity index 100% rename from talk/examples/__init__.py rename to pytest_its_whats_for_testing/examples/__init__.py diff --git a/talk/examples/assertions/__init__.py b/pytest_its_whats_for_testing/examples/assertions/__init__.py similarity index 100% rename from talk/examples/assertions/__init__.py rename to pytest_its_whats_for_testing/examples/assertions/__init__.py diff --git a/talk/examples/assertions/ex_1.py b/pytest_its_whats_for_testing/examples/assertions/ex_1.py similarity index 100% rename from talk/examples/assertions/ex_1.py rename to pytest_its_whats_for_testing/examples/assertions/ex_1.py diff --git a/talk/examples/assertions/ex_2.py b/pytest_its_whats_for_testing/examples/assertions/ex_2.py similarity index 100% rename from talk/examples/assertions/ex_2.py rename to pytest_its_whats_for_testing/examples/assertions/ex_2.py diff --git a/talk/examples/assertions/ex_3.py b/pytest_its_whats_for_testing/examples/assertions/ex_3.py similarity index 100% rename from talk/examples/assertions/ex_3.py rename to pytest_its_whats_for_testing/examples/assertions/ex_3.py diff --git a/talk/examples/fixtures/__init__.py b/pytest_its_whats_for_testing/examples/fixtures/__init__.py similarity index 100% rename from talk/examples/fixtures/__init__.py rename to pytest_its_whats_for_testing/examples/fixtures/__init__.py diff --git a/talk/examples/fixtures/conftest.py b/pytest_its_whats_for_testing/examples/fixtures/conftest.py similarity index 100% rename from talk/examples/fixtures/conftest.py rename to pytest_its_whats_for_testing/examples/fixtures/conftest.py diff --git a/talk/examples/fixtures/ex_1.py b/pytest_its_whats_for_testing/examples/fixtures/ex_1.py similarity index 100% rename from talk/examples/fixtures/ex_1.py rename to pytest_its_whats_for_testing/examples/fixtures/ex_1.py diff --git a/talk/examples/fixtures/ex_2.py b/pytest_its_whats_for_testing/examples/fixtures/ex_2.py similarity index 100% rename from talk/examples/fixtures/ex_2.py rename to pytest_its_whats_for_testing/examples/fixtures/ex_2.py diff --git a/talk/examples/fixtures/ex_3.py b/pytest_its_whats_for_testing/examples/fixtures/ex_3.py similarity index 100% rename from talk/examples/fixtures/ex_3.py rename to pytest_its_whats_for_testing/examples/fixtures/ex_3.py diff --git a/talk/examples/fixtures/ex_4.py b/pytest_its_whats_for_testing/examples/fixtures/ex_4.py similarity index 100% rename from talk/examples/fixtures/ex_4.py rename to pytest_its_whats_for_testing/examples/fixtures/ex_4.py diff --git a/talk/examples/fixtures/ex_5.py b/pytest_its_whats_for_testing/examples/fixtures/ex_5.py similarity index 100% rename from talk/examples/fixtures/ex_5.py rename to pytest_its_whats_for_testing/examples/fixtures/ex_5.py diff --git a/talk/examples/fixtures/ex_6.py b/pytest_its_whats_for_testing/examples/fixtures/ex_6.py similarity index 100% rename from talk/examples/fixtures/ex_6.py rename to pytest_its_whats_for_testing/examples/fixtures/ex_6.py diff --git a/talk/examples/hooks/__init__.py b/pytest_its_whats_for_testing/examples/hooks/__init__.py similarity index 100% rename from talk/examples/hooks/__init__.py rename to pytest_its_whats_for_testing/examples/hooks/__init__.py diff --git a/talk/examples/hooks/conftest.py b/pytest_its_whats_for_testing/examples/hooks/conftest.py similarity index 100% rename from talk/examples/hooks/conftest.py rename to pytest_its_whats_for_testing/examples/hooks/conftest.py diff --git a/talk/examples/hooks/ex_1.py b/pytest_its_whats_for_testing/examples/hooks/ex_1.py similarity index 100% rename from talk/examples/hooks/ex_1.py rename to pytest_its_whats_for_testing/examples/hooks/ex_1.py diff --git a/talk/examples/hooks/ex_2.py b/pytest_its_whats_for_testing/examples/hooks/ex_2.py similarity index 100% rename from talk/examples/hooks/ex_2.py rename to pytest_its_whats_for_testing/examples/hooks/ex_2.py diff --git a/talk/examples/parametrization/__init__.py b/pytest_its_whats_for_testing/examples/parametrization/__init__.py similarity index 100% rename from talk/examples/parametrization/__init__.py rename to pytest_its_whats_for_testing/examples/parametrization/__init__.py diff --git a/talk/examples/parametrization/ex_1a.py b/pytest_its_whats_for_testing/examples/parametrization/ex_1a.py similarity index 100% rename from talk/examples/parametrization/ex_1a.py rename to pytest_its_whats_for_testing/examples/parametrization/ex_1a.py diff --git a/talk/examples/parametrization/ex_1b.py b/pytest_its_whats_for_testing/examples/parametrization/ex_1b.py similarity index 100% rename from talk/examples/parametrization/ex_1b.py rename to pytest_its_whats_for_testing/examples/parametrization/ex_1b.py diff --git a/talk/examples/parametrization/ex_2.py b/pytest_its_whats_for_testing/examples/parametrization/ex_2.py similarity index 100% rename from talk/examples/parametrization/ex_2.py rename to pytest_its_whats_for_testing/examples/parametrization/ex_2.py diff --git a/talk/examples/parametrization/ex_3.py b/pytest_its_whats_for_testing/examples/parametrization/ex_3.py similarity index 100% rename from talk/examples/parametrization/ex_3.py rename to pytest_its_whats_for_testing/examples/parametrization/ex_3.py diff --git a/talk/examples/parametrization/ex_4.py b/pytest_its_whats_for_testing/examples/parametrization/ex_4.py similarity index 100% rename from talk/examples/parametrization/ex_4.py rename to pytest_its_whats_for_testing/examples/parametrization/ex_4.py diff --git a/talk/examples/parametrization/ex_5.py b/pytest_its_whats_for_testing/examples/parametrization/ex_5.py similarity index 100% rename from talk/examples/parametrization/ex_5.py rename to pytest_its_whats_for_testing/examples/parametrization/ex_5.py diff --git a/talk/examples/plugins/__init__.py b/pytest_its_whats_for_testing/examples/plugins/__init__.py similarity index 100% rename from talk/examples/plugins/__init__.py rename to pytest_its_whats_for_testing/examples/plugins/__init__.py diff --git a/talk/examples/plugins/ex_1.py b/pytest_its_whats_for_testing/examples/plugins/ex_1.py similarity index 100% rename from talk/examples/plugins/ex_1.py rename to pytest_its_whats_for_testing/examples/plugins/ex_1.py diff --git a/talk/examples/plugins/ex_2.py b/pytest_its_whats_for_testing/examples/plugins/ex_2.py similarity index 100% rename from talk/examples/plugins/ex_2.py rename to pytest_its_whats_for_testing/examples/plugins/ex_2.py diff --git a/talk/examples/plugins/ex_3.py b/pytest_its_whats_for_testing/examples/plugins/ex_3.py similarity index 100% rename from talk/examples/plugins/ex_3.py rename to pytest_its_whats_for_testing/examples/plugins/ex_3.py diff --git a/talk/examples/plugins/ex_4.py b/pytest_its_whats_for_testing/examples/plugins/ex_4.py similarity index 100% rename from talk/examples/plugins/ex_4.py rename to pytest_its_whats_for_testing/examples/plugins/ex_4.py diff --git a/talk/images/logo.png b/pytest_its_whats_for_testing/images/logo.png similarity index 100% rename from talk/images/logo.png rename to pytest_its_whats_for_testing/images/logo.png diff --git a/talk/slides.py b/pytest_its_whats_for_testing/slides.py similarity index 99% rename from talk/slides.py rename to pytest_its_whats_for_testing/slides.py index 8d95fb1..9c28d55 100644 --- a/talk/slides.py +++ b/pytest_its_whats_for_testing/slides.py @@ -17,7 +17,7 @@ from rich.table import Table from rich.text import Text from simpleaudio import WaveObject -from spiel import Slide, Triggers +from spiel import Slide, Triggers, present from spiel.deck import Deck from spiel.renderables.image import Image @@ -432,3 +432,7 @@ def what_next(): ), vertical="middle", ) + + +if __name__ == "__main__": + present(__file__) diff --git a/talk/sounds/dun_dun.wav b/pytest_its_whats_for_testing/sounds/dun_dun.wav similarity index 100% rename from talk/sounds/dun_dun.wav rename to pytest_its_whats_for_testing/sounds/dun_dun.wav diff --git a/talk/examples/assertions/util.py b/talk/examples/assertions/util.py deleted file mode 100644 index c84d0dd..0000000 --- a/talk/examples/assertions/util.py +++ /dev/null @@ -1,10 +0,0 @@ -import marshal -import struct -import time - - -def code_from_pyc(file): - f = open(file, "rb") - magic = f.read(12) - code = marshal.load(f) - return code