devs-cli 3.2.4__py3-none-any.whl → 3.3.0__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.
- devs/cli.py +22 -16
- {devs_cli-3.2.4.dist-info → devs_cli-3.3.0.dist-info}/METADATA +1 -1
- {devs_cli-3.2.4.dist-info → devs_cli-3.3.0.dist-info}/RECORD +7 -7
- {devs_cli-3.2.4.dist-info → devs_cli-3.3.0.dist-info}/WHEEL +0 -0
- {devs_cli-3.2.4.dist-info → devs_cli-3.3.0.dist-info}/entry_points.txt +0 -0
- {devs_cli-3.2.4.dist-info → devs_cli-3.3.0.dist-info}/licenses/LICENSE +0 -0
- {devs_cli-3.2.4.dist-info → devs_cli-3.3.0.dist-info}/top_level.txt +0 -0
devs/cli.py
CHANGED
|
@@ -168,46 +168,52 @@ def cli(ctx, debug: bool, repo: str) -> None:
|
|
|
168
168
|
@cli.command()
|
|
169
169
|
@click.argument('dev_names', nargs=-1, required=True)
|
|
170
170
|
@click.option('--rebuild', is_flag=True, help='Force rebuild of container images')
|
|
171
|
+
@click.option('--rebuild-if-changed', 'rebuild_if_changed', is_flag=True, help='Rebuild if devcontainer files have changed since last build')
|
|
171
172
|
@click.option('--live', is_flag=True, help='Mount current directory as workspace instead of copying')
|
|
172
173
|
@click.option('--env', multiple=True, help='Environment variables to pass to container (format: VAR=value)')
|
|
173
174
|
@debug_option
|
|
174
|
-
def start(dev_names: tuple, rebuild: bool, live: bool, env: tuple, debug: bool) -> None:
|
|
175
|
+
def start(dev_names: tuple, rebuild: bool, rebuild_if_changed: bool, live: bool, env: tuple, debug: bool) -> None:
|
|
175
176
|
"""Start named devcontainers.
|
|
176
|
-
|
|
177
|
+
|
|
177
178
|
DEV_NAMES: One or more development environment names to start
|
|
178
|
-
|
|
179
|
+
|
|
179
180
|
Example: devs start sally bob
|
|
180
181
|
Example: devs start sally --live # Mount current directory directly
|
|
182
|
+
Example: devs start sally --rebuild-if-changed # Rebuild only if devcontainer files changed
|
|
181
183
|
Example: devs start sally --env QUART_PORT=5001 --env DB_HOST=localhost:3307
|
|
182
184
|
"""
|
|
183
185
|
check_dependencies()
|
|
184
186
|
project = get_project()
|
|
185
|
-
|
|
187
|
+
|
|
186
188
|
console.print(f"🚀 Starting devcontainers for project: {project.info.name}")
|
|
187
|
-
|
|
189
|
+
|
|
188
190
|
container_manager = ContainerManager(project, config)
|
|
189
191
|
workspace_manager = WorkspaceManager(project, config)
|
|
190
|
-
|
|
192
|
+
|
|
191
193
|
for dev_name in dev_names:
|
|
192
194
|
console.print(f" Starting: {dev_name}")
|
|
193
|
-
|
|
195
|
+
|
|
194
196
|
# Load environment variables from DEVS.yml and merge with CLI --env flags
|
|
195
197
|
devs_env = DevsConfigLoader.load_env_vars(dev_name, project.info.name)
|
|
196
198
|
cli_env = parse_env_vars(env) if env else {}
|
|
197
199
|
extra_env = merge_env_vars(devs_env, cli_env) if devs_env or cli_env else None
|
|
198
|
-
|
|
200
|
+
|
|
199
201
|
if extra_env:
|
|
200
202
|
console.print(f"🔧 Environment variables: {', '.join(f'{k}={v}' for k, v in extra_env.items())}")
|
|
201
|
-
|
|
203
|
+
|
|
202
204
|
try:
|
|
203
205
|
# Create/ensure workspace exists (handles live mode internally)
|
|
204
206
|
workspace_dir = workspace_manager.create_workspace(dev_name, live=live)
|
|
205
|
-
|
|
206
|
-
# Ensure container is running
|
|
207
|
+
|
|
208
|
+
# Ensure container is running.
|
|
209
|
+
# --rebuild: always force a full rebuild
|
|
210
|
+
# --rebuild-if-changed: rebuild only when devcontainer file content has changed
|
|
211
|
+
# (default): never auto-rebuild
|
|
207
212
|
if container_manager.ensure_container_running(
|
|
208
|
-
dev_name,
|
|
209
|
-
workspace_dir,
|
|
213
|
+
dev_name,
|
|
214
|
+
workspace_dir,
|
|
210
215
|
force_rebuild=rebuild,
|
|
216
|
+
check_rebuild=rebuild_if_changed,
|
|
211
217
|
debug=debug,
|
|
212
218
|
live=live,
|
|
213
219
|
extra_env=extra_env
|
|
@@ -215,7 +221,7 @@ def start(dev_names: tuple, rebuild: bool, live: bool, env: tuple, debug: bool)
|
|
|
215
221
|
continue
|
|
216
222
|
else:
|
|
217
223
|
console.print(f" ⚠️ Failed to start {dev_name}, continuing with others...")
|
|
218
|
-
|
|
224
|
+
|
|
219
225
|
except (ContainerError, WorkspaceError) as e:
|
|
220
226
|
console.print(f" ❌ Error starting {dev_name}: {e}")
|
|
221
227
|
continue
|
|
@@ -268,8 +274,8 @@ def vscode(dev_names: tuple, delay: float, live: bool, env: tuple, debug: bool)
|
|
|
268
274
|
# Ensure workspace exists (handles live mode internally)
|
|
269
275
|
workspace_dir = workspace_manager.create_workspace(dev_name, live=live)
|
|
270
276
|
|
|
271
|
-
# Ensure container is running before launching VS Code
|
|
272
|
-
if container_manager.ensure_container_running(dev_name, workspace_dir, debug=debug, live=live, extra_env=extra_env):
|
|
277
|
+
# Ensure container is running before launching VS Code (no auto-rebuild in CLI)
|
|
278
|
+
if container_manager.ensure_container_running(dev_name, workspace_dir, check_rebuild=False, debug=debug, live=live, extra_env=extra_env):
|
|
273
279
|
workspace_dirs.append(workspace_dir)
|
|
274
280
|
valid_dev_names.append(dev_name)
|
|
275
281
|
else:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
devs/__init__.py,sha256=dMk0J_JrmBmknPvt6HNUa04qxgHYpxhnIXa3PZFk_N0,571
|
|
2
|
-
devs/cli.py,sha256=
|
|
2
|
+
devs/cli.py,sha256=XfFBGkr7k4AHNKDos1It-71h2jQBj-I4Av2QIKs7l1Y,42022
|
|
3
3
|
devs/config.py,sha256=DaS2_1x0h63cHn34RmWbEhUx_1u3-sAo16tM3AXMKfQ,1561
|
|
4
4
|
devs/exceptions.py,sha256=7xO7ihJu_U6CupZPMv89B4N5EBSUcdj2OdA6GPAFPEE,490
|
|
5
5
|
devs/core/__init__.py,sha256=TPy3eZi-AEztci_QZ37YAAl2zvUQlwBALpyiQx2ED7Q,363
|
|
6
6
|
devs/core/integration.py,sha256=YOz03TvS5Rk8YYnPT_rbEB_EMjpkOY4Z7OEzeP-6ZZQ,11055
|
|
7
7
|
devs/utils/__init__.py,sha256=f-sEWETPfW2Xkaxgd-l6FS-jIQAorLlQZOicIZvp-W0,638
|
|
8
|
-
devs_cli-3.
|
|
9
|
-
devs_cli-3.
|
|
10
|
-
devs_cli-3.
|
|
11
|
-
devs_cli-3.
|
|
12
|
-
devs_cli-3.
|
|
13
|
-
devs_cli-3.
|
|
8
|
+
devs_cli-3.3.0.dist-info/licenses/LICENSE,sha256=bi2EUiv-lmC_quQVkNqzTYXJpjVarkPsVKfqhJl7ccQ,1067
|
|
9
|
+
devs_cli-3.3.0.dist-info/METADATA,sha256=CIhCEEg_9xJyWSBMJx07sLuEse3MrcRZX2ti39YngDs,5282
|
|
10
|
+
devs_cli-3.3.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
11
|
+
devs_cli-3.3.0.dist-info/entry_points.txt,sha256=s8-pgqZ1QvzPJgHP9vNxwBYdezmGsFdRUHacJPZ4WOs,39
|
|
12
|
+
devs_cli-3.3.0.dist-info/top_level.txt,sha256=9RIVUPVGuOdO84qkBh_9XcKoTV7773o3py78wz2-IZk,5
|
|
13
|
+
devs_cli-3.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|