diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..40db436d --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,22 @@ +name: docs +on: + push: + branches: + - freshen # TODO, move to main when done +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install hatch hatch-mkdocs + - run: hatch -vv run docs:gh-deploy --force diff --git a/pyproject.toml b/pyproject.toml index e68dbf41..0d6b5cd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ build-backend = "hatchling.build" # TODOs: # make sure alpine and mac and win32 build -# make sure `hatch run docs:gh-deploy` works # fix up re-commit.yaml # check code for more TODOs @@ -63,9 +62,7 @@ dependencies = [ path = "mkdocs.yml" [tool.hatch.envs.docs] -# docs require the project to be installed, so that mkdocstrings can infer the -# API docs by reflecting on the Python module: -detached = false +detached = true dependencies = [ "mdformat", diff --git a/src/py_mini_racer/py_mini_racer.py b/src/py_mini_racer/py_mini_racer.py index 5b6297e7..b7411936 100644 --- a/src/py_mini_racer/py_mini_racer.py +++ b/src/py_mini_racer/py_mini_racer.py @@ -38,7 +38,7 @@ def _get_lib_path(name): # In python 3 the extension file name depends on the python version EXTENSION_PATH = _get_lib_path("mini_racer") -EXTENSION_NAME = basename(EXTENSION_PATH) if EXTENSION_PATH is not None else None +EXTENSION_NAME = None if EXTENSION_PATH is None else basename(EXTENSION_PATH) class MiniRacerBaseException(Exception): # noqa: N818