2 Commits
0.2.0 ... 0.2.1

Author SHA1 Message Date
bashonly
25b77b7310 Fix encoding for Windows (#22) 2025-10-24 13:33:13 +13:00
bashonly
57fe708cf4 Do not run CI on tag pushes (#21) 2025-10-23 22:18:55 +00:00
2 changed files with 19 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
name: CI
on:
push:
branches:
- '**'
paths-ignore:
- 'README.md'
- 'LICENSE'
@@ -69,10 +71,11 @@ jobs:
python_tests:
name: Python tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', pypy-3.11]
steps:
- uses: actions/checkout@v5
@@ -91,7 +94,15 @@ jobs:
# `pip install -e` omits the force-included JS, so use `build` instead
python -m pip install -U build
python -m build
- name: Unpack wheel (Linux)
if: matrix.runner == 'ubuntu-latest'
run: |
unzip -u dist/yt_dlp_ejs-*.whl "yt_dlp_ejs/*"
- name: Unpack wheel (Windows)
if: matrix.runner == 'windows-latest'
shell: pwsh
run: |
Expand-Archive -Path dist/yt_dlp_ejs-*.whl -DestinationPath ./ -Force
- name: Run Python tests
timeout-minutes: 5
run: |
@@ -352,6 +363,7 @@ jobs:
- ruff-lint
- prettier
- eslint
- python_tests
- deno_build
- deno_tests
- bun_build

View File

@@ -7,11 +7,15 @@ def core() -> str:
"""
Read the contents of the JavaScript core solver bundle as string.
"""
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "core.min.js").read_text()
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "core.min.js").read_text(
encoding="utf-8"
)
def lib() -> str:
"""
Read the contents of the JavaScript library solver bundle as string.
"""
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "lib.min.js").read_text()
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "lib.min.js").read_text(
encoding="utf-8"
)