From 31b6c2f8c9483e87d48b36d904fcf0c89882da79 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 15:10:28 +0200 Subject: [PATCH 01/13] Explore action contexts --- .github/workflows/github_evennia_action.yml | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/github_evennia_action.yml b/.github/workflows/github_evennia_action.yml index 4ad8914985..40de021997 100644 --- a/.github/workflows/github_evennia_action.yml +++ b/.github/workflows/github_evennia_action.yml @@ -105,3 +105,31 @@ jobs: with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: ./testing_mygame/coverage.xml + + one: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump job context + env: + JOB_CONTEXT: ${{ toJson(job) }} + run: echo "$JOB_CONTEXT" + - name: Dump steps context + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + - name: Dump runner context + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "$RUNNER_CONTEXT" + - name: Dump strategy context + env: + STRATEGY_CONTEXT: ${{ toJson(strategy) }} + run: echo "$STRATEGY_CONTEXT" + - name: Dump matrix context + env: + MATRIX_CONTEXT: ${{ toJson(matrix) }} + run: echo "$MATRIX_CONTEXT" From 9666a7bfbbbfdc3b22f5b34068135be46e88f13c Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 16:25:18 +0200 Subject: [PATCH 02/13] Test doc-build action --- .../workflows/github_action_build_docs.yml | 45 +++++++++++++++++++ ...ction.yml => github_action_test_suite.yml} | 30 +------------ docs/Makefile | 2 +- 3 files changed, 48 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/github_action_build_docs.yml rename .github/workflows/{github_evennia_action.yml => github_action_test_suite.yml} (81%) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml new file mode 100644 index 0000000000..36ce83886e --- /dev/null +++ b/.github/workflows/github_action_build_docs.yml @@ -0,0 +1,45 @@ +# This github-Evennia workflow will build the docs. + +name: documentation + +on: + push: + branches: [ master, develop ] + paths: + - 'docs/source/**' + pull_request: + branches: [ master, develop ] + paths: + - 'docs/source/**' + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.7] + TESTING_DB: ['sqlite3'] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install package dependencies + run: | + python -m pip install --upgrade pip + cd docs/ + make install + + - name: Quick-test docs (no autodocs) + run: | + make quick + + - name: Deploy docs (only from master/develop branch) + if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'}} + run: | + echo "Would deploy here!" diff --git a/.github/workflows/github_evennia_action.yml b/.github/workflows/github_action_test_suite.yml similarity index 81% rename from .github/workflows/github_evennia_action.yml rename to .github/workflows/github_action_test_suite.yml index 40de021997..8a711c03a8 100644 --- a/.github/workflows/github_evennia_action.yml +++ b/.github/workflows/github_action_test_suite.yml @@ -6,6 +6,8 @@ name: test-suite on: push: branches: [ master, develop ] + paths-ignore: + - 'docs/source/**' pull_request: branches: [ master, develop ] @@ -105,31 +107,3 @@ jobs: with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: ./testing_mygame/coverage.xml - - one: - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Dump job context - env: - JOB_CONTEXT: ${{ toJson(job) }} - run: echo "$JOB_CONTEXT" - - name: Dump steps context - env: - STEPS_CONTEXT: ${{ toJson(steps) }} - run: echo "$STEPS_CONTEXT" - - name: Dump runner context - env: - RUNNER_CONTEXT: ${{ toJson(runner) }} - run: echo "$RUNNER_CONTEXT" - - name: Dump strategy context - env: - STRATEGY_CONTEXT: ${{ toJson(strategy) }} - run: echo "$STRATEGY_CONTEXT" - - name: Dump matrix context - env: - MATRIX_CONTEXT: ${{ toJson(matrix) }} - run: echo "$MATRIX_CONTEXT" diff --git a/docs/Makefile b/docs/Makefile index de813e0401..1433a6a6ec 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -56,7 +56,7 @@ _multiversion-check-env: _clean_api_index: rm source/api/* -# remove supervluous 'module' and 'package' text from api headers +# remove superfluos 'module' and 'package' text from api headers _reformat_apidoc_headers: for f in source/api/*.rst; do\ perl -pi -e 's/(module|package)$$// if $$. == 1' $$f ;\ From 33f93fab470f4ab246bc62fdeb8205d130503e14 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 16:27:28 +0200 Subject: [PATCH 03/13] Test change in docs/source for action pickup --- docs/source/index.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/source/index.md b/docs/source/index.md index 7b6a762a09..263e241e76 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -1,6 +1,3 @@ - - - # VERSION WARNING > This is the experimental static v0.9 documentation of Evennia, _automatically_ generated from the From 89ff97eedfd26af4b1b718cfc2ba753361f92d63 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 16:31:07 +0200 Subject: [PATCH 04/13] Fix doc-build action --- .github/workflows/github_action_build_docs.yml | 2 ++ docs/source/index.md | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index 36ce83886e..f7759bf550 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -37,9 +37,11 @@ jobs: - name: Quick-test docs (no autodocs) run: | + cd docs/ make quick - name: Deploy docs (only from master/develop branch) if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'}} run: | + cd docs/ echo "Would deploy here!" diff --git a/docs/source/index.md b/docs/source/index.md index 263e241e76..69d53b54b2 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -1,3 +1,4 @@ + # VERSION WARNING > This is the experimental static v0.9 documentation of Evennia, _automatically_ generated from the From 62cc8afc8cc2484592d4e9d4e6c38dff2f7d635e Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 17:04:35 +0200 Subject: [PATCH 05/13] Set up install for doc-build --- .github/workflows/github_action_build_docs.yml | 17 ++++++++++++++--- docs/Makefile | 1 - docs/source/index.md | 1 - 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index f7759bf550..11b4217e53 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -19,7 +19,6 @@ jobs: strategy: matrix: python-version: [3.7] - TESTING_DB: ['sqlite3'] steps: - uses: actions/checkout@v2 @@ -29,19 +28,31 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install package dependencies + - name: Install doc-building dependencies run: | python -m pip install --upgrade pip cd docs/ make install + # fail early here - name: Quick-test docs (no autodocs) + continue-on-error: true run: | cd docs/ make quick + # full game dir needed for mv-local + - name: Set up evennia game dir + run: | + pip install -e . + cd .. + evennia --init gamedir + cd gamedir + evennia migrate + - name: Deploy docs (only from master/develop branch) if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'}} run: | - cd docs/ + cd docs + make mv-local echo "Would deploy here!" diff --git a/docs/Makefile b/docs/Makefile index 1433a6a6ec..448f5a7a20 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -107,7 +107,6 @@ pdf: @echo "To see result, open evennia/docs/build/latex/evennia.pdf in a PDF reader." quick: - make _check-env make _quick-html-build $(FILES) @echo "" @echo "Documentation built (single version, no autodocs)." diff --git a/docs/source/index.md b/docs/source/index.md index 69d53b54b2..263e241e76 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -1,4 +1,3 @@ - # VERSION WARNING > This is the experimental static v0.9 documentation of Evennia, _automatically_ generated from the From ae751661393816b6c416b9c88e69efd3edaabb55 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 17:14:39 +0200 Subject: [PATCH 06/13] Add sphinx-theme dependence for docs --- docs/requirements.txt | 3 ++- docs/source/index.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 1d25af7679..fe5911a3a6 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,7 +2,8 @@ sphinx==2.4.4 sphinx-multiversion==0.1.1 -lunr==0.5.8 +sphinx-theme==1.0 +# lunr==0.5.8 # recommonmark custom branch with evennia-specific fixes git+https://github.com/evennia/recommonmark.git@evennia-mods#egg=recommonmark diff --git a/docs/source/index.md b/docs/source/index.md index 263e241e76..69d53b54b2 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -1,3 +1,4 @@ + # VERSION WARNING > This is the experimental static v0.9 documentation of Evennia, _automatically_ generated from the From d52e483baf22a3975fb3f16b6bebd56bc7f1b09a Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 17:24:21 +0200 Subject: [PATCH 07/13] Better filtering of build action --- .github/workflows/github_action_build_docs.yml | 6 ++++-- .github/workflows/github_action_test_suite.yml | 2 +- docs/source/conf.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index 11b4217e53..f7dbe49261 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -6,11 +6,11 @@ on: push: branches: [ master, develop ] paths: - - 'docs/source/**' + - 'docs/**' pull_request: branches: [ master, develop ] paths: - - 'docs/source/**' + - 'docs/**' jobs: build: @@ -53,6 +53,8 @@ jobs: - name: Deploy docs (only from master/develop branch) if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'}} run: | + git config --global user.email "docbuilder@evennia.com" + git config --global user.name "Doc builder mechanism" cd docs make mv-local echo "Would deploy here!" diff --git a/.github/workflows/github_action_test_suite.yml b/.github/workflows/github_action_test_suite.yml index 8a711c03a8..bcc65fb47d 100644 --- a/.github/workflows/github_action_test_suite.yml +++ b/.github/workflows/github_action_test_suite.yml @@ -7,7 +7,7 @@ on: push: branches: [ master, develop ] paths-ignore: - - 'docs/source/**' + - 'docs/**' pull_request: branches: [ master, develop ] diff --git a/docs/source/conf.py b/docs/source/conf.py index ead46f34a1..1f5e572128 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,7 +20,7 @@ author = "The Evennia developer community" # The full Evennia version covered by these docs, including alpha/beta/rc tags # This will be used for multi-version selection options. -release = "0.9.1" +release = "0.9.5" # -- General configuration --------------------------------------------------- @@ -316,7 +316,7 @@ def setup(app): # build toctree file sys.path.insert(1, os.path.join(os.path.dirname(os.path.dirname(__file__)), "docs")) - from docs.pylib import auto_link_remapper + from ..docs.pylib import auto_link_remapper auto_link_remapper.auto_link_remapper() print("Updated source/toc.md file") From a8a51234dd0e3970e8615ae0ccbc6b641cdcd34a Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 18:10:08 +0200 Subject: [PATCH 08/13] Test with sys.path --- docs/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1f5e572128..2d78f41928 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -316,7 +316,8 @@ def setup(app): # build toctree file sys.path.insert(1, os.path.join(os.path.dirname(os.path.dirname(__file__)), "docs")) - from ..docs.pylib import auto_link_remapper + print("sys.path:", sys.path) + from docs.pylib import auto_link_remapper auto_link_remapper.auto_link_remapper() print("Updated source/toc.md file") From d19f8ee6d0a88aa23b0439c188913720f88838af Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 18:13:57 +0200 Subject: [PATCH 09/13] Extend dirname for insert in path --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 2d78f41928..71434fde1e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -315,7 +315,7 @@ def setup(app): app.add_transform(AutoStructify) # build toctree file - sys.path.insert(1, os.path.join(os.path.dirname(os.path.dirname(__file__)), "docs")) + sys.path.insert(1, os.path.dirname(os.path.dirname(__file__))) print("sys.path:", sys.path) from docs.pylib import auto_link_remapper From 35d0988670cc41c82342d4f3a774dd36c4c5b3cc Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 18:19:36 +0200 Subject: [PATCH 10/13] Further tweak for quick build --- .github/workflows/github_action_build_docs.yml | 9 ++++----- docs/source/conf.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index f7dbe49261..d7f221d7c7 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -12,7 +12,7 @@ on: paths: - 'docs/**' -jobs: +jobs: build: runs-on: ubuntu-latest @@ -21,13 +21,13 @@ jobs: python-version: [3.7] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - + - name: Install doc-building dependencies run: | python -m pip install --upgrade pip @@ -36,10 +36,9 @@ jobs: # fail early here - name: Quick-test docs (no autodocs) - continue-on-error: true run: | cd docs/ - make quick + make quick # full game dir needed for mv-local - name: Set up evennia game dir diff --git a/docs/source/conf.py b/docs/source/conf.py index 71434fde1e..9486e82016 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -315,8 +315,8 @@ def setup(app): app.add_transform(AutoStructify) # build toctree file - sys.path.insert(1, os.path.dirname(os.path.dirname(__file__))) - print("sys.path:", sys.path) + sys.path.insert(1, os.path.join( + os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "docs")) from docs.pylib import auto_link_remapper auto_link_remapper.auto_link_remapper() From e620fa6893aa1b206a03ef41151ebf91aad24f05 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 18:25:23 +0200 Subject: [PATCH 11/13] Fix syspath --- .github/workflows/github_action_build_docs.yml | 1 + docs/source/conf.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index d7f221d7c7..a3e15f71cd 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -36,6 +36,7 @@ jobs: # fail early here - name: Quick-test docs (no autodocs) + continue-on-error: true run: | cd docs/ make quick diff --git a/docs/source/conf.py b/docs/source/conf.py index 9486e82016..be5275d5cc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -223,7 +223,7 @@ autodoc_default_options = { } autodoc_member_order = "bysource" -autodoc_typehints = "description" +# autodoc_typehints = "description" def autodoc_skip_member(app, what, name, obj, skip, options): @@ -315,8 +315,7 @@ def setup(app): app.add_transform(AutoStructify) # build toctree file - sys.path.insert(1, os.path.join( - os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "docs")) + sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) from docs.pylib import auto_link_remapper auto_link_remapper.auto_link_remapper() From d97e9b4e3dde52c15b6865114111496b290b626b Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 18:32:42 +0200 Subject: [PATCH 12/13] Fail early if warning in doc build --- .github/workflows/github_action_build_docs.yml | 5 ++--- docs/Makefile | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index a3e15f71cd..5b085b9f3b 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -34,12 +34,11 @@ jobs: cd docs/ make install - # fail early here + # fail early here, run quickstrict with aborts also on warnings - name: Quick-test docs (no autodocs) - continue-on-error: true run: | cd docs/ - make quick + make quickstrict # full game dir needed for mv-local - name: Set up evennia game dir diff --git a/docs/Makefile b/docs/Makefile index 448f5a7a20..759a78765c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -112,6 +112,10 @@ quick: @echo "Documentation built (single version, no autodocs)." @echo "To see result, open evennia/docs/build/html/index.html in a browser." +# abort on warnings too +quickstrict: + SPHINXOPTS=-W make quick + local: make _check-env make clean From 5666555864451f0e74a709123fc82396cf11fbfb Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 20 Sep 2020 11:11:17 +0200 Subject: [PATCH 13/13] Minor fix in tutorialworld --- evennia/contrib/tutorial_world/mob.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/evennia/contrib/tutorial_world/mob.py b/evennia/contrib/tutorial_world/mob.py index a6bc6e2387..730a9bbb04 100644 --- a/evennia/contrib/tutorial_world/mob.py +++ b/evennia/contrib/tutorial_world/mob.py @@ -377,6 +377,11 @@ class Mob(tut_objects.TutorialObject): attack_cmd = random.choice(("thrust", "pierce", "stab", "slash", "chop")) self.execute_cmd("%s %s" % (attack_cmd, target)) + if target.db.health is None: + # This is not an attackable target + logger.log_err(f"{self.key} found {target} had an `health` attribute of `None`.") + return + # analyze the current state if target.db.health <= 0: # we reduced the target to <= 0 health. Move them to the