plash-cli 0.2.0__tar.gz → 0.2.1__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.2.0/plash_cli.egg-info → plash_cli-0.2.1}/PKG-INFO +4 -8
- {plash_cli-0.2.0 → plash_cli-0.2.1}/README.md +2 -2
- plash_cli-0.2.1/plash_cli/__init__.py +1 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli/core.py +17 -12
- {plash_cli-0.2.0 → plash_cli-0.2.1/plash_cli.egg-info}/PKG-INFO +4 -8
- {plash_cli-0.2.0 → plash_cli-0.2.1}/pyproject.toml +1 -1
- {plash_cli-0.2.0 → plash_cli-0.2.1}/settings.ini +2 -2
- plash_cli-0.2.0/plash_cli/__init__.py +0 -1
- {plash_cli-0.2.0 → plash_cli-0.2.1}/LICENSE +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/MANIFEST.in +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli/_bash_magic.py +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli/_modidx.py +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli.egg-info/SOURCES.txt +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli.egg-info/dependency_links.txt +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli.egg-info/entry_points.txt +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli.egg-info/not-zip-safe +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli.egg-info/requires.txt +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/plash_cli.egg-info/top_level.txt +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/setup.cfg +0 -0
- {plash_cli-0.2.0 → plash_cli-0.2.1}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plash_cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: CLI for the Plash hosting service
|
|
5
5
|
Home-page: https://github.com/AnswerDotAI/plash_cli
|
|
6
6
|
Author: Jeremy Howard
|
|
@@ -10,14 +10,10 @@ Keywords: nbdev jupyter notebook python
|
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
15
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
20
|
-
Requires-Python: >=3.
|
|
16
|
+
Requires-Python: >=3.11
|
|
21
17
|
Description-Content-Type: text/markdown
|
|
22
18
|
License-File: LICENSE
|
|
23
19
|
Requires-Dist: fastcore
|
|
@@ -135,8 +131,8 @@ other popular python frameworks.
|
|
|
135
131
|
|
|
136
132
|
> [!WARNING]
|
|
137
133
|
>
|
|
138
|
-
> Your app must
|
|
139
|
-
> FastHTML apps.
|
|
134
|
+
> Your app must use port 5001, as this is the port exposed by Plash’s
|
|
135
|
+
> Docker container. It also happens to be the default for FastHTML apps.
|
|
140
136
|
|
|
141
137
|
And create the `requirements.txt` file:
|
|
142
138
|
|
|
@@ -94,8 +94,8 @@ other popular python frameworks.
|
|
|
94
94
|
|
|
95
95
|
> [!WARNING]
|
|
96
96
|
>
|
|
97
|
-
> Your app must
|
|
98
|
-
> FastHTML apps.
|
|
97
|
+
> Your app must use port 5001, as this is the port exposed by Plash’s
|
|
98
|
+
> Docker container. It also happens to be the default for FastHTML apps.
|
|
99
99
|
|
|
100
100
|
And create the `requirements.txt` file:
|
|
101
101
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.1"
|
|
@@ -114,7 +114,7 @@ def validate_app(path):
|
|
|
114
114
|
if deps and (path/"requirements.txt").exists():
|
|
115
115
|
raise PlashError('A Plash app should not contain both a requirements.txt file and inline dependencies (see PEP723).')
|
|
116
116
|
|
|
117
|
-
# %% ../nbs/00_core.ipynb
|
|
117
|
+
# %% ../nbs/00_core.ipynb 24
|
|
118
118
|
def create_tar_archive(path:Path, force_data:bool=False) -> tuple[io.BytesIO, int]:
|
|
119
119
|
"Creates a tar archive of a directory, excluding files based on is_included"
|
|
120
120
|
tarz = io.BytesIO()
|
|
@@ -137,13 +137,18 @@ def _gen_app_name():
|
|
|
137
137
|
suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=3))
|
|
138
138
|
return f"{random.choice(adjectives)}-{random.choice(nouns)}-{random.choice(verbs)}-{suffix}"
|
|
139
139
|
|
|
140
|
-
# %% ../nbs/00_core.ipynb
|
|
140
|
+
# %% ../nbs/00_core.ipynb 27
|
|
141
141
|
@call_parse
|
|
142
142
|
def deploy(
|
|
143
143
|
path:Path=Path('.'), # Path to project
|
|
144
144
|
name:str=None, # Overrides the .plash file in project root if provided
|
|
145
145
|
force_data:bool=False): # Overwrite data/ directory during deployment
|
|
146
|
-
"
|
|
146
|
+
"""
|
|
147
|
+
Deploys app to production. By default, this command erases all files in your app which are not in data/.
|
|
148
|
+
Then uploads all files and folders, except paths starting with '.' and except the local data/ directory.
|
|
149
|
+
If `--force data` is used, then it erases all files in production. Then it uploads all files and folders,
|
|
150
|
+
including `data/`, except paths starting with '.'.
|
|
151
|
+
"""
|
|
147
152
|
print('Initializing deployment...')
|
|
148
153
|
if name == '': print('Error: App name cannot be an empty string'); return
|
|
149
154
|
if not path.is_dir(): print("Error: Path should point to the project directory"); return
|
|
@@ -162,10 +167,10 @@ def deploy(
|
|
|
162
167
|
data={'name': name, 'force_data': force_data})
|
|
163
168
|
if resp.status_code == 200:
|
|
164
169
|
print('✅ Upload complete! Your app is currently being built.')
|
|
165
|
-
print(f'It will be live at {name if
|
|
170
|
+
print(f'It will be live at {name if "." in name else endpoint(sub=name)}')
|
|
166
171
|
else: print(f'Failure: {resp.status_code}\n{resp.text}')
|
|
167
172
|
|
|
168
|
-
# %% ../nbs/00_core.ipynb
|
|
173
|
+
# %% ../nbs/00_core.ipynb 29
|
|
169
174
|
@call_parse
|
|
170
175
|
def view(
|
|
171
176
|
path:Path=Path('.'), # Path to project directory
|
|
@@ -177,7 +182,7 @@ def view(
|
|
|
177
182
|
print(f"Opening browser to view app :\n{url}\n")
|
|
178
183
|
webbrowser.open(url)
|
|
179
184
|
|
|
180
|
-
# %% ../nbs/00_core.ipynb
|
|
185
|
+
# %% ../nbs/00_core.ipynb 31
|
|
181
186
|
@call_parse
|
|
182
187
|
def delete(
|
|
183
188
|
path:Path=Path('.'), # Path to project
|
|
@@ -195,7 +200,7 @@ def delete(
|
|
|
195
200
|
r = mk_auth_req(endpoint(rt=f"/delete?name={name}"), "delete")
|
|
196
201
|
return r.text
|
|
197
202
|
|
|
198
|
-
# %% ../nbs/00_core.ipynb
|
|
203
|
+
# %% ../nbs/00_core.ipynb 33
|
|
199
204
|
def endpoint_func(endpoint_name):
|
|
200
205
|
'Creates a function for a specific API endpoint'
|
|
201
206
|
def func(
|
|
@@ -216,10 +221,10 @@ def endpoint_func(endpoint_name):
|
|
|
216
221
|
stop = endpoint_func('/stop')
|
|
217
222
|
start = endpoint_func('/start')
|
|
218
223
|
|
|
219
|
-
# %% ../nbs/00_core.ipynb
|
|
224
|
+
# %% ../nbs/00_core.ipynb 35
|
|
220
225
|
log_modes = str_enum('log_modes', 'build', 'app')
|
|
221
226
|
|
|
222
|
-
# %% ../nbs/00_core.ipynb
|
|
227
|
+
# %% ../nbs/00_core.ipynb 36
|
|
223
228
|
@call_parse
|
|
224
229
|
def logs(
|
|
225
230
|
path:Path=Path('.'), # Path to project
|
|
@@ -245,7 +250,7 @@ def logs(
|
|
|
245
250
|
r = mk_auth_req(endpoint(rt=f"/logs?name={name}&mode={mode}"))
|
|
246
251
|
return r.text
|
|
247
252
|
|
|
248
|
-
# %% ../nbs/00_core.ipynb
|
|
253
|
+
# %% ../nbs/00_core.ipynb 38
|
|
249
254
|
@call_parse
|
|
250
255
|
def download(
|
|
251
256
|
path:Path=Path('.'), # Path to project
|
|
@@ -261,12 +266,12 @@ def download(
|
|
|
261
266
|
with tarfile.open(fileobj=file_bytes, mode="r:gz") as tar: tar.extractall(path=save_path)
|
|
262
267
|
print(f"Downloaded your app to: {save_path}")
|
|
263
268
|
|
|
264
|
-
# %% ../nbs/00_core.ipynb
|
|
269
|
+
# %% ../nbs/00_core.ipynb 40
|
|
265
270
|
@call_parse
|
|
266
271
|
def apps(verbose:bool=False):
|
|
267
272
|
"List your deployed apps (verbose shows status table: 1=running, 0=stopped)"
|
|
268
273
|
r = mk_auth_req(endpoint(rt="/user_apps")).raise_for_status()
|
|
269
274
|
apps = r.json()
|
|
270
275
|
if not apps: return "You don't have any deployed Plash apps."
|
|
271
|
-
if verbose: [print(f
|
|
276
|
+
if verbose: [print(f"{a['running']} {a['name']}") for a in apps]
|
|
272
277
|
else: [print(a['name']) for a in apps]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plash_cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: CLI for the Plash hosting service
|
|
5
5
|
Home-page: https://github.com/AnswerDotAI/plash_cli
|
|
6
6
|
Author: Jeremy Howard
|
|
@@ -10,14 +10,10 @@ Keywords: nbdev jupyter notebook python
|
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
15
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
20
|
-
Requires-Python: >=3.
|
|
16
|
+
Requires-Python: >=3.11
|
|
21
17
|
Description-Content-Type: text/markdown
|
|
22
18
|
License-File: LICENSE
|
|
23
19
|
Requires-Dist: fastcore
|
|
@@ -135,8 +131,8 @@ other popular python frameworks.
|
|
|
135
131
|
|
|
136
132
|
> [!WARNING]
|
|
137
133
|
>
|
|
138
|
-
> Your app must
|
|
139
|
-
> FastHTML apps.
|
|
134
|
+
> Your app must use port 5001, as this is the port exposed by Plash’s
|
|
135
|
+
> Docker container. It also happens to be the default for FastHTML apps.
|
|
140
136
|
|
|
141
137
|
And create the `requirements.txt` file:
|
|
142
138
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name="plash_cli"
|
|
7
|
-
requires-python=">=3.
|
|
7
|
+
requires-python=">=3.11"
|
|
8
8
|
dynamic = [ "keywords", "description", "version", "dependencies", "optional-dependencies", "readme", "license", "authors", "classifiers", "entry-points", "scripts", "urls"]
|
|
9
9
|
|
|
10
10
|
[tool.uv]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.0"
|
|
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
|
|
File without changes
|
|
File without changes
|