webtools-cli 1.2.4__tar.gz → 1.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webtools-cli
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: Advanced Web Intelligence & Scraping Toolkit with CLI and Web UI
5
5
  Author: Abhinav Adarsh
6
6
  License-Expression: MIT
@@ -30,7 +30,7 @@ Requires-Dist: mtranslate
30
30
  Requires-Dist: colorama
31
31
  Requires-Dist: playwright
32
32
  Requires-Dist: pycryptodome
33
- Requires-Dist: tenacity>=8.2.3
33
+ Requires-Dist: tenacity<9.0.0,>=8.2.3
34
34
  Requires-Dist: pyreadline3; platform_system == "Windows"
35
35
  Provides-Extra: playwright
36
36
  Requires-Dist: playwright; extra == "playwright"
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "webtools-cli"
7
- version = "1.2.4"
7
+ version = "1.2.5"
8
8
  description = "Advanced Web Intelligence & Scraping Toolkit with CLI and Web UI"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -37,7 +37,7 @@ dependencies = [
37
37
  "colorama",
38
38
  "playwright",
39
39
  "pycryptodome",
40
- "tenacity>=8.2.3",
40
+ "tenacity>=8.2.3,<9.0.0",
41
41
  "pyreadline3; platform_system == 'Windows'",
42
42
  ]
43
43
 
@@ -9,57 +9,60 @@ if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
9
9
 
10
10
  # --- AUTO-INSTALLER FOR MISSING/BROKEN DEPENDENCIES ---
11
11
  def ensure_dependencies():
12
- """Checks and performs a forced clean install of dependencies at runtime"""
13
- # Dependencies that must be imported successfully
14
- # Format: module_name -> (pip_package_name, min_version_prefix, forced_upgrade)
15
- check_deps = {
16
- "mega": ("mega.py", None, False),
17
- "Crypto": ("pycryptodome", None, True), # Always ensure pycryptodome over pycrypto
18
- "tenacity": ("tenacity>=8.2.3", "8", True)
12
+ """Performs an aggressive forced repair of the environment if issues are detected"""
13
+ # Dependencies to verify (module_name -> (pip_pkg, min_v, max_v))
14
+ mandatory = {
15
+ "mega": ("mega.py", None, None),
16
+ "Crypto": ("pycryptodome", None, None),
17
+ "tenacity": ("tenacity>=8.2.3,<9.0.0", "8", "9")
19
18
  }
20
19
 
21
- missing_or_broken = []
20
+ needs_repair = False
22
21
 
23
- # 1. Clean up "pycrypto" which causes SyntaxError on Python 3
24
- # If we catch a SyntaxError from 'from mega import Mega', it's almost certainly pycrypto
22
+ # 1. Check for corrupted Crypto namespace (Mixed pycrypto/pycryptodome)
25
23
  try:
26
- import Crypto.PublicKey.RSA
24
+ from Crypto.PublicKey import RSA
27
25
  except (SyntaxError, AttributeError, ImportError):
28
- # SyntaxError means it's the old pycrypto. We must kill it.
29
- missing_or_broken.append("pycryptodome")
26
+ needs_repair = True
30
27
 
31
28
  # 2. Check for missing or outdated modules
32
- for module_name, (pkg_name, min_v, forced) in check_deps.items():
33
- try:
34
- mod = __import__(module_name)
35
- if min_v:
36
- from importlib.metadata import version as get_v
37
- try:
38
- if int(get_v(module_name).split('.')[0]) < int(min_v):
39
- missing_or_broken.append(pkg_name)
40
- except:
41
- if forced: missing_or_broken.append(pkg_name)
42
- except:
43
- missing_or_broken.append(pkg_name)
29
+ if not needs_repair:
30
+ for module, (pkg, min_v, max_v) in mandatory.items():
31
+ try:
32
+ mod = __import__(module)
33
+ if min_v or max_v:
34
+ from importlib.metadata import version as get_v
35
+ v_str = get_v(module)
36
+ major = int(v_str.split('.')[0])
37
+ if (min_v and major < int(min_v)) or (max_v and major >= int(max_v)):
38
+ needs_repair = True; break
39
+ except:
40
+ needs_repair = True; break
44
41
 
45
- if missing_or_broken:
46
- print(f"\n[!] Critical dependency issues detected: {', '.join(missing_or_broken)}")
47
- print("[*] Running Forced Clean Repair (Python 3.11+ Stability Patch)...")
42
+ if needs_repair:
43
+ print("\n[!] Environment instability detected (Dependency Conflict).")
44
+ print("[*] Performing Aggressive Environment Repair (Python 3.11+ Stability Patch)...")
48
45
  try:
49
- # Step A: Uninstall known troublemakers
50
- subprocess.call([sys.executable, "-m", "pip", "uninstall", "-y", "pycrypto", "tenacity"],
46
+ # A: Deep clean the Crypto and Tenacity namespaces
47
+ # We uninstall everything that could possibly clash
48
+ bad_pkgs = ["pycrypto", "pycryptodome", "pycryptodomex", "tenacity", "mega.py"]
49
+ subprocess.call([sys.executable, "-m", "pip", "uninstall", "-y"] + bad_pkgs,
51
50
  stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
52
51
 
53
- # Step B: Install modern core deps
54
- subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "pycryptodome", "tenacity>=8.2.3", "requests"])
52
+ # B: Forced Reinstall of the MODERN stack
53
+ # We use --force-reinstall to ensure no broken files remain
54
+ print("[*] Rebuilding core libraries...")
55
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "--force-reinstall",
56
+ "pycryptodome", "tenacity>=8.2.3,<9.0.0", "requests"])
55
57
 
56
- # Step C: Install mega.py WITHOUT dependencies to avoid downgrading tenacity
58
+ # C: Install mega.py WITHOUT its own dependencies (to prevent it from breaking tenacity again)
57
59
  subprocess.check_call([sys.executable, "-m", "pip", "install", "mega.py", "--no-deps"])
58
60
 
59
- print("[+] Environment repaired successfully! Please restart the app if it fails next.\n")
61
+ print("[+] Environment successfully repaired! Please restart the app.\n")
62
+ sys.exit(0) # Exit to allow the user to restart with the fresh environment
60
63
  except Exception as e:
61
64
  print(f"[-] Auto-repair failed: {e}")
62
- print("[!] Please run manually: pip uninstall pycrypto tenacity && pip install pycryptodome tenacity>=8.2.3 mega.py --no-deps")
65
+ print("[!] Please run: pip uninstall -y pycrypto pycryptodome tenacity mega.py && pip install pycryptodome tenacity>=8.2.3,<9.0.0 mega.py --no-deps")
63
66
 
64
67
  ensure_dependencies()
65
68
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webtools-cli
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: Advanced Web Intelligence & Scraping Toolkit with CLI and Web UI
5
5
  Author: Abhinav Adarsh
6
6
  License-Expression: MIT
@@ -30,7 +30,7 @@ Requires-Dist: mtranslate
30
30
  Requires-Dist: colorama
31
31
  Requires-Dist: playwright
32
32
  Requires-Dist: pycryptodome
33
- Requires-Dist: tenacity>=8.2.3
33
+ Requires-Dist: tenacity<9.0.0,>=8.2.3
34
34
  Requires-Dist: pyreadline3; platform_system == "Windows"
35
35
  Provides-Extra: playwright
36
36
  Requires-Dist: playwright; extra == "playwright"
@@ -10,7 +10,7 @@ mtranslate
10
10
  colorama
11
11
  playwright
12
12
  pycryptodome
13
- tenacity>=8.2.3
13
+ tenacity<9.0.0,>=8.2.3
14
14
 
15
15
  [:platform_system == "Windows"]
16
16
  pyreadline3
File without changes
File without changes
File without changes