plash-cli 0.3.13__tar.gz → 0.3.14__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.
- {plash_cli-0.3.13/plash_cli.egg-info → plash_cli-0.3.14}/PKG-INFO +2 -2
- plash_cli-0.3.14/plash_cli/__init__.py +2 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli/auth.py +12 -6
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli/cli.py +25 -12
- {plash_cli-0.3.13 → plash_cli-0.3.14/plash_cli.egg-info}/PKG-INFO +2 -2
- plash_cli-0.3.14/plash_cli.egg-info/entry_points.txt +13 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli.egg-info/requires.txt +1 -1
- {plash_cli-0.3.13 → plash_cli-0.3.14}/pyproject.toml +15 -10
- plash_cli-0.3.13/plash_cli/__init__.py +0 -2
- plash_cli-0.3.13/plash_cli.egg-info/entry_points.txt +0 -13
- {plash_cli-0.3.13 → plash_cli-0.3.14}/LICENSE +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/MANIFEST.in +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/README.md +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli/_bash_magic.py +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli/_modidx.py +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli/assets/es256_public_key.pem +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli.egg-info/SOURCES.txt +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli.egg-info/dependency_links.txt +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/plash_cli.egg-info/top_level.txt +0 -0
- {plash_cli-0.3.13 → plash_cli-0.3.14}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plash_cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.14
|
|
4
4
|
Summary: CLI for the Plash hosting service
|
|
5
5
|
Author-email: Jeremy Howard <info@fast.ai>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: fastcore
|
|
18
|
+
Requires-Dist: fastcore>=1.12.27
|
|
19
19
|
Requires-Dist: httpx>=0.28.1
|
|
20
20
|
Requires-Dist: python-dotenv
|
|
21
21
|
Requires-Dist: pyjwt
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"""Client side logic to add Plash Auth to your app
|
|
1
|
+
"""Client side logic to add Plash Auth to your app
|
|
2
|
+
|
|
3
|
+
Docs: https://AnswerDotAI.github.io/plash_cli/auth.html.md"""
|
|
2
4
|
|
|
3
5
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_auth.ipynb.
|
|
4
6
|
|
|
@@ -27,9 +29,11 @@ def _signin_url(email_re: str=None, hd_re: str=None):
|
|
|
27
29
|
signin_completed_rt = "/signin_completed"
|
|
28
30
|
|
|
29
31
|
# %% ../nbs/01_auth.ipynb #74a0a24d
|
|
30
|
-
def mk_signin_url(
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
def mk_signin_url(
|
|
33
|
+
session: dict, # Session dictionary
|
|
34
|
+
email_re: str=None, # Regex filter for allowed email addresses
|
|
35
|
+
hd_re: str=None # Regex filter for allowed Google hosted domains
|
|
36
|
+
):
|
|
33
37
|
"Generate a Google Sign-In URL for Plash authentication."
|
|
34
38
|
if not _in_prod: return f"{signin_completed_rt}?signin_reply=mock-sign-in-reply"
|
|
35
39
|
res = _signin_url(email_re, hd_re)
|
|
@@ -50,8 +54,10 @@ class PlashAuthError(Exception):
|
|
|
50
54
|
pass
|
|
51
55
|
|
|
52
56
|
# %% ../nbs/01_auth.ipynb #a311ce9a
|
|
53
|
-
def goog_id_from_signin_reply(
|
|
54
|
-
|
|
57
|
+
def goog_id_from_signin_reply(
|
|
58
|
+
session: dict, # Session dictionary containing 'req_id'
|
|
59
|
+
reply: str # The JWT reply string from Plash after Google authentication
|
|
60
|
+
):
|
|
55
61
|
"Validate Google sign-in reply and returns Google user ID if valid."
|
|
56
62
|
if not _in_prod: return '424242424242424242424'
|
|
57
63
|
parsed = _parse_jwt(reply)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"""The Plash CLI tool
|
|
1
|
+
"""The Plash CLI tool
|
|
2
|
+
|
|
3
|
+
Docs: https://AnswerDotAI.github.io/plash_cli/cli.html.md"""
|
|
2
4
|
|
|
3
5
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_cli.ipynb.
|
|
4
6
|
|
|
@@ -150,7 +152,8 @@ def create_tar_archive(path:Path, force_data:bool=False) -> tuple[io.BytesIO, in
|
|
|
150
152
|
def deploy(
|
|
151
153
|
path:Path='.', # Path to project
|
|
152
154
|
name:str=None, # Overrides the .plash file in project root if provided
|
|
153
|
-
_force_data:bool=False
|
|
155
|
+
_force_data:bool=False # Overwrite data/ directory during deployment
|
|
156
|
+
):
|
|
154
157
|
"""
|
|
155
158
|
Deploys app to production. By default, this command erases all files in your app which are not in data/.
|
|
156
159
|
Then uploads all files and folders, except paths starting with `.` and except the local data/ directory.
|
|
@@ -178,7 +181,8 @@ def deploy(
|
|
|
178
181
|
def _deploy(
|
|
179
182
|
path:Path='.', # Path to project
|
|
180
183
|
name:str=None, # Overrides the .plash file in project root if provided
|
|
181
|
-
force_data:bool=False
|
|
184
|
+
force_data:bool=False # Overwrite data/ directory during deployment
|
|
185
|
+
):
|
|
182
186
|
print('Initializing deployment...')
|
|
183
187
|
try: res = deploy(path=path, name=name, _force_data=force_data)
|
|
184
188
|
except PlashError as e: return str(e)
|
|
@@ -201,7 +205,8 @@ def view(
|
|
|
201
205
|
# %% ../nbs/00_cli.ipynb #43535aef
|
|
202
206
|
def delete_app(
|
|
203
207
|
path:Path='.', # Path to project
|
|
204
|
-
name:str=None
|
|
208
|
+
name:str=None # Overrides the .plash file in project root if provided
|
|
209
|
+
):
|
|
205
210
|
'Delete your deployed app'
|
|
206
211
|
name = _prep(path, name)
|
|
207
212
|
_mk_auth_req(_endpoint(rt=f"/delete?name={name}"), "delete")
|
|
@@ -209,8 +214,10 @@ def delete_app(
|
|
|
209
214
|
|
|
210
215
|
@call_parse
|
|
211
216
|
@delegates(delete_app)
|
|
212
|
-
def _delete(
|
|
213
|
-
|
|
217
|
+
def _delete(
|
|
218
|
+
force:bool=False, # Skip confirmation prompt
|
|
219
|
+
**kwargs
|
|
220
|
+
):
|
|
214
221
|
'Delete your deployed app'
|
|
215
222
|
if not force:
|
|
216
223
|
confirm = input("Are you sure you want to delete the app? [y/N]: ")
|
|
@@ -222,7 +229,8 @@ _delete.__doc__ = delete_app.__doc__
|
|
|
222
229
|
# %% ../nbs/00_cli.ipynb #d72ccd37
|
|
223
230
|
def start_app(
|
|
224
231
|
path:Path='.', # Path to project
|
|
225
|
-
name:str=None
|
|
232
|
+
name:str=None # Overrides the .plash file in project root if provided
|
|
233
|
+
):
|
|
226
234
|
'Start your deployed app'
|
|
227
235
|
name = _prep(path, name)
|
|
228
236
|
_mk_auth_req(_endpoint(rt=f"/start?name={name}"))
|
|
@@ -238,7 +246,8 @@ _start.__doc__ = start_app.__doc__
|
|
|
238
246
|
# %% ../nbs/00_cli.ipynb #ace91510
|
|
239
247
|
def stop_app(
|
|
240
248
|
path:Path='.', # Path to project
|
|
241
|
-
name:str=None
|
|
249
|
+
name:str=None # Overrides the .plash file in project root if provided
|
|
250
|
+
):
|
|
242
251
|
'Stop your deployed app'
|
|
243
252
|
name = _prep(path, name)
|
|
244
253
|
_mk_auth_req(_endpoint(rt=f"/stop?name={name}"))
|
|
@@ -258,7 +267,8 @@ log_modes = str_enum('log_modes', 'build', 'app')
|
|
|
258
267
|
def logs(
|
|
259
268
|
path:Path='.', # Path to project
|
|
260
269
|
name:str=None, # Overrides the .plash file in project root if provided
|
|
261
|
-
mode:log_modes='build'
|
|
270
|
+
mode:log_modes='build' # Choose between build or app logs
|
|
271
|
+
):
|
|
262
272
|
'Get logs for your deployed app'
|
|
263
273
|
name = _prep(path, name)
|
|
264
274
|
r = _mk_auth_req(_endpoint(rt=f"/logs?name={name}&mode={mode}"))
|
|
@@ -266,8 +276,10 @@ def logs(
|
|
|
266
276
|
|
|
267
277
|
@call_parse
|
|
268
278
|
@delegates(logs)
|
|
269
|
-
def _logs(
|
|
270
|
-
|
|
279
|
+
def _logs(
|
|
280
|
+
tail:bool=False, # Tail the logs
|
|
281
|
+
**kwargs
|
|
282
|
+
):
|
|
271
283
|
try:
|
|
272
284
|
if not tail: return print(logs(**kwargs))
|
|
273
285
|
text = ''
|
|
@@ -290,7 +302,8 @@ def _is_dir_empty(self:Path): return next(self.iterdir(), None) is None
|
|
|
290
302
|
def download_app(
|
|
291
303
|
path:Path='.', # Path to project
|
|
292
304
|
name:str=None, # Overrides the .plash file in project root if provided
|
|
293
|
-
save_path:Path="./download/"
|
|
305
|
+
save_path:Path="./download/" # Save path (optional)
|
|
306
|
+
):
|
|
294
307
|
"Download deployed app to save_path."
|
|
295
308
|
name = _prep(path, name)
|
|
296
309
|
save_path = Path(save_path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plash_cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.14
|
|
4
4
|
Summary: CLI for the Plash hosting service
|
|
5
5
|
Author-email: Jeremy Howard <info@fast.ai>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: fastcore
|
|
18
|
+
Requires-Dist: fastcore>=1.12.27
|
|
19
19
|
Requires-Dist: httpx>=0.28.1
|
|
20
20
|
Requires-Dist: python-dotenv
|
|
21
21
|
Requires-Dist: pyjwt
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[console_scripts]
|
|
2
|
+
plash-apps = plash_cli.cli:_app_list
|
|
3
|
+
plash-delete = plash_cli.cli:_delete
|
|
4
|
+
plash-deploy = plash_cli.cli:_deploy
|
|
5
|
+
plash-download = plash_cli.cli:_download
|
|
6
|
+
plash-login = plash_cli.cli:login
|
|
7
|
+
plash-logs = plash_cli.cli:_logs
|
|
8
|
+
plash-start = plash_cli.cli:_start
|
|
9
|
+
plash-stop = plash_cli.cli:_stop
|
|
10
|
+
plash-view = plash_cli.cli:view
|
|
11
|
+
|
|
12
|
+
[nbdev]
|
|
13
|
+
plash_cli = plash_cli._modidx:d
|
|
@@ -12,7 +12,7 @@ license = {text = "Apache-2.0"}
|
|
|
12
12
|
authors = [{name = "Jeremy Howard", email = "info@fast.ai"}]
|
|
13
13
|
keywords = ['nbdev', 'jupyter', 'notebook', 'python']
|
|
14
14
|
classifiers = ["Natural Language :: English", "Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only"]
|
|
15
|
-
dependencies = ['fastcore', 'httpx>=0.28.1', 'python-dotenv', 'pyjwt', 'cryptography']
|
|
15
|
+
dependencies = ['fastcore>=1.12.27', 'httpx>=0.28.1', 'python-dotenv', 'pyjwt', 'cryptography']
|
|
16
16
|
|
|
17
17
|
[project.urls]
|
|
18
18
|
Repository = "https://github.com/AnswerDotAI/plash_cli"
|
|
@@ -26,15 +26,15 @@ dev = ['bash_kernel', 'nbdev>=3']
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
[project.scripts]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
plash-deploy = "plash_cli.cli:_deploy"
|
|
30
|
+
plash-login = "plash_cli.cli:login"
|
|
31
|
+
plash-view = "plash_cli.cli:view"
|
|
32
|
+
plash-logs = "plash_cli.cli:_logs"
|
|
33
|
+
plash-delete = "plash_cli.cli:_delete"
|
|
34
|
+
plash-stop = "plash_cli.cli:_stop"
|
|
35
|
+
plash-start = "plash_cli.cli:_start"
|
|
36
|
+
plash-download = "plash_cli.cli:_download"
|
|
37
|
+
plash-apps = "plash_cli.cli:_app_list"
|
|
38
38
|
|
|
39
39
|
[tool.setuptools.dynamic]
|
|
40
40
|
version = {attr = "plash_cli.__version__"}
|
|
@@ -43,4 +43,9 @@ version = {attr = "plash_cli.__version__"}
|
|
|
43
43
|
include = ["plash_cli"]
|
|
44
44
|
|
|
45
45
|
[tool.nbdev]
|
|
46
|
+
allowed_metadata_keys = ['solveit']
|
|
47
|
+
allowed_cell_metadata_keys = ['solveit_ai']
|
|
46
48
|
custom_sidebar = false
|
|
49
|
+
|
|
50
|
+
[tool.chkstyle]
|
|
51
|
+
skip_paths = ["_modidx.py"]
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[console_scripts]
|
|
2
|
-
plash_apps = plash_cli.cli:_app_list
|
|
3
|
-
plash_delete = plash_cli.cli:_delete
|
|
4
|
-
plash_deploy = plash_cli.cli:_deploy
|
|
5
|
-
plash_download = plash_cli.cli:_download
|
|
6
|
-
plash_login = plash_cli.cli:login
|
|
7
|
-
plash_logs = plash_cli.cli:_logs
|
|
8
|
-
plash_start = plash_cli.cli:_start
|
|
9
|
-
plash_stop = plash_cli.cli:_stop
|
|
10
|
-
plash_view = plash_cli.cli:view
|
|
11
|
-
|
|
12
|
-
[nbdev]
|
|
13
|
-
plash_cli = plash_cli._modidx:d
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|