Skip to content

Commit

Permalink
Fixing minet.__future__ not being a proper module
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Nov 2, 2023
1 parent 3c26e8b commit 5baf4e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions hooks/hook-minet.cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import List, Tuple

import re
import playwright_stealth
import trafilatura
Expand All @@ -8,7 +10,7 @@

SLASH_RE = re.compile(r"[\/\\]")

hiddenimports = []
hiddenimports = ["minet.__future__", "mine.__future__.threaded_child_watcher"]

for p in iglob("minet/cli/**/*.py", recursive=True):
if "__main__" in p:
Expand All @@ -24,7 +26,7 @@
hiddenimports.extend(collect_submodules("pkg_resources"))
hiddenimports.append("charset_normalizer.md__mypyc")

datas = [
datas: List[Tuple[str, str]] = [
(join(dirname(trafilatura.__file__), "settings.cfg"), "trafilatura"),
]

Expand Down
Empty file added minet/__future__/__init__.py
Empty file.
3 changes: 2 additions & 1 deletion minet/browser/threadsafe_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from threading import Thread, Event, Lock
from playwright.async_api import async_playwright, Browser, BrowserContext

from minet.__future__.threaded_child_watcher import ThreadedChildWatcher
from minet.exceptions import UnknownBrowserError
from minet.browser.plawright_shim import install_browser
from minet.browser.utils import get_browsers_path, get_temp_persistent_context_path
Expand Down Expand Up @@ -70,6 +69,8 @@ def __init__(
# NOTE: on unix python 3.7, child watching does not
# work properly when asyncio is not running from the main thread
if UNIX and LTE_PY37:
from minet.__future__.threaded_child_watcher import ThreadedChildWatcher

asyncio.set_child_watcher(ThreadedChildWatcher())

self.browser_name: str = browser
Expand Down

0 comments on commit 5baf4e0

Please sign in to comment.