From b553095f0d2a22bcb228a59cfb4627047a3b02bc Mon Sep 17 00:00:00 2001 From: v01d Date: Mon, 16 Jun 2025 01:48:49 +0400 Subject: [PATCH 1/5] Init --- eel/__init__.py | 12 +++++++++--- requirements.txt | 1 + tox.ini | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/eel/__init__.py b/eel/__init__.py index e1ab255b..34fc7ce1 100644 --- a/eel/__init__.py +++ b/eel/__init__.py @@ -18,14 +18,20 @@ import pyparsing as pp import random as rnd import sys -import pkg_resources as pkg +import importlib_resources import socket import mimetypes mimetypes.add_type('application/javascript', '.js') -_eel_js_file: str = pkg.resource_filename('eel', 'eel.js') -_eel_js: str = open(_eel_js_file, encoding='utf-8').read() + +# https://setuptools.pypa.io/en/latest/pkg_resources.html +# Use of pkg_resources is deprecated in favor of importlib.resources +# Migration guide: https://importlib-resources.readthedocs.io/en/latest/migration.html +_eel_js_reference = importlib_resources.files('eel') / 'eel.js' +with importlib_resources.as_file(_eel_js_reference) as _eel_js_path: + _eel_js: str = _eel_js_path.read_text(encoding='utf-8') + _websockets: List[Tuple[Any, WebSocketT]] = [] _call_return_values: Dict[Any, Any] = {} _call_return_callbacks: Dict[float, Tuple[Callable[..., Any], Optional[Callable[..., Any]]]] = {} diff --git a/requirements.txt b/requirements.txt index 3150cc01..77d8646e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ gevent-websocket<1.0.0 greenlet>=1.0.0,<2.0.0 pyparsing>=3.0.0,<4.0.0 typing-extensions>=4.3.0 +importlib_resources>=1.3 diff --git a/tox.ini b/tox.ini index 272bb77e..0d3838e4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = typecheck,py{37,38,39,310,311,312} +envlist = typecheck,py{37,38,39,310,311,312,313} [pytest] timeout = 30 @@ -12,6 +12,7 @@ python = 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 [testenv] From 1fac1a869401fb9b7926a1e44ce2dde8b04771b6 Mon Sep 17 00:00:00 2001 From: v01d Date: Wed, 18 Jun 2025 01:46:32 +0400 Subject: [PATCH 2/5] Update requirements-test.txt --- requirements-test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-test.txt b/requirements-test.txt index 4ee6b5dc..ec2da232 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -8,3 +8,4 @@ webdriver_manager>=4.0.0,<5.0.0 mypy>=1.0.0,<2.0.0 pyinstaller types-setuptools +importlib_resources>=1.3 From de7bed868413595f7376fdb7c3ade31707b81dcc Mon Sep 17 00:00:00 2001 From: v01d Date: Thu, 19 Jun 2025 14:47:32 +0400 Subject: [PATCH 3/5] Upd --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43a0e619..1c302518 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-latest, macos-latest] + os: [ubuntu-24.04, windows-latest, macos-latest] python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] exclude: - os: macos-latest From 4921b0ea332451edcb571901ce3103e60adcdf7c Mon Sep 17 00:00:00 2001 From: v01d Date: Thu, 19 Jun 2025 19:42:26 +0400 Subject: [PATCH 4/5] No Python37 for Ubuntu-24.04 --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c302518..3ae373a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,8 @@ jobs: exclude: - os: macos-latest python-version: 3.7 + - os: ubuntu-24.04 + python-version: 3.7 runs-on: ${{ matrix.os }} From a5df09ffbbd1653c7a6f8e8a4264279cb5da397a Mon Sep 17 00:00:00 2001 From: v01d Date: Sun, 22 Jun 2025 15:09:21 +0400 Subject: [PATCH 5/5] Upd --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e25f54dd..4b5f3e5e 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ package_data={ 'eel': ['eel.js', 'py.typed'], }, - install_requires=['bottle', 'bottle-websocket', 'future', 'pyparsing', 'typing_extensions'], + install_requires=['bottle', 'bottle-websocket', 'future', 'pyparsing', 'typing_extensions', 'importlib_resources'], extras_require={ "jinja2": ['jinja2>=2.10'] },