fxn 0.0.46__py3-none-any.whl → 0.0.47__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.
fxn/sandbox.py CHANGED
@@ -43,7 +43,8 @@ class UploadDirectoryCommand (UploadableCommand):
43
43
 
44
44
  def get_files (self) -> list[Path]:
45
45
  from_path = Path(self.from_path)
46
- assert from_path.is_absolute(), "Cannot upload directory because directory path must be absolute"
46
+ if not from_path.is_absolute():
47
+ raise ValueError("Cannot upload directory because directory path must be absolute")
47
48
  return [file for file in from_path.rglob("*") if file.is_file()]
48
49
 
49
50
  class EntrypointCommand (UploadableCommand):
@@ -106,7 +107,11 @@ class Sandbox (BaseModel):
106
107
  from_path (str | Path): File path on the local file system.
107
108
  to_path (str | Path): Remote path to upload file to.
108
109
  """
109
- command = UploadFileCommand(from_path=str(from_path), to_path=str(to_path))
110
+ from_path = from_path if isinstance(from_path, Path) else Path(from_path)
111
+ command = UploadFileCommand(
112
+ from_path=str(from_path.resolve()),
113
+ to_path=str(to_path)
114
+ )
110
115
  return Sandbox(commands=self.commands + [command])
111
116
 
112
117
  def upload_directory (
@@ -121,7 +126,11 @@ class Sandbox (BaseModel):
121
126
  from_path (str | Path): Directory path on the local file system.
122
127
  to_path (str | Path): Remote path to upload directory to.
123
128
  """
124
- command = UploadDirectoryCommand(from_path=str(from_path), to_path=str(to_path))
129
+ from_path = from_path if isinstance(from_path, Path) else Path(from_path)
130
+ command = UploadDirectoryCommand(
131
+ from_path=str(from_path.resolve()),
132
+ to_path=str(to_path)
133
+ )
125
134
  return Sandbox(commands=self.commands + [command])
126
135
 
127
136
  def pip_install (self, *packages: str) -> Sandbox:
@@ -180,7 +189,8 @@ class Sandbox (BaseModel):
180
189
  return self
181
190
 
182
191
  def __upload_file (self, path: Path, fxn: Function) -> str:
183
- assert path.is_file(), "Cannot upload file at path {path} because it is not a file"
192
+ if not path.is_file():
193
+ raise ValueError(f"Cannot upload file at path {path} because it is not a file")
184
194
  hash = self.__compute_hash(path)
185
195
  try:
186
196
  fxn.client.request(method="HEAD", path=f"/resources/{hash}")
fxn/version.py CHANGED
@@ -3,4 +3,4 @@
3
3
  # Copyright © 2025 NatML Inc. All Rights Reserved.
4
4
  #
5
5
 
6
- __version__ = "0.0.46"
6
+ __version__ = "0.0.47"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fxn
3
- Version: 0.0.46
3
+ Version: 0.0.47
4
4
  Summary: Run prediction functions locally in Python. Register at https://fxn.ai.
5
5
  Author-email: "NatML Inc." <hi@fxn.ai>
6
6
  License: Apache License
@@ -3,8 +3,8 @@ fxn/client.py,sha256=Deje8eiS1VOHX85tQnV34viv2CPVx2ljwHSbyVB5Z1o,3790
3
3
  fxn/compile.py,sha256=A9dxw6yv1eCd-zEYnqiyjDUZou8TkbEIA_yB9Tn4pXo,3894
4
4
  fxn/function.py,sha256=XeEuALkbVhkvwEBUfP0A2fu3tdimwHemoR17oomhzc8,1407
5
5
  fxn/logging.py,sha256=MsTSf0GZxrHNDwVAXDOh8_zRUg9hkeZ8DfhFUJs7D8A,7250
6
- fxn/sandbox.py,sha256=w2dnHMBaKOERxFMpeAP11X6_SPqcvnpd6SmX6b_FOYQ,7000
7
- fxn/version.py,sha256=NugzjvuR0aE7hGoUmoQvcI8t1IrmT-Xm9J9SaWp3wVk,95
6
+ fxn/sandbox.py,sha256=50yY2GDdkAFl-6pXTleaD1LXYM6-pJ3C1epKsr0xdrM,7313
7
+ fxn/version.py,sha256=3dFw5yGra_PvIbLm_h0jdhjK5bzEKO6Fbmk1bC3egwo,95
8
8
  fxn/beta/__init__.py,sha256=aQAV-apg11Z7Pn86eIegJ2id7wkRUaYeEaeZthaCmYk,252
9
9
  fxn/beta/client.py,sha256=0lfwQPcB9ToIJC7AcCXO6DlJKkmId8EChhd9bk29GGE,2611
10
10
  fxn/beta/metadata.py,sha256=7mnbIVoGQm6_5Qy-gSV6xpGuSP6LcnFjKbmSBNze34w,3067
@@ -41,9 +41,9 @@ fxn/types/dtype.py,sha256=71Tuu4IydmELcBcSBbmWswhCE-7WqBSQ4VkETsFRzjA,617
41
41
  fxn/types/prediction.py,sha256=BdLTxnKiSFbz5warX8g_Z4DedNxXK3gaNjSKR2FP8tA,2051
42
42
  fxn/types/predictor.py,sha256=KRGZEuDt7WPMCyRcZvQq4y2FMocfVrLEUNJCJgfDY9Y,4000
43
43
  fxn/types/user.py,sha256=Z44TwEocyxSrfKyzcNfmAXUrpX_Ry8fJ7MffSxRn4oU,1071
44
- fxn-0.0.46.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
45
- fxn-0.0.46.dist-info/METADATA,sha256=l-W_xp1vn_B4ORukQfRqqe_a2G1mN37IORvIfR-TjG8,16136
46
- fxn-0.0.46.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
47
- fxn-0.0.46.dist-info/entry_points.txt,sha256=O_AwD5dYaeB-YT1F9hPAPuDYCkw_W0tdNGYbc5RVR2k,45
48
- fxn-0.0.46.dist-info/top_level.txt,sha256=1ULIEGrnMlhId8nYAkjmRn9g3KEFuHKboq193SEKQkA,4
49
- fxn-0.0.46.dist-info/RECORD,,
44
+ fxn-0.0.47.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
45
+ fxn-0.0.47.dist-info/METADATA,sha256=XQJHkEMexWC3VnbFzC2CVkpXESzJbN3DJDDNAo_ayz4,16136
46
+ fxn-0.0.47.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
47
+ fxn-0.0.47.dist-info/entry_points.txt,sha256=O_AwD5dYaeB-YT1F9hPAPuDYCkw_W0tdNGYbc5RVR2k,45
48
+ fxn-0.0.47.dist-info/top_level.txt,sha256=1ULIEGrnMlhId8nYAkjmRn9g3KEFuHKboq193SEKQkA,4
49
+ fxn-0.0.47.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5