truss 0.11.9rc2__py3-none-any.whl → 0.11.9rc3__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.

Potentially problematic release.


This version of truss might be problematic. Click here for more details.

@@ -30,7 +30,7 @@ class ModelContainerPatchApplier:
30
30
  self,
31
31
  inference_server_home: Path,
32
32
  app_logger: logging.Logger,
33
- pip_path: Optional[str] = None, # Only meant for testing
33
+ uv_path: Optional[str] = None, # Only meant for testing
34
34
  ) -> None:
35
35
  self._inference_server_home = inference_server_home
36
36
  self._model_module_dir = (
@@ -41,9 +41,9 @@ class ModelContainerPatchApplier:
41
41
  ).resolve()
42
42
  self._data_dir = self._inference_server_home / self._truss_config.data_dir
43
43
  self._app_logger = app_logger
44
- self._pip_path_cached = None
45
- if pip_path is not None:
46
- self._pip_path_cached = "pip"
44
+ self._uv_path_cached = None
45
+ if uv_path is not None:
46
+ self._uv_path_cached = uv_path
47
47
 
48
48
  def __call__(self, patch: Patch, inf_env: dict):
49
49
  self._app_logger.debug(f"Applying patch {patch.to_dict()}")
@@ -79,10 +79,10 @@ class ModelContainerPatchApplier:
79
79
  return TrussConfig.from_yaml(self._inference_server_home / "config.yaml")
80
80
 
81
81
  @property
82
- def _pip_path(self) -> str:
83
- if self._pip_path_cached is None:
84
- self._pip_path_cached = _identify_pip_path()
85
- return self._pip_path_cached
82
+ def _uv_path(self) -> str:
83
+ if self._uv_path_cached is None:
84
+ self._uv_path_cached = _identify_uv_path()
85
+ return self._uv_path_cached
86
86
 
87
87
  def _apply_python_requirement_patch(
88
88
  self, python_requirement_patch: PythonRequirementPatch
@@ -95,17 +95,19 @@ class ModelContainerPatchApplier:
95
95
  if action == Action.REMOVE:
96
96
  subprocess.run(
97
97
  [
98
- self._pip_path,
98
+ self._uv_path,
99
+ "pip",
99
100
  "uninstall",
100
- "-y",
101
101
  python_requirement_patch.requirement,
102
+ "--yes",
102
103
  ],
103
104
  check=True,
104
105
  )
105
106
  elif action in [Action.ADD, Action.UPDATE]:
106
107
  subprocess.run(
107
108
  [
108
- self._pip_path,
109
+ self._uv_path,
110
+ "pip",
109
111
  "install",
110
112
  python_requirement_patch.requirement,
111
113
  "--upgrade",
@@ -158,11 +160,15 @@ class ModelContainerPatchApplier:
158
160
  raise ValueError(f"Unknown patch action {action}")
159
161
 
160
162
 
161
- def _identify_pip_path() -> str:
162
- if Path("/usr/local/bin/pip3").exists():
163
- return "/usr/local/bin/pip3"
163
+ def _identify_uv_path() -> str:
164
+ candidate_paths: list[Path] = [
165
+ Path.home() / ".local" / "bin" / "uv",
166
+ Path("/usr/local/bin/uv"),
167
+ Path.home() / ".cargo" / "bin" / "uv",
168
+ ]
164
169
 
165
- if Path("/usr/local/bin/pip").exists():
166
- return "/usr/local/bin/pip"
170
+ for path in candidate_paths:
171
+ if path.exists():
172
+ return str(path)
167
173
 
168
- raise RuntimeError("Unable to find pip, make sure it's installed.")
174
+ raise RuntimeError("Unable to find `uv, make sure it's installed.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truss
3
- Version: 0.11.9rc2
3
+ Version: 0.11.9rc3
4
4
  Summary: A seamless bridge from model development to model delivery
5
5
  Project-URL: Repository, https://github.com/basetenlabs/truss
6
6
  Project-URL: Homepage, https://truss.baseten.co
@@ -84,7 +84,7 @@ truss/templates/control/control/helpers/inference_server_process_controller.py,s
84
84
  truss/templates/control/control/helpers/inference_server_starter.py,sha256=Fz2Puijro6Cc5cvTsAqOveNJbBQR_ARYJXl4lvETJ8Y,2633
85
85
  truss/templates/control/control/helpers/truss_patch/__init__.py,sha256=CXZdUV_ylqLTJrKuFpvSnUT6PUFrZrMF2y6jiHbdaKU,998
86
86
  truss/templates/control/control/helpers/truss_patch/model_code_patch_applier.py,sha256=LTIIADLz0wRn7V49j64dU1U7Hbta9YLde3pb5YZWvzQ,2001
87
- truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py,sha256=uiZvKhLa_rpr_N67NpApgA-XVrBFLXraZlikSOFDDOw,6445
87
+ truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py,sha256=FIn79RsVUtR6_uDF310aOm3tyIZjPNe2a3uOexzAdNI,6589
88
88
  truss/templates/control/control/helpers/truss_patch/requirement_name_identifier.py,sha256=CL3KEAj4B3ApMQShd7TI5umXVbazLZY5StrNlwHwWtc,1995
89
89
  truss/templates/control/control/helpers/truss_patch/system_packages.py,sha256=IYh1CVU_kooAvtSGXKQDDWnNdOhlv7ENWagsL1wvhgw,208
90
90
  truss/templates/custom/examples.yaml,sha256=2UcCtEdavImWmiCtj31ckBlAKVOwNMC5AwMIIznKDag,48
@@ -369,8 +369,8 @@ truss_train/deployment.py,sha256=lWWANSuzBWu2M4oK4qD7n-oVR1JKdmw2Pn5BJQHg-Ck,307
369
369
  truss_train/loader.py,sha256=0o66EjBaHc2YY4syxxHVR4ordJWs13lNXnKjKq2wq0U,1630
370
370
  truss_train/public_api.py,sha256=9N_NstiUlmBuLUwH_fNG_1x7OhGCytZLNvqKXBlStrM,1220
371
371
  truss_train/restore_from_checkpoint.py,sha256=8hdPm-WSgkt74HDPjvCjZMBpvA9MwtoYsxVjOoa7BaM,1176
372
- truss-0.11.9rc2.dist-info/METADATA,sha256=oYVseMCGTWiWN5NR6Siy4qTSaEzbGGKUgdiqyqsWHHI,6680
373
- truss-0.11.9rc2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
374
- truss-0.11.9rc2.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
375
- truss-0.11.9rc2.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
376
- truss-0.11.9rc2.dist-info/RECORD,,
372
+ truss-0.11.9rc3.dist-info/METADATA,sha256=nKIkoDKhAZJh3mxQd1ePyp9WSAAe3VKhV7KcShXDU4Q,6680
373
+ truss-0.11.9rc3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
374
+ truss-0.11.9rc3.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
375
+ truss-0.11.9rc3.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
376
+ truss-0.11.9rc3.dist-info/RECORD,,