simplex 1.2.8__py3-none-any.whl → 1.2.10__py3-none-any.whl

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.

Potentially problematic release.


This version of simplex might be problematic. Click here for more details.

simplex/deploy/push.py CHANGED
@@ -7,7 +7,8 @@ from dotenv import load_dotenv
7
7
  import requests
8
8
  from typing import Optional
9
9
  from datetime import datetime, timedelta
10
- load_dotenv() # This loads the .env file
10
+
11
+
11
12
 
12
13
  S3_URL = "https://u3mvtbirxf.us-east-1.awsapprunner.com"
13
14
  JOB_URL = "https://simplex--job-scheduler-app-handler.modal.run"
@@ -41,6 +42,7 @@ def create_archive(directory: str, config: dict) -> str:
41
42
 
42
43
  def push_directory(directory: str):
43
44
  """Main function to handle parsing yaml and creating zip archive"""
45
+
44
46
  config = read_config(directory)
45
47
  archive_path = create_archive(directory, config)
46
48
 
@@ -61,7 +63,7 @@ def push_directory(directory: str):
61
63
  os.unlink(archive_path)
62
64
 
63
65
  try:
64
- create_job_scheduled(project_name, cron_schedule, s3_uri)
66
+ create_job_scheduled(directory, project_name, cron_schedule, s3_uri)
65
67
  except Exception as e:
66
68
  print(f"Error creating job: {e}")
67
69
  raise
@@ -70,7 +72,13 @@ def push_directory(directory: str):
70
72
 
71
73
 
72
74
 
73
- def upload_files_to_s3(archive_path: str, project_name: str):
75
+ def upload_files_to_s3(directory: str, archive_path: str, project_name: str):
76
+ """Upload files to S3"""
77
+ # Load .env file from the target directory
78
+ env_path = Path(directory) / '.env'
79
+ if env_path.exists():
80
+ load_dotenv(env_path)
81
+
74
82
  # Read API key from environment
75
83
  api_key = os.getenv('SIMPLEX_API_KEY')
76
84
  if not api_key:
@@ -107,8 +115,14 @@ def upload_files_to_s3(archive_path: str, project_name: str):
107
115
  print(f"Error uploading project: {e}")
108
116
  raise
109
117
 
110
- def create_job_scheduled(project_name: str, cron_schedule: str, s3_uri: str):
118
+ def create_job_scheduled(directory: str, project_name: str, cron_schedule: str, s3_uri: str):
111
119
  """Create a new job via the API"""
120
+
121
+ # Load .env file from the target directory
122
+ env_path = Path(directory) / '.env'
123
+ if env_path.exists():
124
+ load_dotenv(env_path)
125
+
112
126
  # Read API key from environment
113
127
  api_key = os.getenv('SIMPLEX_API_KEY')
114
128
  if not api_key:
@@ -145,8 +159,14 @@ def create_job_scheduled(project_name: str, cron_schedule: str, s3_uri: str):
145
159
  raise
146
160
 
147
161
 
148
- def create_job_immediately(project_name: str, s3_uri: str):
162
+ def create_job_immediately(directory: str, project_name: str, s3_uri: str):
149
163
  """Create a new job via the API"""
164
+
165
+ # Load .env file from the target directory
166
+ env_path = Path(directory) / '.env'
167
+ if env_path.exists():
168
+ load_dotenv(env_path)
169
+
150
170
  # Read API key from environment
151
171
  api_key = os.getenv('SIMPLEX_API_KEY')
152
172
  if not api_key:
@@ -185,6 +205,11 @@ def create_job_immediately(project_name: str, s3_uri: str):
185
205
 
186
206
  def run_directory(directory: str):
187
207
  """Run a directory immediately"""
208
+ # Load .env file from the target directory
209
+ env_path = Path(directory) / '.env'
210
+ if env_path.exists():
211
+ load_dotenv(env_path)
212
+
188
213
  config = read_config(directory)
189
214
  archive_path = create_archive(directory, config)
190
215
 
@@ -193,7 +218,7 @@ def run_directory(directory: str):
193
218
  raise ValueError("Project name not specified in simplex.yaml")
194
219
 
195
220
  try:
196
- s3_uri = upload_files_to_s3(archive_path, project_name)
221
+ s3_uri = upload_files_to_s3(directory, archive_path, project_name)
197
222
  except Exception as e:
198
223
  print(f"Error uploading project: {e}")
199
224
  raise
@@ -202,7 +227,7 @@ def run_directory(directory: str):
202
227
  os.unlink(archive_path)
203
228
 
204
229
  try:
205
- create_job_immediately(project_name, s3_uri)
230
+ create_job_immediately(directory, project_name, s3_uri)
206
231
  except Exception as e:
207
232
  print(f"Error creating job: {e}")
208
233
  raise
simplex/simplex.py CHANGED
@@ -199,7 +199,6 @@ class Simplex:
199
199
  raise ValueError(f"Must call create_session before calling action scroll with pixels={pixels}")
200
200
 
201
201
  data = {'pixels': pixels}
202
- print(data)
203
202
 
204
203
  if cdp_url:
205
204
  data['cdp_url'] = cdp_url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.8
3
+ Version: 1.2.10
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -0,0 +1,11 @@
1
+ simplex/__init__.py,sha256=1mbM4XUk0FNW161WOkM4ayC1s_QSsaBEls6PZ0iBScY,74
2
+ simplex/cli.py,sha256=PkHt3sBKYfu0Smil4aCMoZUD-JbPw8xsBewpFcBYDKM,675
3
+ simplex/simplex.py,sha256=wXys677gzVGlsPPdILNJi03mjNKo6fOfyGntD4Pa3Gg,8624
4
+ simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
+ simplex/deploy/push.py,sha256=8OkZ8a5vIPiTQ7YJIhxbz88uJDT6lLqyMaodlWqCTnE,6784
6
+ simplex-1.2.10.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
+ simplex-1.2.10.dist-info/METADATA,sha256=MCHKqhqD05skyOJhHTv0Dc7Jvh9JvX3qzmVKqgBScyc,1350
8
+ simplex-1.2.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
+ simplex-1.2.10.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
+ simplex-1.2.10.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
+ simplex-1.2.10.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- simplex/__init__.py,sha256=1mbM4XUk0FNW161WOkM4ayC1s_QSsaBEls6PZ0iBScY,74
2
- simplex/cli.py,sha256=PkHt3sBKYfu0Smil4aCMoZUD-JbPw8xsBewpFcBYDKM,675
3
- simplex/simplex.py,sha256=h50tySi2tn2iXgYDTtoUZN3j6ewh_-iWZKCRq431Cfk,8644
4
- simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
- simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
6
- simplex-1.2.8.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
- simplex-1.2.8.dist-info/METADATA,sha256=0AEZyu6qUVG9kKDji_K3azu4qoIIQRGQYtdJiZS_FJI,1349
8
- simplex-1.2.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- simplex-1.2.8.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
- simplex-1.2.8.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
- simplex-1.2.8.dist-info/RECORD,,