thestage 0.5.41__py3-none-any.whl → 0.5.42__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.
thestage/.env ADDED
@@ -0,0 +1,6 @@
1
+ THESTAGE_CONFIG_DIR=.thestage
2
+ THESTAGE_CONFIG_FILE=config.json
3
+ THESTAGE_CLI_ENV=DEV
4
+ THESTAGE_API_URL=https://backend-staging.thestage.ai
5
+ THESTAGE_API_URL=https://backend.thestage.ai
6
+ LOG_FILE=thestage.log
thestage/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from . import *
2
2
  __app_name__ = "thestage"
3
- __version__ = "0.5.41"
3
+ __version__ = "0.5.42"
@@ -1,7 +1,9 @@
1
1
  import time
2
+ from pathlib import Path
2
3
  from typing import Optional, List
3
4
 
4
5
  import re
6
+
5
7
  import typer
6
8
  from typing_extensions import Annotated
7
9
 
@@ -425,6 +427,13 @@ def run_inference_simulator(
425
427
  help=__("Disable real-time log streaming"),
426
428
  is_eager=False,
427
429
  ),
430
+ is_skip_installation: Optional[bool] = typer.Option(
431
+ False,
432
+ "--skip-installation",
433
+ "-si",
434
+ help=__("Skip installing dependencies from requirements.txt and install.sh"),
435
+ is_eager=False,
436
+ ),
428
437
  ):
429
438
  """
430
439
  Run an inference simulator within a project
@@ -438,6 +447,35 @@ def run_inference_simulator(
438
447
  service_factory = validate_config_and_get_service_factory(working_directory=working_directory)
439
448
  config = service_factory.get_config_provider().get_full_config()
440
449
 
450
+ working_dir_path = Path(working_directory) if working_directory else Path(config.runtime.working_directory)
451
+ inference_files = list(working_dir_path.rglob("inference.py"))
452
+ if not inference_files:
453
+ typer.echo("No inference.py file found in the project directory.")
454
+ raise typer.Exit(1)
455
+ elif len(inference_files) == 1:
456
+ selected_inference = inference_files[0]
457
+ else:
458
+ choices = [str(path.relative_to(working_dir_path)) for path in inference_files]
459
+ typer.echo("Multiple inference.py files found:")
460
+ for idx, choice in enumerate(choices, start=1):
461
+ typer.echo(f"{idx}) {choice}")
462
+ choice_str = typer.prompt("Choose which inference.py to use")
463
+ try:
464
+ choice_index = int(choice_str)
465
+ except ValueError:
466
+ raise typer.BadParameter("Invalid input. Please enter a number.")
467
+ if not (1 <= choice_index <= len(choices)):
468
+ raise typer.BadParameter("Choice out of range.")
469
+ selected_inference = inference_files[choice_index - 1]
470
+
471
+ relative_inference = selected_inference.relative_to(working_dir_path)
472
+ parent_dir = relative_inference.parent
473
+ if parent_dir == Path("."):
474
+ inference_dir = "/"
475
+ else:
476
+ inference_dir = f"{parent_dir.as_posix()}/"
477
+ typer.echo(f"Selected inference file relative path: {inference_dir}")
478
+
441
479
  project_service = service_factory.get_project_service()
442
480
 
443
481
  project_service.project_run_inference_simulator(
@@ -446,6 +484,8 @@ def run_inference_simulator(
446
484
  slug=unique_id,
447
485
  rented_instance_unique_id=rented_instance_unique_id,
448
486
  self_hosted_instance_unique_id=self_hosted_instance_unique_id,
487
+ inference_dir=inference_dir,
488
+ is_skip_installation=is_skip_installation,
449
489
  )
450
490
 
451
491
  if enable_log_stream:
@@ -603,6 +603,8 @@ class TheStageApiClient(TheStageApiClientCore):
603
603
  commit_hash: Optional[str] = None,
604
604
  rented_instance_unique_id: Optional[str] = None,
605
605
  self_hosted_instance_unique_id: Optional[str] = None,
606
+ inference_dir: Optional[str] = None,
607
+ is_skip_installation: Optional[bool] = False,
606
608
  ) -> Optional[ProjectStartInferenceSimulatorResponse]:
607
609
  request = ProjectStartInferenceSimulatorRequest(
608
610
  projectSlug=project_slug,
@@ -610,6 +612,8 @@ class TheStageApiClient(TheStageApiClientCore):
610
612
  slug=slug,
611
613
  instanceRentedUId=rented_instance_unique_id,
612
614
  selfhostedInstanceUId=self_hosted_instance_unique_id,
615
+ inferenceDir=inference_dir,
616
+ isSkipInstallation=is_skip_installation,
613
617
  )
614
618
 
615
619
  response = self._request(
@@ -10,4 +10,6 @@ class ProjectStartInferenceSimulatorRequest(BaseModel):
10
10
  instanceRentedUId: Optional[str] = Field(None, alias='instanceRentedUId')
11
11
  selfhostedInstanceUId: Optional[str] = Field(None, alias='selfhostedInstanceUId')
12
12
  commitHash: Optional[str] = Field(None, alias='commitHash')
13
- slug: Optional[str] = Field(None, alias='slug')
13
+ slug: Optional[str] = Field(None, alias='slug')
14
+ inferenceDir: Optional[str] = Field(None, alias='inferenceDir')
15
+ isSkipInstallation: Optional[bool] = Field(False, alias='isSkipInstallation')
@@ -409,6 +409,8 @@ class ProjectService(AbstractService):
409
409
  commit_hash: Optional[str] = None,
410
410
  rented_instance_unique_id: Optional[str] = None,
411
411
  self_hosted_instance_unique_id: Optional[str] = None,
412
+ inference_dir: Optional[str] = None,
413
+ is_skip_installation: Optional[bool] = False,
412
414
  ) -> Optional[InferenceSimulatorDto]:
413
415
  project_config: ProjectConfig = self.__get_fixed_project_config(config=config)
414
416
  if not project_config:
@@ -543,6 +545,8 @@ class ProjectService(AbstractService):
543
545
  slug=slug,
544
546
  rented_instance_unique_id=rented_instance_unique_id,
545
547
  self_hosted_instance_unique_id=self_hosted_instance_unique_id,
548
+ inference_dir=inference_dir,
549
+ is_skip_installation=is_skip_installation,
546
550
  )
547
551
  if start_inference_simulator_response:
548
552
  if start_inference_simulator_response.message:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.1
2
2
  Name: thestage
3
- Version: 0.5.41
3
+ Version: 0.5.42
4
4
  Summary:
5
5
  Author: TheStage AI team
6
6
  Author-email: hello@thestage.ai
@@ -10,7 +10,6 @@ Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
13
  Requires-Dist: aioconsole (>=0.8.0,<0.9.0)
15
14
  Requires-Dist: boto3 (>=1.35.80,<2.0.0)
16
15
  Requires-Dist: gitpython (>=3.1.40,<4.0.0)
@@ -1,4 +1,5 @@
1
- thestage/__init__.py,sha256=VZwLTO9zP1X39kXdNyRFETyBnYYkrk_E4w1gxiko0qA,65
1
+ thestage/.env,sha256=e0VVlgIiJ9t4WkAN89-LEhNoNvuUpV8_dtOrK2itceo,204
2
+ thestage/__init__.py,sha256=8DQOEFc-GcQ1tUrRo3xU6B3cmSvF3Za_ORmutJb4OrY,65
2
3
  thestage/__main__.py,sha256=4ObdWrDRaIASaR06IxtFSsoMu58eyL0MnD64habvPj8,101
3
4
  thestage/color_scheme/color_scheme.py,sha256=jzdRCX0hi_XStXi4kvPHVItKlTm7dsD3fHIdeRQLeKw,87
4
5
  thestage/config/__init__.py,sha256=RNobilYVK1WAM1utcQ8ZuATKc9Zh9M9BAjCLZTnR_TA,428
@@ -8,7 +9,7 @@ thestage/controllers/base_controller.py,sha256=lX0XsBc7ZEPD_I56cN8IBAVuWGIkOkr7J
8
9
  thestage/controllers/config_controller.py,sha256=Gzd61UeU1igFT4QUyrZ4dOo_QaNEuXuSEIroXpbBhPA,5365
9
10
  thestage/controllers/container_controller.py,sha256=C3WC-Ypeg-vpC8LyCcPZVszbiaDYf2aQzTxYC2PPG8g,15210
10
11
  thestage/controllers/instance_controller.py,sha256=pFhkO7U2Ta0_1dzskEj8hbE7Izw_7I4SDbq5O5-bfIY,9757
11
- thestage/controllers/project_controller.py,sha256=M15b-VhThEhI1eOTX7r3njFnHAWK-tcLc23etOOKTj0,32527
12
+ thestage/controllers/project_controller.py,sha256=yxYBed4fHGjw9ofQSXNg2TUPobGrFj9lb5_iHATuYfA,34274
12
13
  thestage/controllers/utils_controller.py,sha256=FV35yte7jTZRzy2DaL3OZCNzmlVrsNKxksC8P0FD7hM,1030
13
14
  thestage/debug_main.dist.py,sha256=UPIJ58yf-6FtXZj-FLAwxi7HononseuCYm9xb5KlxTs,783
14
15
  thestage/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -47,12 +48,11 @@ thestage/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
47
48
  thestage/services/abstract_mapper.py,sha256=_q7YLkPNRsNW5wOCqvZIu1KfpLkc7uVaAQKrMZtsGuY,218
48
49
  thestage/services/abstract_service.py,sha256=1PBkO8pFkPmNk1VxUIxED0H3ZStCqAcFw7QGBlzkoh4,3963
49
50
  thestage/services/app_config_service.py,sha256=a7zrbVCJx6XCSRCMv346AYQ_gV3fzw8g7EzunZJ-CIY,1655
50
- thestage/services/clients/.DS_Store,sha256=EYALnKLNXhZ-2jJTMck8Fo1bIxlFCvaXGUUUf-lgHxM,6148
51
51
  thestage/services/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  thestage/services/clients/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  thestage/services/clients/git/git_client.py,sha256=-5WSoDj0Fi6PJD_Eo04ne83Z6IGQ85qa4eVmIsLnpb4,11737
54
54
  thestage/services/clients/thestage_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
- thestage/services/clients/thestage_api/api_client.py,sha256=BSxG6_FzoTCBub-24Hffwo6IsfAPhdzYqpfpediWucY,29396
55
+ thestage/services/clients/thestage_api/api_client.py,sha256=FeP9ltSZqrra5j9PTy-JBIw3S-LOWG_q9CddXsmtBV4,29596
56
56
  thestage/services/clients/thestage_api/core/api_client_abstract.py,sha256=nJ0OiT4Ecexp-3HHK332pvyzrf1JsZ1WQYdvn-aeIL8,2984
57
57
  thestage/services/clients/thestage_api/core/api_client_core.py,sha256=WwtzdTAxog-l2UU8Up40BxepgM7OTXn-XHgzlHorXT0,908
58
58
  thestage/services/clients/thestage_api/core/http_client_exception.py,sha256=JH-874Gu9T1b1_FpPBLqdyt9U0PyhpwRCe_oDc6c_jI,385
@@ -116,7 +116,7 @@ thestage/services/clients/thestage_api/dtos/project_controller/project_push_infe
116
116
  thestage/services/clients/thestage_api/dtos/project_controller/project_push_inference_simulator_model_response.py,sha256=aNaD4xVkhbwlD_rI3D0-2gp-F4L6CxxUkAOSLJZPl1I,249
117
117
  thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_request.py,sha256=ZFe2uGseJGwixBh380zpaotb_aWUidrqUSYoqe-y4jE,660
118
118
  thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_response.py,sha256=iISmJTHbxSRJsXHT4qBTMP3-Co9fWCHI5s2UgB_-GV8,340
119
- thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_request.py,sha256=YtyM678EYehdCNAiwrEbWsXNsoRDtWeW1t96V7LLAFw,525
119
+ thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_request.py,sha256=TMLXtRAy1Z66xt-XmLS-88tDwuWBA3srz6w-uAlM71U,675
120
120
  thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_response.py,sha256=Q7XlbZ4vgk9QQL2z11BeUkKDn-5p8j06eNI0GmpZNjk,430
121
121
  thestage/services/clients/thestage_api/dtos/project_response.py,sha256=PQ0L14_8akc5ADZeL_Y15Z2Hlvkt54d0YKfPROJZQHk,1691
122
122
  thestage/services/clients/thestage_api/dtos/selfhosted_instance_response.py,sha256=iDo2AFlUr2WV7vhBU40Abyp1AFoEk986UQRb5O0as4U,3049
@@ -161,13 +161,13 @@ thestage/services/project/mapper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
161
161
  thestage/services/project/mapper/project_inference_simulator_mapper.py,sha256=UdOu9IIF5rlNPoWSaaeSKU3ODe8E5uSMgm2V5ywMWKE,812
162
162
  thestage/services/project/mapper/project_inference_simulator_model_mapper.py,sha256=PWY0iWbXhvD-G0X0_aQZAFY2bqc0lvRJcQAyC8Y-88Q,869
163
163
  thestage/services/project/mapper/project_task_mapper.py,sha256=SHIEXjYwt4vm2B1X2QiI4sCPbBarum0bTOnmTWPOlto,813
164
- thestage/services/project/project_service.py,sha256=vdHb9YB4yfw5UlOIa95M-CJLb3mQZIHn5hLhevagC5A,50666
164
+ thestage/services/project/project_service.py,sha256=n11WsCCXfm8Ulyo2zpGw0ILL3LtpW83RdQJuEd1dJcg,50869
165
165
  thestage/services/remote_server_service.py,sha256=3VPgd9ckxXOxXGGvb3JeJ0LwuZx2gd2jWn3Pf-CxqVk,23264
166
166
  thestage/services/service_factory.py,sha256=tWbFFDO6TeOz5jSYbe-OabqTmsjR9Xs1OZmd49Aj3g0,5098
167
167
  thestage/services/task/dto/task_dto.py,sha256=PJwrUsLLAoO2uA9xvzb27b9iYAoNiBcsHSxKERh2VFo,2335
168
168
  thestage/services/validation_service.py,sha256=ABb-ok-SGITE6jm8AR1hiYHYgGZL7ri02Yi0OCXbofo,2008
169
- thestage-0.5.41.dist-info/LICENSE.txt,sha256=U9QrxfdD7Ie7r8z1FleuvOGQvgCF1m0Mjd78cFvWaHE,572
170
- thestage-0.5.41.dist-info/METADATA,sha256=as8bA9PG2EvbCpYXW_0cGMWLSa0b6tWwE3qwawxP9h8,5557
171
- thestage-0.5.41.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
172
- thestage-0.5.41.dist-info/entry_points.txt,sha256=57pMhs8zaCM-jgeTffC0WVqCsh35Uq_dUDmzXR80CI4,47
173
- thestage-0.5.41.dist-info/RECORD,,
169
+ thestage-0.5.42.dist-info/LICENSE.txt,sha256=U9QrxfdD7Ie7r8z1FleuvOGQvgCF1m0Mjd78cFvWaHE,572
170
+ thestage-0.5.42.dist-info/METADATA,sha256=XHu6klHas0lUL4FQn8QGjXi9HhOOAv9O0Gza_X3_muw,5506
171
+ thestage-0.5.42.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
172
+ thestage-0.5.42.dist-info/entry_points.txt,sha256=57pMhs8zaCM-jgeTffC0WVqCsh35Uq_dUDmzXR80CI4,47
173
+ thestage-0.5.42.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.1
2
+ Generator: poetry-core 1.8.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
Binary file