diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index d23cb97..ccb7e84 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -10,11 +10,15 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + os: [ubuntu-latest, windows-latest, macOS-latest] fail-fast: false + defaults: + run: + shell: bash steps: - uses: actions/checkout@v2 diff --git a/htmltools/_core.py b/htmltools/_core.py index 3182ba1..9f52165 100644 --- a/htmltools/_core.py +++ b/htmltools/_core.py @@ -1,5 +1,6 @@ # pyright: reportMissingTypeStubs=false import os +import posixpath import shutil import sys import tempfile @@ -1091,7 +1092,8 @@ def source_path_map( href = self.name if include_version: href += "-" + str(self.version) - href = os.path.join(lib_prefix, href) if lib_prefix else href + if lib_prefix: + href = posixpath.join(lib_prefix, href) return {"source": source, "href": href} def as_html_tags( @@ -1122,7 +1124,7 @@ def as_dict( href = urllib.parse.quote(s["href"]) s.update( { - "href": os.path.join(paths["href"], href), + "href": posixpath.join(paths["href"], href), "rel": "stylesheet", } ) @@ -1130,7 +1132,7 @@ def as_dict( scripts = deepcopy(self.script) for s in scripts: src = urllib.parse.quote(s["src"]) - s.update({"src": os.path.join(paths["href"], src)}) + s.update({"src": posixpath.join(paths["href"], src)}) head: Optional[str] if self.head is None: