ntno / mkdocs-terminal

monospace theme for MkDocs
https://ntno.github.io/mkdocs-terminal/
MIT License
97 stars 3 forks source link

could not load libtidy --- can't run pytests on windows-latest github action runner #59

Open ntno opened 1 year ago

ntno commented 1 year ago

Description

when pytests run on windows-latest github action runner i get the following error:


self = <tidylib.tidy.Tidy object at 0x00000200870C3070>
lib_names = ['libtidy', 'libtidy.so', 'libtidy-0.99.so.0', 'cygtidy-0-99-0', 'tidylib', 'libtidy.dylib', ...]

    def __init__(self, lib_names=None):
        self._tidy = None
        if lib_names is None:
            lib_names = ctypes.util.find_library('tidy') or LIB_NAMES
        if isinstance(lib_names, str):
            lib_names = [lib_names]
        for name in lib_names:
            try:
                self._tidy = load_library(name)
                break
            except OSError:
                continue
        if self._tidy is None:
>           raise OSError(
                "Could not load libtidy using any of these names: "
                + ",".join(lib_names))
E           OSError: Could not load libtidy using any of these names: libtidy,libtidy.so,libtidy-0.99.so.0,cygtidy-0-99-0,tidylib,libtidy.dylib,tidy

.tox\py\lib\site-packages\tidylib\tidy.py:97: OSError

(see attached for full log)

Reproduction

install tidy with soop:

      - if: ${{ matrix.platform == 'windows-latest' }}
        name: Install scoop (Windows)
        uses: MinoruSekine/setup-scoop@main
        with: 
          scoop_update: false
      - if: ${{ matrix.platform == 'windows-latest' }}
        name: Install test requirements (windows)
        run: |
          scoop install tidy

then run pytest from tox.ini:

commands = 
    pytest {tty:--color=yes} tests {posargs}

References

58

https://github.com/countergram/pytidylib/pull/33

Environment

from scoop install:

Installing 'tidy' (5.8.0) [64bit] from main bucket
Downloading https://github.com/htacg/tidy-html5/releases/download/5.8.0/tidy-5.8.0-win64.zip (1.3 MB)...
Checking hash of tidy-5.8.0-win64.zip ... ok.
Extracting tidy-5.8.0-win64.zip ... done.
Linking ~\scoop\apps\tidy\current => ~\scoop\apps\tidy\5.8.0
Creating shim for 'tidy'.
'tidy' (5.8.0) was installed successfully!
HTML Tidy for Windows version 5.8.0
ntno commented 1 year ago

6_test (3.8, windows-latest).txt