accli 0.7.11__tar.gz → 1.0.0__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.
accli-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,148 @@
1
+ Metadata-Version: 2.1
2
+ Name: accli
3
+ Version: 1.0.0
4
+ Summary: IIASA Accelerator Client
5
+ Author-email: Wrufesh S <wrufesh@gmail.com>
6
+ License: The MIT License (MIT)
7
+
8
+ Copyright (c) 2018 Sebastián Ramírez
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+ Project-URL: Homepage, https://github.com/iiasa/accli
28
+ Project-URL: Bug Tracker, https://github.com/iiasa/accli/issues
29
+ Classifier: Programming Language :: Python :: 3
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Operating System :: OS Independent
32
+ Requires-Python: >=3.7
33
+ Description-Content-Type: text/markdown
34
+ License-File: LICENSE
35
+
36
+
37
+ # Accelerator Terminal Client and Python API
38
+
39
+ This package provides:
40
+
41
+ - A **command-line client** (`accli`) for interacting with the **Accelerator**.
42
+ - A **Python API** via the `accli` package.
43
+
44
+ Both interfaces communicate with the Accelerator’s REST API, implemented in the [Control Services Backend](https://github.com/iiasa/control_services_backend).
45
+
46
+ ---
47
+
48
+ ## 🔐 Authentication
49
+
50
+ This client uses **device authentication** via Auth0.
51
+
52
+ - **OAuth Flow**: [Device Authorization Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow)
53
+ - **Token Validity**: 7 days
54
+ - **Access Control**: Role-Based Access Control (RBAC) with stateless tokens
55
+ - **Grants**: Limited and scoped
56
+
57
+ ---
58
+
59
+ ## 📖 User Guide
60
+
61
+ ### ✅ Requirements
62
+
63
+ - Python >= 3.7.17
64
+
65
+ ### 📦 Installation
66
+
67
+ ```bash
68
+ pip install accli --user
69
+ ```
70
+
71
+ ### ▶️ Usage
72
+
73
+ #### As a Python Module
74
+
75
+ ```bash
76
+ python -m accli
77
+ ```
78
+
79
+ #### As an Executable
80
+
81
+ After installation, the executable might not be in your system `PATH`. You may see a warning like this:
82
+
83
+ ```
84
+ WARNING: The script accli.exe is installed in 'C:\Users\<user>\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
85
+ Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
86
+ ```
87
+
88
+ To resolve this, add the script's path to your system's environment variables:
89
+
90
+ - [Update PATH on Windows](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho)
91
+ - [Update PATH on Linux](https://www.geeksforgeeks.org/how-to-set-path-permanantly-in-linux/)
92
+
93
+ > **Note:** On Linux/macOS, you may need to prefix the command with `./`, and on Windows, with `.\`.
94
+
95
+ ### 🔍 Help Command
96
+
97
+ ```bash
98
+ accli --help
99
+ ```
100
+
101
+ **Sample Output:**
102
+
103
+ ```
104
+ Usage: accli [OPTIONS] COMMAND [ARGS]...
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 👩‍💻 Developer Guide
110
+
111
+ ### 🛠 Build & Upload
112
+
113
+ Follow the official Python packaging tutorial:
114
+ [Packaging Projects – Python.org](https://packaging.python.org/en/latest/tutorials/packaging-projects/)
115
+
116
+ ### 🚀 Release Process
117
+
118
+ 1. Update the version in `accli/_version.py`
119
+ 2. Tag the release:
120
+
121
+ ```bash
122
+ python scripts/tag.py
123
+ ```
124
+
125
+ 3. Build the package:
126
+
127
+ ```bash
128
+ python -m build
129
+ ```
130
+
131
+ 4. Upload to PyPI:
132
+
133
+ ```bash
134
+ twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*
135
+ ```
136
+
137
+ ---
138
+
139
+ ## 🧪 Experimental
140
+
141
+ Consider bundling with Nuitka:
142
+
143
+ ```bash
144
+ nuitka --standalone --onefile --static-libpython=yes \
145
+ --include-package=accli \
146
+ --output-dir=build \
147
+ -m accli.cli:app
148
+ ```
accli-1.0.0/README.md ADDED
@@ -0,0 +1,113 @@
1
+
2
+ # Accelerator Terminal Client and Python API
3
+
4
+ This package provides:
5
+
6
+ - A **command-line client** (`accli`) for interacting with the **Accelerator**.
7
+ - A **Python API** via the `accli` package.
8
+
9
+ Both interfaces communicate with the Accelerator’s REST API, implemented in the [Control Services Backend](https://github.com/iiasa/control_services_backend).
10
+
11
+ ---
12
+
13
+ ## 🔐 Authentication
14
+
15
+ This client uses **device authentication** via Auth0.
16
+
17
+ - **OAuth Flow**: [Device Authorization Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow)
18
+ - **Token Validity**: 7 days
19
+ - **Access Control**: Role-Based Access Control (RBAC) with stateless tokens
20
+ - **Grants**: Limited and scoped
21
+
22
+ ---
23
+
24
+ ## 📖 User Guide
25
+
26
+ ### ✅ Requirements
27
+
28
+ - Python >= 3.7.17
29
+
30
+ ### 📦 Installation
31
+
32
+ ```bash
33
+ pip install accli --user
34
+ ```
35
+
36
+ ### ▶️ Usage
37
+
38
+ #### As a Python Module
39
+
40
+ ```bash
41
+ python -m accli
42
+ ```
43
+
44
+ #### As an Executable
45
+
46
+ After installation, the executable might not be in your system `PATH`. You may see a warning like this:
47
+
48
+ ```
49
+ WARNING: The script accli.exe is installed in 'C:\Users\<user>\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
50
+ Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
51
+ ```
52
+
53
+ To resolve this, add the script's path to your system's environment variables:
54
+
55
+ - [Update PATH on Windows](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho)
56
+ - [Update PATH on Linux](https://www.geeksforgeeks.org/how-to-set-path-permanantly-in-linux/)
57
+
58
+ > **Note:** On Linux/macOS, you may need to prefix the command with `./`, and on Windows, with `.\`.
59
+
60
+ ### 🔍 Help Command
61
+
62
+ ```bash
63
+ accli --help
64
+ ```
65
+
66
+ **Sample Output:**
67
+
68
+ ```
69
+ Usage: accli [OPTIONS] COMMAND [ARGS]...
70
+ ```
71
+
72
+ ---
73
+
74
+ ## 👩‍💻 Developer Guide
75
+
76
+ ### 🛠 Build & Upload
77
+
78
+ Follow the official Python packaging tutorial:
79
+ [Packaging Projects – Python.org](https://packaging.python.org/en/latest/tutorials/packaging-projects/)
80
+
81
+ ### 🚀 Release Process
82
+
83
+ 1. Update the version in `accli/_version.py`
84
+ 2. Tag the release:
85
+
86
+ ```bash
87
+ python scripts/tag.py
88
+ ```
89
+
90
+ 3. Build the package:
91
+
92
+ ```bash
93
+ python -m build
94
+ ```
95
+
96
+ 4. Upload to PyPI:
97
+
98
+ ```bash
99
+ twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*
100
+ ```
101
+
102
+ ---
103
+
104
+ ## 🧪 Experimental
105
+
106
+ Consider bundling with Nuitka:
107
+
108
+ ```bash
109
+ nuitka --standalone --onefile --static-libpython=yes \
110
+ --include-package=accli \
111
+ --output-dir=build \
112
+ -m accli.cli:app
113
+ ```
@@ -22,24 +22,22 @@ class AccAPIError(Exception):
22
22
  # self.response_data = kwargs.pop('response_data')
23
23
  # super().__init__(*args, **kwargs)
24
24
 
25
- class UnhealthyControlServerError(Exception):
26
- pass
27
25
 
28
26
  retries = urllib3.util.Retry(total=10, backoff_factor=1)
29
27
 
30
28
  http_client = urllib3.poolmanager.PoolManager(
31
- num_pools=20, retries=retries
29
+ num_pools=20, retries=retries, maxsize=2000, block=True
32
30
  )
33
31
 
34
32
  http_client_wo_cert_verification = urllib3.poolmanager.PoolManager(
35
- cert_reqs="CERT_NONE", num_pools=20, retries=retries
33
+ cert_reqs="CERT_NONE", num_pools=20, retries=retries, maxsize=2000, block=True
36
34
  )
37
35
 
38
36
  class AcceleratorJobProjectService:
39
37
  def __init__(
40
38
  self,
41
39
  user_token,
42
- server_url='http://accelerator-api.iiasa.ac.at',
40
+ server_url='http://accelerator.iiasa.ac.at',
43
41
  verify_cert=(not ACCLI_DEBUG)
44
42
  ):
45
43
 
@@ -170,32 +168,32 @@ class AcceleratorJobProjectService:
170
168
  return resp
171
169
 
172
170
  def check_job_health(self):
173
- try:
174
- res = self.http_client_request(
175
- "GET",
176
- f"{self.cli_base_url}/is-healthy/",
177
- headers=self.common_request_headers
178
- )
179
- if res.data:
180
- res = todict(res.data)
181
- except Exception as err:
182
- raise UnhealthyControlServerError(str(err))
171
+
172
+ res = self.http_client_request(
173
+ "GET",
174
+ f"{self.cli_base_url}/is-healthy/",
175
+ headers=self.common_request_headers
176
+ )
177
+
178
+ if res.data:
179
+ res = todict(res.data)
183
180
 
184
181
  is_healthy = res['is_healthy']
185
182
  return is_healthy
186
183
 
187
184
  def add_log_file(self, data: bytes, filename):
188
- try:
189
- res = self.http_client_request(
190
- "GET",
191
- f"{self.cli_base_url}/presigned-log-upload-url/?filename={filename}",
192
- headers=self.common_request_headers
193
- )
194
- if res.data:
195
- res = todict(res.data)
196
- except Exception as err:
197
- raise UnhealthyControlServerError(str(err))
185
+
186
+ res = self.http_client_request(
187
+ "GET",
188
+ f"{self.cli_base_url}/presigned-log-upload-url/?filename={filename}",
189
+ headers=self.common_request_headers
190
+ )
198
191
 
192
+ if res.data:
193
+ res = todict(res.data)
194
+ else:
195
+ raise ValueError(f"Unable to get presign url in response: {res.data}")
196
+
199
197
  upload_url = res['upload_url']
200
198
  app_bucket_id = res['app_bucket_id']
201
199
  res_filename = res['filename']
@@ -208,23 +206,19 @@ class AcceleratorJobProjectService:
208
206
  verify=False,
209
207
  )
210
208
 
211
- try:
212
- self.http_client_request(
213
- "POST",
214
- f"{self.cli_base_url}/register-log-file/",
215
- json=dict(
216
- filename=res_filename,
217
- app_bucket_id=app_bucket_id
218
- ),
219
- headers=self.common_request_headers
220
- )
221
- except Exception as err:
222
- raise UnhealthyControlServerError(str(err))
223
-
224
- if not is_healthy:
225
- raise UnhealthyControlServerError('Unhealthy control server.')
226
-
227
209
 
210
+ self.http_client_request(
211
+ "POST",
212
+ f"{self.cli_base_url}/register-log-file/",
213
+ json=dict(
214
+ filename=res_filename,
215
+ app_bucket_id=app_bucket_id
216
+ ),
217
+ headers=self.common_request_headers
218
+ )
219
+
220
+ return is_healthy
221
+
228
222
 
229
223
  def get_multipart_put_create_signed_url(
230
224
  self,
@@ -23,11 +23,11 @@ class AccAPIError(Exception):
23
23
  retries = urllib3.util.Retry(total=10, backoff_factor=1)
24
24
 
25
25
  http_client = urllib3.poolmanager.PoolManager(
26
- num_pools=20, retries=retries
26
+ num_pools=20, retries=retries, maxsize=2000, block=True
27
27
  )
28
28
 
29
29
  http_client_wo_cert_verification = urllib3.poolmanager.PoolManager(
30
- cert_reqs="CERT_NONE", num_pools=20, retries=retries
30
+ cert_reqs="CERT_NONE", num_pools=20, retries=retries, maxsize=2000, block=True
31
31
  )
32
32
 
33
33
  class AcceleratorTerminalCliProjectService:
@@ -93,11 +93,11 @@ class AcceleratorTerminalCliProjectService:
93
93
 
94
94
  return todict(res.data)
95
95
 
96
- def get_file_url_from_repo(self, filename):
96
+ def get_file_url_from_repo(self, filename, token_pass=""):
97
97
  project_slug = filename.split('/')[0]
98
98
  res = self.http_client_request(
99
99
  "GET",
100
- f"{self.cli_base_url}/{project_slug}/get-file-download-url/?filename={filename}",
100
+ f"{self.cli_base_url}/{project_slug}/get-file-download-url/?filename={filename}&token_pass={token_pass}",
101
101
  headers=self.common_request_headers
102
102
  )
103
103
  if res.data:
@@ -363,5 +363,17 @@ class AcceleratorTerminalCliProjectService:
363
363
  )
364
364
 
365
365
  raise err
366
+
367
+
368
+ def enumerate_files_by_prefix(self, prefix, token_pass=""):
369
+ project_slug = prefix.split('/')[0]
366
370
 
367
-
371
+ b64_encoded_prefix = base64.b64encode(prefix.encode()).decode()
372
+
373
+ res = self.http_client_request(
374
+ "GET",
375
+ f"{self.cli_base_url}/{project_slug}/enumerate-all-files/{b64_encoded_prefix}/?token_pass={token_pass}",
376
+ headers=self.common_request_headers
377
+ )
378
+ if res.data:
379
+ return todict(res.data)
@@ -1,3 +1,3 @@
1
1
  # Please strictly put double quote to use this info for git tag
2
2
  # Read developer guide for git tag command with regex
3
- VERSION = "v0.7.11"
3
+ VERSION = "v1.0.0"
@@ -3,6 +3,7 @@ import click
3
3
  import glob
4
4
  import os
5
5
  import typer
6
+ from pathlib import Path
6
7
  import requests
7
8
  import warnings
8
9
  import importlib.util
@@ -49,7 +50,7 @@ def about():
49
50
 
50
51
  @app.command()
51
52
  def login(
52
- server: Annotated[str, typer.Option(..., '-s',help="Accelerator server url.")] = "https://accelerator-api.iiasa.ac.at",
53
+ server: Annotated[str, typer.Option(..., '-s',help="Accelerator server url.")] = "https://accelerator.iiasa.ac.at",
53
54
  webcli: Annotated[str, typer.Option(..., '-c', help="Accelerator web client for authorization.")] = "https://accelerator.iiasa.ac.at"
54
55
  ):
55
56
  print(
@@ -157,7 +158,7 @@ def validate(
157
158
  project_slug: Annotated[str, typer.Argument(help="Unique Accelerator project slug.")],
158
159
  template_slug: Annotated[str, typer.Argument(help="Unique project template slug")],
159
160
  filepath: Annotated[str, typer.Argument(help="Path of the file to validate")],
160
- server: Annotated[str, typer.Option(..., '-s',help="Accelerator server url.")] = "https://accelerator-api.iiasa.ac.at",
161
+ server: Annotated[str, typer.Option(..., '-s',help="Accelerator server url.")] = "https://accelerator.iiasa.ac.at",
161
162
  ):
162
163
 
163
164
 
@@ -180,7 +181,7 @@ def validate(
180
181
  def dispatch(
181
182
  project_slug: Annotated[str, typer.Argument(help="Unique Accelerator project slug.")],
182
183
  root_task_variable: Annotated[str, typer.Argument(help="Root task variable in workflow_file.")],
183
- server: Annotated[str, typer.Option(..., '-s', help="Accelerator server url.")] = "https://accelerator-api.iiasa.ac.at",
184
+ server: Annotated[str, typer.Option(..., '-s', help="Accelerator server url.")] = "https://accelerator.iiasa.ac.at",
184
185
  workflow_filename: Annotated[str, typer.Option(..., '-f', help="Python workflow filepath.")] = "wkube.py"
185
186
  ):
186
187
  set_project_slug(project_slug)
@@ -222,5 +223,66 @@ def dispatch(
222
223
 
223
224
  print(f"Dispatched root job #ID: {root_job_id}")
224
225
 
226
+ @app.command()
227
+ def copy(
228
+ acc_src: Annotated[str, typer.Argument(help="Source path in Accelerator project space")],
229
+ destination: Annotated[str, typer.Option(..., "-d", help="Destination directory")] = "./",
230
+ token_pass: Annotated[str, typer.Option(..., "-t", help="Destination directory")] = "",
231
+ ):
232
+ access_token = get_token()
233
+ server_url = get_server_url()
234
+
235
+ term_cli_project_service = AcceleratorTerminalCliProjectService(
236
+ user_token=access_token,
237
+ server_url=server_url,
238
+ verify_cert=(not ACCLI_DEBUG),
239
+ )
240
+
241
+ dest_path = Path(destination).expanduser().resolve()
242
+ dest_path.mkdir(parents=True, exist_ok=True)
225
243
 
244
+ filenames: list[str] = term_cli_project_service.enumerate_files_by_prefix(acc_src, token_pass=token_pass)
245
+
246
+ with Progress(
247
+ TextColumn("[progress.description]{task.description}"),
248
+ BarColumn(),
249
+ TaskProgressColumn(),
250
+ TimeElapsedColumn(),
251
+ transient=True,
252
+ ) as progress:
226
253
 
254
+ for filename in filenames:
255
+ local_file = dest_path / filename
256
+ local_file.parent.mkdir(parents=True, exist_ok=True)
257
+
258
+ final_file = local_file
259
+ partial_file = local_file.with_suffix(local_file.suffix + ".part")
260
+
261
+ if final_file.exists():
262
+ typer.echo(f"Skipping {final_file} (already exists)")
263
+ continue
264
+
265
+ typer.echo(f"Downloading {filename} -> {final_file}")
266
+ try:
267
+ file_url = term_cli_project_service.get_file_url_from_repo(filename, token_pass=token_pass)
268
+ with requests.get(file_url, stream=True, verify=(not ACCLI_DEBUG)) as r:
269
+ r.raise_for_status()
270
+ total = int(r.headers.get("Content-Length", 0))
271
+
272
+ task = progress.add_task(
273
+ f"[cyan]Downloading {filename}", total=total or None
274
+ )
275
+
276
+ with open(partial_file, "wb") as f:
277
+ for chunk in r.iter_content(chunk_size=8192):
278
+ if chunk:
279
+ f.write(chunk)
280
+ progress.update(task, advance=len(chunk))
281
+
282
+ partial_file.rename(final_file)
283
+ typer.echo(f"✔ Downloaded {final_file}")
284
+
285
+ except Exception as e:
286
+ if partial_file.exists():
287
+ partial_file.unlink()
288
+ typer.echo(f"✖ Failed to download {filename}: {e}", err=True)
@@ -0,0 +1,148 @@
1
+ Metadata-Version: 2.1
2
+ Name: accli
3
+ Version: 1.0.0
4
+ Summary: IIASA Accelerator Client
5
+ Author-email: Wrufesh S <wrufesh@gmail.com>
6
+ License: The MIT License (MIT)
7
+
8
+ Copyright (c) 2018 Sebastián Ramírez
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+ Project-URL: Homepage, https://github.com/iiasa/accli
28
+ Project-URL: Bug Tracker, https://github.com/iiasa/accli/issues
29
+ Classifier: Programming Language :: Python :: 3
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Operating System :: OS Independent
32
+ Requires-Python: >=3.7
33
+ Description-Content-Type: text/markdown
34
+ License-File: LICENSE
35
+
36
+
37
+ # Accelerator Terminal Client and Python API
38
+
39
+ This package provides:
40
+
41
+ - A **command-line client** (`accli`) for interacting with the **Accelerator**.
42
+ - A **Python API** via the `accli` package.
43
+
44
+ Both interfaces communicate with the Accelerator’s REST API, implemented in the [Control Services Backend](https://github.com/iiasa/control_services_backend).
45
+
46
+ ---
47
+
48
+ ## 🔐 Authentication
49
+
50
+ This client uses **device authentication** via Auth0.
51
+
52
+ - **OAuth Flow**: [Device Authorization Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow)
53
+ - **Token Validity**: 7 days
54
+ - **Access Control**: Role-Based Access Control (RBAC) with stateless tokens
55
+ - **Grants**: Limited and scoped
56
+
57
+ ---
58
+
59
+ ## 📖 User Guide
60
+
61
+ ### ✅ Requirements
62
+
63
+ - Python >= 3.7.17
64
+
65
+ ### 📦 Installation
66
+
67
+ ```bash
68
+ pip install accli --user
69
+ ```
70
+
71
+ ### ▶️ Usage
72
+
73
+ #### As a Python Module
74
+
75
+ ```bash
76
+ python -m accli
77
+ ```
78
+
79
+ #### As an Executable
80
+
81
+ After installation, the executable might not be in your system `PATH`. You may see a warning like this:
82
+
83
+ ```
84
+ WARNING: The script accli.exe is installed in 'C:\Users\<user>\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
85
+ Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
86
+ ```
87
+
88
+ To resolve this, add the script's path to your system's environment variables:
89
+
90
+ - [Update PATH on Windows](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho)
91
+ - [Update PATH on Linux](https://www.geeksforgeeks.org/how-to-set-path-permanantly-in-linux/)
92
+
93
+ > **Note:** On Linux/macOS, you may need to prefix the command with `./`, and on Windows, with `.\`.
94
+
95
+ ### 🔍 Help Command
96
+
97
+ ```bash
98
+ accli --help
99
+ ```
100
+
101
+ **Sample Output:**
102
+
103
+ ```
104
+ Usage: accli [OPTIONS] COMMAND [ARGS]...
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 👩‍💻 Developer Guide
110
+
111
+ ### 🛠 Build & Upload
112
+
113
+ Follow the official Python packaging tutorial:
114
+ [Packaging Projects – Python.org](https://packaging.python.org/en/latest/tutorials/packaging-projects/)
115
+
116
+ ### 🚀 Release Process
117
+
118
+ 1. Update the version in `accli/_version.py`
119
+ 2. Tag the release:
120
+
121
+ ```bash
122
+ python scripts/tag.py
123
+ ```
124
+
125
+ 3. Build the package:
126
+
127
+ ```bash
128
+ python -m build
129
+ ```
130
+
131
+ 4. Upload to PyPI:
132
+
133
+ ```bash
134
+ twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*
135
+ ```
136
+
137
+ ---
138
+
139
+ ## 🧪 Experimental
140
+
141
+ Consider bundling with Nuitka:
142
+
143
+ ```bash
144
+ nuitka --standalone --onefile --static-libpython=yes \
145
+ --include-package=accli \
146
+ --output-dir=build \
147
+ -m accli.cli:app
148
+ ```
accli-0.7.11/PKG-INFO DELETED
@@ -1,96 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: accli
3
- Version: 0.7.11
4
- Summary: IIASA Accelerator Client
5
- Author-email: Wrufesh S <wrufesh@gmail.com>
6
- License: The MIT License (MIT)
7
-
8
- Copyright (c) 2018 Sebastián Ramírez
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in
18
- all copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
- THE SOFTWARE.
27
- Project-URL: Homepage, https://github.com/iiasa/accli
28
- Project-URL: Bug Tracker, https://github.com/iiasa/accli/issues
29
- Classifier: Programming Language :: Python :: 3
30
- Classifier: License :: OSI Approved :: MIT License
31
- Classifier: Operating System :: OS Independent
32
- Requires-Python: >=3.7
33
- Description-Content-Type: text/markdown
34
- License-File: LICENSE
35
-
36
- # Accelerator terminal client and Python API
37
-
38
- Provides a command-line client for interacting with the Accelerator as well as a Python API in the form of the `accli` package. These communicate with the rest API of the Accelerator [Control Services Backend](https://github.com/iiasa/control_services_backend).
39
-
40
- Uses device authentication:
41
- - Part 0Auth: [Device Authentication Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow).
42
- - Auth valid for 7 days.
43
- - Grants are limited.
44
- - Access via RBAC:
45
- * Stateless tokens.
46
-
47
- ## User Guide
48
-
49
- **Requirements**
50
- * Python >=3.7.17
51
-
52
- **Installation**
53
-
54
- `pip install accli --user`
55
-
56
- **Usage as module**
57
-
58
- `python -m accli`
59
-
60
- **Usage as executable**
61
-
62
- *You might receive following similar warning during installation*
63
- ```
64
- WARNING: The script accli.exe is installed in 'C:\Users\singhr\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
65
- Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
66
- ```
67
-
68
- *You could also add executable directory path in PATH environment variable. Please follow following links for instruction on adding executable directory path to PATH environemnt variable.*
69
-
70
- [Updating PATH on windows](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho)
71
-
72
- [Updating PATH on linux](https://www.geeksforgeeks.org/how-to-set-path-permanantly-in-linux/)
73
-
74
- **Command**
75
-
76
- `accli --help`
77
-
78
- *Output*
79
-
80
- `Usage: accli [OPTIONS] COMMAND [ARGS]...`
81
-
82
- *Note: You may need to prepend the command with either `./`(in linux) or `.\`(in winodws).*
83
-
84
-
85
- ## Developer Guide
86
- **General build and upload instructions**
87
- Please follow [this link.](https://packaging.python.org/en/latest/tutorials/packaging-projects/)
88
-
89
- **Release process**
90
- 1. Commit with right version on accli/_version.py
91
- 2. Run 'python scripts/tag.py'
92
- 3. `python -m build`
93
- 4. `twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*`
94
-
95
-
96
- #TODO nuitka --standalone --onefile --static-libpython=yes --include-package=accli --output-dir=build -m accli.cli:app
accli-0.7.11/README.md DELETED
@@ -1,61 +0,0 @@
1
- # Accelerator terminal client and Python API
2
-
3
- Provides a command-line client for interacting with the Accelerator as well as a Python API in the form of the `accli` package. These communicate with the rest API of the Accelerator [Control Services Backend](https://github.com/iiasa/control_services_backend).
4
-
5
- Uses device authentication:
6
- - Part 0Auth: [Device Authentication Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow).
7
- - Auth valid for 7 days.
8
- - Grants are limited.
9
- - Access via RBAC:
10
- * Stateless tokens.
11
-
12
- ## User Guide
13
-
14
- **Requirements**
15
- * Python >=3.7.17
16
-
17
- **Installation**
18
-
19
- `pip install accli --user`
20
-
21
- **Usage as module**
22
-
23
- `python -m accli`
24
-
25
- **Usage as executable**
26
-
27
- *You might receive following similar warning during installation*
28
- ```
29
- WARNING: The script accli.exe is installed in 'C:\Users\singhr\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
30
- Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
31
- ```
32
-
33
- *You could also add executable directory path in PATH environment variable. Please follow following links for instruction on adding executable directory path to PATH environemnt variable.*
34
-
35
- [Updating PATH on windows](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho)
36
-
37
- [Updating PATH on linux](https://www.geeksforgeeks.org/how-to-set-path-permanantly-in-linux/)
38
-
39
- **Command**
40
-
41
- `accli --help`
42
-
43
- *Output*
44
-
45
- `Usage: accli [OPTIONS] COMMAND [ARGS]...`
46
-
47
- *Note: You may need to prepend the command with either `./`(in linux) or `.\`(in winodws).*
48
-
49
-
50
- ## Developer Guide
51
- **General build and upload instructions**
52
- Please follow [this link.](https://packaging.python.org/en/latest/tutorials/packaging-projects/)
53
-
54
- **Release process**
55
- 1. Commit with right version on accli/_version.py
56
- 2. Run 'python scripts/tag.py'
57
- 3. `python -m build`
58
- 4. `twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*`
59
-
60
-
61
- #TODO nuitka --standalone --onefile --static-libpython=yes --include-package=accli --output-dir=build -m accli.cli:app
@@ -1,96 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: accli
3
- Version: 0.7.11
4
- Summary: IIASA Accelerator Client
5
- Author-email: Wrufesh S <wrufesh@gmail.com>
6
- License: The MIT License (MIT)
7
-
8
- Copyright (c) 2018 Sebastián Ramírez
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in
18
- all copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
- THE SOFTWARE.
27
- Project-URL: Homepage, https://github.com/iiasa/accli
28
- Project-URL: Bug Tracker, https://github.com/iiasa/accli/issues
29
- Classifier: Programming Language :: Python :: 3
30
- Classifier: License :: OSI Approved :: MIT License
31
- Classifier: Operating System :: OS Independent
32
- Requires-Python: >=3.7
33
- Description-Content-Type: text/markdown
34
- License-File: LICENSE
35
-
36
- # Accelerator terminal client and Python API
37
-
38
- Provides a command-line client for interacting with the Accelerator as well as a Python API in the form of the `accli` package. These communicate with the rest API of the Accelerator [Control Services Backend](https://github.com/iiasa/control_services_backend).
39
-
40
- Uses device authentication:
41
- - Part 0Auth: [Device Authentication Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow).
42
- - Auth valid for 7 days.
43
- - Grants are limited.
44
- - Access via RBAC:
45
- * Stateless tokens.
46
-
47
- ## User Guide
48
-
49
- **Requirements**
50
- * Python >=3.7.17
51
-
52
- **Installation**
53
-
54
- `pip install accli --user`
55
-
56
- **Usage as module**
57
-
58
- `python -m accli`
59
-
60
- **Usage as executable**
61
-
62
- *You might receive following similar warning during installation*
63
- ```
64
- WARNING: The script accli.exe is installed in 'C:\Users\singhr\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
65
- Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
66
- ```
67
-
68
- *You could also add executable directory path in PATH environment variable. Please follow following links for instruction on adding executable directory path to PATH environemnt variable.*
69
-
70
- [Updating PATH on windows](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho)
71
-
72
- [Updating PATH on linux](https://www.geeksforgeeks.org/how-to-set-path-permanantly-in-linux/)
73
-
74
- **Command**
75
-
76
- `accli --help`
77
-
78
- *Output*
79
-
80
- `Usage: accli [OPTIONS] COMMAND [ARGS]...`
81
-
82
- *Note: You may need to prepend the command with either `./`(in linux) or `.\`(in winodws).*
83
-
84
-
85
- ## Developer Guide
86
- **General build and upload instructions**
87
- Please follow [this link.](https://packaging.python.org/en/latest/tutorials/packaging-projects/)
88
-
89
- **Release process**
90
- 1. Commit with right version on accli/_version.py
91
- 2. Run 'python scripts/tag.py'
92
- 3. `python -m build`
93
- 4. `twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*`
94
-
95
-
96
- #TODO nuitka --standalone --onefile --static-libpython=yes --include-package=accli --output-dir=build -m accli.cli:app
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes