simplex 1.2.9__py3-none-any.whl → 1.2.11__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
@@ -8,6 +8,8 @@ import requests
8
8
  from typing import Optional
9
9
  from datetime import datetime, timedelta
10
10
 
11
+
12
+
11
13
  S3_URL = "https://u3mvtbirxf.us-east-1.awsapprunner.com"
12
14
  JOB_URL = "https://simplex--job-scheduler-app-handler.modal.run"
13
15
 
@@ -40,10 +42,6 @@ def create_archive(directory: str, config: dict) -> str:
40
42
 
41
43
  def push_directory(directory: str):
42
44
  """Main function to handle parsing yaml and creating zip archive"""
43
- # Load .env file from the target directory
44
- env_path = Path(directory) / '.env'
45
- if env_path.exists():
46
- load_dotenv(env_path)
47
45
 
48
46
  config = read_config(directory)
49
47
  archive_path = create_archive(directory, config)
@@ -57,7 +55,7 @@ def push_directory(directory: str):
57
55
  raise ValueError("Cron schedule not specified in simplex.yaml")
58
56
 
59
57
  try:
60
- s3_uri = upload_files_to_s3(archive_path, project_name)
58
+ s3_uri = upload_files_to_s3(directory, archive_path, project_name)
61
59
  except Exception as e:
62
60
  print(f"Error uploading project: {e}")
63
61
  raise
@@ -65,7 +63,7 @@ def push_directory(directory: str):
65
63
  os.unlink(archive_path)
66
64
 
67
65
  try:
68
- create_job_scheduled(project_name, cron_schedule, s3_uri)
66
+ create_job_scheduled(directory, project_name, cron_schedule, s3_uri)
69
67
  except Exception as e:
70
68
  print(f"Error creating job: {e}")
71
69
  raise
@@ -74,7 +72,13 @@ def push_directory(directory: str):
74
72
 
75
73
 
76
74
 
77
- 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
+
78
82
  # Read API key from environment
79
83
  api_key = os.getenv('SIMPLEX_API_KEY')
80
84
  if not api_key:
@@ -111,8 +115,14 @@ def upload_files_to_s3(archive_path: str, project_name: str):
111
115
  print(f"Error uploading project: {e}")
112
116
  raise
113
117
 
114
- 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):
115
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
+
116
126
  # Read API key from environment
117
127
  api_key = os.getenv('SIMPLEX_API_KEY')
118
128
  if not api_key:
@@ -149,8 +159,14 @@ def create_job_scheduled(project_name: str, cron_schedule: str, s3_uri: str):
149
159
  raise
150
160
 
151
161
 
152
- def create_job_immediately(project_name: str, s3_uri: str):
162
+ def create_job_immediately(directory: str, project_name: str, s3_uri: str):
153
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
+
154
170
  # Read API key from environment
155
171
  api_key = os.getenv('SIMPLEX_API_KEY')
156
172
  if not api_key:
@@ -202,7 +218,7 @@ def run_directory(directory: str):
202
218
  raise ValueError("Project name not specified in simplex.yaml")
203
219
 
204
220
  try:
205
- s3_uri = upload_files_to_s3(archive_path, project_name)
221
+ s3_uri = upload_files_to_s3(directory, archive_path, project_name)
206
222
  except Exception as e:
207
223
  print(f"Error uploading project: {e}")
208
224
  raise
@@ -211,7 +227,7 @@ def run_directory(directory: str):
211
227
  os.unlink(archive_path)
212
228
 
213
229
  try:
214
- create_job_immediately(project_name, s3_uri)
230
+ create_job_immediately(directory, project_name, s3_uri)
215
231
  except Exception as e:
216
232
  print(f"Error creating job: {e}")
217
233
  raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.9
3
+ Version: 1.2.11
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=RB2ZL-jTiLNvdLDD-TqibHM5I9WCmH7DXsIgtWBLjcs,6795
6
+ simplex-1.2.11.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
+ simplex-1.2.11.dist-info/METADATA,sha256=eMWpq4E-4rGapzadf-SJQI5yTFDQ2jz5Ra7zC0dGets,1350
8
+ simplex-1.2.11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
+ simplex-1.2.11.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
+ simplex-1.2.11.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
+ simplex-1.2.11.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=wXys677gzVGlsPPdILNJi03mjNKo6fOfyGntD4Pa3Gg,8624
4
- simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
- simplex/deploy/push.py,sha256=Xie_ip4hOBvEIS-pVDDDzHKZrqhkutMoe3cWsuoRLV0,6381
6
- simplex-1.2.9.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
- simplex-1.2.9.dist-info/METADATA,sha256=sr1n-BsKrTuABQWyLG3kA-K3x61APsMtolDkGW6ohEM,1349
8
- simplex-1.2.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- simplex-1.2.9.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
- simplex-1.2.9.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
- simplex-1.2.9.dist-info/RECORD,,