sunstone-py 0.5.1__py3-none-any.whl → 0.5.2__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.
sunstone/_release.py CHANGED
@@ -13,6 +13,17 @@ import sys
13
13
  from datetime import date
14
14
  from pathlib import Path
15
15
 
16
+ try:
17
+ import tomllib
18
+ except ModuleNotFoundError:
19
+ import tomli as tomllib # type: ignore[import-not-found,no-redef]
20
+
21
+ try:
22
+ import tomli_w
23
+ except ModuleNotFoundError:
24
+ print("Error: tomli_w not found. Install with: uv add --dev tomli-w", file=sys.stderr)
25
+ sys.exit(1)
26
+
16
27
 
17
28
  def get_root_dir() -> Path:
18
29
  """Get the root directory (where pyproject.toml lives)."""
@@ -216,12 +227,13 @@ def confirm_release(new_version: str) -> bool:
216
227
  def get_current_version() -> str:
217
228
  """Get the current version from pyproject.toml."""
218
229
  pyproject_path = get_root_dir() / "pyproject.toml"
219
- content = pyproject_path.read_text()
220
- match = re.search(r'^version\s*=\s*"([^"]+)"', content, re.MULTILINE)
221
- if not match:
230
+ with open(pyproject_path, "rb") as f:
231
+ data = tomllib.load(f)
232
+ version = data.get("project", {}).get("version")
233
+ if not version:
222
234
  print("Error: Could not find version in pyproject.toml", file=sys.stderr)
223
235
  sys.exit(1)
224
- return match.group(1)
236
+ return str(version)
225
237
 
226
238
 
227
239
  def bump_version(version: str, bump: str) -> str:
@@ -244,14 +256,13 @@ def bump_version(version: str, bump: str) -> str:
244
256
  def update_pyproject_version(new_version: str) -> None:
245
257
  """Update the version in pyproject.toml."""
246
258
  pyproject_path = get_root_dir() / "pyproject.toml"
247
- content = pyproject_path.read_text()
248
- new_content = re.sub(
249
- r'^(version\s*=\s*)"[^"]+"',
250
- f'\\1"{new_version}"',
251
- content,
252
- flags=re.MULTILINE,
253
- )
254
- pyproject_path.write_text(new_content)
259
+ with open(pyproject_path, "rb") as f:
260
+ data = tomllib.load(f)
261
+
262
+ data["project"]["version"] = new_version
263
+
264
+ with open(pyproject_path, "wb") as f:
265
+ tomli_w.dump(data, f)
255
266
 
256
267
 
257
268
  def update_changelog(new_version: str) -> None:
@@ -1,22 +1,20 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sunstone-py
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Python library for managing datasets with lineage tracking in Sunstone projects
5
5
  Author-email: Sunstone Institute <stig@sunstone.institute>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://github.com/sunstoneinstitute/sunstone-py
8
8
  Project-URL: Documentation, https://sunstoneinstitute.github.io/sunstone-py/
9
9
  Project-URL: Repository, https://github.com/sunstoneinstitute/sunstone-py
10
- Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Science/Research
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
14
  Classifier: Programming Language :: Python :: 3.12
17
15
  Classifier: Programming Language :: Python :: 3.13
18
16
  Classifier: Programming Language :: Python :: 3.14
19
- Requires-Python: >=3.10
17
+ Requires-Python: >=3.12
20
18
  Description-Content-Type: text/markdown
21
19
  License-File: LICENSE
22
20
  Requires-Dist: frictionless>=5.18.1
@@ -1,5 +1,5 @@
1
1
  sunstone/__init__.py,sha256=LC0ZtmxP26eXPLKejbg7UStcHOnE_lwttNTL4m3F4yM,2032
2
- sunstone/_release.py,sha256=_yjAl_vZQ_5IYr0ugPlqtmUvsGnyGDx7LyiI_2HToVM,14649
2
+ sunstone/_release.py,sha256=MQNaUD7mSK6h8vu6EIgJuaMlAxuFxv82NQwHgBpLZm4,14907
3
3
  sunstone/dataframe.py,sha256=UJgQx7auiNb6hSIvhB8EQs2afu-7S22xdWL5DZUr29g,23602
4
4
  sunstone/datasets.py,sha256=LdHk3Vkfc7QH2VxhSskRCm9wUFSkldCmgS_1c2KDAPA,21142
5
5
  sunstone/exceptions.py,sha256=fiixXazur3LtQGy21bGEaSr356DObFcYxQJ3FvOxNec,623
@@ -7,9 +7,9 @@ sunstone/lineage.py,sha256=B9GKMu5-v8Izos5G40K_EvsCPJL3Z2Tg1T_Fc7ezSMI,5240
7
7
  sunstone/pandas.py,sha256=CLEqIIgTbMmpH73TPy_vDUPxQa37Hpmqn4r6No8PJwo,8188
8
8
  sunstone/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  sunstone/validation.py,sha256=1356vcUc72a1zGBUe9Xjrcb5h41Xo53PaK2nnQ_FuSM,8286
10
- sunstone_py-0.5.1.dist-info/licenses/LICENSE,sha256=pB6VuR4QRjwjMjy8RSNGho-N1SUdu07ntIhT5lrhkzU,1078
11
- sunstone_py-0.5.1.dist-info/METADATA,sha256=DMLR03NMB5_t14rsBo4GtqY0oQFHnKQtbdUGEfxFcq8,9563
12
- sunstone_py-0.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- sunstone_py-0.5.1.dist-info/entry_points.txt,sha256=0h6E88rH9a_503BAzXvFPR-UfmkrRFjcOf29DXgJNjk,51
14
- sunstone_py-0.5.1.dist-info/top_level.txt,sha256=A2fW-7JO10rlx_L28Bc4FVvWt2R8kgvS8_TGPBhQp3c,9
15
- sunstone_py-0.5.1.dist-info/RECORD,,
10
+ sunstone_py-0.5.2.dist-info/licenses/LICENSE,sha256=pB6VuR4QRjwjMjy8RSNGho-N1SUdu07ntIhT5lrhkzU,1078
11
+ sunstone_py-0.5.2.dist-info/METADATA,sha256=uR8iPIENJBiPVFhtr5EXT3V6VAmLiju0CfFjm6oQubI,9460
12
+ sunstone_py-0.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ sunstone_py-0.5.2.dist-info/entry_points.txt,sha256=0h6E88rH9a_503BAzXvFPR-UfmkrRFjcOf29DXgJNjk,51
14
+ sunstone_py-0.5.2.dist-info/top_level.txt,sha256=A2fW-7JO10rlx_L28Bc4FVvWt2R8kgvS8_TGPBhQp3c,9
15
+ sunstone_py-0.5.2.dist-info/RECORD,,