unitlab 2.3.10__tar.gz → 2.3.12__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.1
2
2
  Name: unitlab
3
- Version: 2.3.10
3
+ Version: 2.3.12
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name="unitlab",
5
- version="2.3.10",
5
+ version="2.3.12",
6
6
  license="MIT",
7
7
  author="Unitlab Inc.",
8
8
  author_email="team@unitlab.ai",
@@ -89,6 +89,12 @@ class CloudflaredBinaryManager:
89
89
 
90
90
  def _download_binary(self, info, target_path):
91
91
  """Download and verify binary"""
92
+
93
+ # Create SSL context to handle certificate issues
94
+ import ssl
95
+ ssl_context = ssl.create_default_context()
96
+ ssl_context.check_hostname = False
97
+ ssl_context.verify_mode = ssl.CERT_NONE
92
98
 
93
99
  # Download with progress bar
94
100
  def download_progress(block_num, block_size, total_size):
@@ -102,12 +108,23 @@ class CloudflaredBinaryManager:
102
108
  temp_file = target_path.with_suffix('.tmp')
103
109
 
104
110
  try:
105
- # Download file
106
- urllib.request.urlretrieve(
107
- info['url'],
108
- temp_file,
109
- reporthook=download_progress
110
- )
111
+ # Download file with SSL context
112
+ req = urllib.request.Request(info['url'], headers={'User-Agent': 'Mozilla/5.0'})
113
+ with urllib.request.urlopen(req, context=ssl_context) as response:
114
+ total_size = int(response.headers.get('Content-Length', 0))
115
+
116
+ with open(temp_file, 'wb') as f:
117
+ downloaded = 0
118
+ block_size = 8192
119
+ while True:
120
+ chunk = response.read(block_size)
121
+ if not chunk:
122
+ break
123
+ f.write(chunk)
124
+ downloaded += len(chunk)
125
+ if total_size > 0:
126
+ percent = min(downloaded * 100 / total_size, 100)
127
+ print(f"Downloading: {percent:.0f}%", end='\r')
111
128
  print("\n✓ Download complete")
112
129
 
113
130
  # Handle compressed files (macOS .tgz)
@@ -354,14 +354,17 @@ class UnitlabClient:
354
354
  try:
355
355
  logger.info("Starting Jupyter notebook...")
356
356
 
357
+ # Use NotebookApp for jupyter notebook (not jupyter-server)
357
358
  cmd = [
358
359
  "jupyter", "notebook",
359
360
  "--no-browser",
360
- "--ServerApp.token=''",
361
- "--ServerApp.password=''",
362
- "--ServerApp.allow_origin='*'",
363
- "--ServerApp.ip='0.0.0.0'",
364
- "--ServerApp.port=8888" # Explicitly use 8888 to match Cloudflare config
361
+ "--NotebookApp.token=''",
362
+ "--NotebookApp.password=''",
363
+ "--NotebookApp.allow_origin='*'",
364
+ "--NotebookApp.ip='0.0.0.0'", # Listen on all interfaces
365
+ "--NotebookApp.port=8888",
366
+ "--NotebookApp.allow_root=True", # Allow root if needed
367
+ "--NotebookApp.disable_check_xsrf=True" # For Cloudflare proxy
365
368
  ]
366
369
 
367
370
  self.jupyter_proc = subprocess.Popen(
@@ -297,6 +297,12 @@ class CloudflareAPITunnel:
297
297
  # Direct download fallback - simplified version
298
298
  import platform
299
299
  import urllib.request
300
+ import ssl
301
+
302
+ # Create SSL context that handles certificate issues
303
+ ssl_context = ssl.create_default_context()
304
+ ssl_context.check_hostname = False
305
+ ssl_context.verify_mode = ssl.CERT_NONE
300
306
 
301
307
  cache_dir = Path.home() / '.unitlab' / 'bin'
302
308
  cache_dir.mkdir(parents=True, exist_ok=True)
@@ -331,8 +337,25 @@ class CloudflareAPITunnel:
331
337
  raise RuntimeError(f"Unsupported platform: {system}")
332
338
 
333
339
  try:
334
- # Download the file
335
- urllib.request.urlretrieve(url, cloudflared_path)
340
+ # Download the file with SSL context
341
+ req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
342
+
343
+ # Special handling for macOS .tgz files
344
+ if system == 'darwin':
345
+ import tarfile
346
+ import io
347
+
348
+ with urllib.request.urlopen(req, context=ssl_context) as response:
349
+ data = response.read()
350
+
351
+ # Extract from tar.gz
352
+ with tarfile.open(fileobj=io.BytesIO(data), mode='r:gz') as tar:
353
+ tar.extract('cloudflared', cache_dir)
354
+ else:
355
+ # Direct binary download for Linux/Windows
356
+ with urllib.request.urlopen(req, context=ssl_context) as response:
357
+ with open(cloudflared_path, 'wb') as out_file:
358
+ out_file.write(response.read())
336
359
 
337
360
  # Make executable on Unix
338
361
  if system != 'windows':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unitlab
3
- Version: 2.3.10
3
+ Version: 2.3.12
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
File without changes
File without changes
File without changes
File without changes
File without changes