dayhoff-tools 1.0.17__py3-none-any.whl → 1.0.19__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.
- dayhoff_tools/cli/utility_commands.py +136 -25
- {dayhoff_tools-1.0.17.dist-info → dayhoff_tools-1.0.19.dist-info}/METADATA +17 -14
- {dayhoff_tools-1.0.17.dist-info → dayhoff_tools-1.0.19.dist-info}/RECORD +5 -5
- {dayhoff_tools-1.0.17.dist-info → dayhoff_tools-1.0.19.dist-info}/WHEEL +0 -0
- {dayhoff_tools-1.0.17.dist-info → dayhoff_tools-1.0.19.dist-info}/entry_points.txt +0 -0
@@ -7,6 +7,8 @@ import subprocess
|
|
7
7
|
import sys
|
8
8
|
from pathlib import Path
|
9
9
|
|
10
|
+
import toml
|
11
|
+
import typer
|
10
12
|
import yaml
|
11
13
|
|
12
14
|
|
@@ -200,6 +202,10 @@ def build_and_upload_wheel(bump_part: str = "patch"):
|
|
200
202
|
)
|
201
203
|
return
|
202
204
|
|
205
|
+
# ANSI color codes
|
206
|
+
BLUE = "\033[94m"
|
207
|
+
RESET = "\033[0m"
|
208
|
+
|
203
209
|
# --- Authentication Setup ---
|
204
210
|
token = os.environ.get("UV_PUBLISH_TOKEN")
|
205
211
|
|
@@ -211,6 +217,8 @@ def build_and_upload_wheel(bump_part: str = "patch"):
|
|
211
217
|
return
|
212
218
|
|
213
219
|
# Build the command with token authentication
|
220
|
+
# IMPORTANT: Mask token for printing
|
221
|
+
publish_cmd_safe_print = ["uv", "publish", "--token", "*****"]
|
214
222
|
publish_cmd = ["uv", "publish", "--token", token]
|
215
223
|
print("Using UV_PUBLISH_TOKEN for authentication.")
|
216
224
|
|
@@ -279,13 +287,16 @@ def build_and_upload_wheel(bump_part: str = "patch"):
|
|
279
287
|
# --- End Version Bumping Logic ---
|
280
288
|
|
281
289
|
# Build wheel and sdist
|
282
|
-
|
283
|
-
|
290
|
+
build_cmd = ["uv", "build"]
|
291
|
+
# Print command in blue
|
292
|
+
print(f"Running command: {BLUE}{' '.join(build_cmd)}{RESET}")
|
293
|
+
subprocess.run(build_cmd, check=True)
|
284
294
|
|
285
295
|
# Upload using uv publish with explicit arguments
|
286
|
-
|
296
|
+
# Print masked command in blue
|
297
|
+
print(f"Running command: {BLUE}{' '.join(publish_cmd_safe_print)}{RESET}")
|
287
298
|
subprocess.run(
|
288
|
-
publish_cmd, # Use the command
|
299
|
+
publish_cmd, # Use the actual command with token
|
289
300
|
check=True,
|
290
301
|
)
|
291
302
|
|
@@ -355,40 +366,140 @@ def build_and_upload_wheel(bump_part: str = "patch"):
|
|
355
366
|
|
356
367
|
|
357
368
|
def update_dayhoff_tools():
|
358
|
-
"""Update
|
369
|
+
"""Update dayhoff-tools to latest, update pyproject.toml, and sync.
|
359
370
|
|
360
|
-
Runs `uv
|
361
|
-
|
362
|
-
|
363
|
-
|
371
|
+
1. Runs `uv lock --upgrade-package dayhoff-tools`
|
372
|
+
2. Parses uv.lock to find the new version.
|
373
|
+
3. Updates the version constraint in pyproject.toml to `>=<new_version>`.
|
374
|
+
4. Runs `uv sync --no-install-project`.
|
364
375
|
"""
|
376
|
+
# ANSI color codes
|
377
|
+
BLUE = "\033[94m"
|
378
|
+
RESET = "\033[0m"
|
379
|
+
|
380
|
+
lock_file_path = Path("uv.lock")
|
381
|
+
pyproject_path = Path("pyproject.toml")
|
382
|
+
|
365
383
|
try:
|
366
|
-
print("
|
367
|
-
|
368
|
-
|
369
|
-
|
384
|
+
print("Updating dayhoff-tools lock...")
|
385
|
+
|
386
|
+
# Step 1: Update lock file for dayhoff-tools
|
387
|
+
lock_cmd = ["uv", "lock", "--upgrade-package", "dayhoff-tools"]
|
388
|
+
print(f"Running command: {BLUE}{' '.join(lock_cmd)}{RESET}")
|
389
|
+
subprocess.run(lock_cmd, check=True)
|
390
|
+
|
391
|
+
# Step 2: Parse uv.lock to find the new version
|
392
|
+
print(f"Reading {lock_file_path} to find new version...")
|
393
|
+
if not lock_file_path.exists():
|
394
|
+
print(f"Error: {lock_file_path} not found after lock command.")
|
395
|
+
return
|
396
|
+
|
397
|
+
locked_version = None
|
398
|
+
try:
|
399
|
+
lock_data = toml.load(lock_file_path)
|
400
|
+
# Find dayhoff-tools in the lock file packages
|
401
|
+
for package in lock_data.get("package", []):
|
402
|
+
if package.get("name") == "dayhoff-tools":
|
403
|
+
locked_version = package.get("version")
|
404
|
+
break
|
405
|
+
except toml.TomlDecodeError as e:
|
406
|
+
print(f"Error parsing {lock_file_path}: {e}")
|
407
|
+
return
|
408
|
+
except Exception as e:
|
409
|
+
print(f"Error reading lock file: {e}")
|
410
|
+
return
|
411
|
+
|
412
|
+
if not locked_version:
|
413
|
+
print(f"Error: Could not find dayhoff-tools version in {lock_file_path}.")
|
414
|
+
return
|
415
|
+
|
416
|
+
print(f"Found dayhoff-tools version {locked_version} in lock file.")
|
417
|
+
|
418
|
+
# Step 3: Update pyproject.toml
|
419
|
+
print(f"Updating {pyproject_path} version constraint...")
|
420
|
+
try:
|
421
|
+
content = pyproject_path.read_text()
|
422
|
+
# Regex to find the dayhoff-tools dependency line, capturing name+extra
|
423
|
+
# Matches 'dayhoff-tools' or \"dayhoff-tools\", optional [extra], >= constraints etc.
|
424
|
+
pattern = re.compile(
|
425
|
+
r"(^[\'\"](dayhoff-tools(?:\[[^\\\]]+\\])?)[\'\"]\s*)[\\>\\<\\=\\~\\^\\(\\)\\s,0-9\\.\\*\'\"]+",
|
426
|
+
re.MULTILINE,
|
427
|
+
)
|
428
|
+
new_constraint = f">= {locked_version}"
|
429
|
+
new_content, num_replacements = pattern.subn(
|
430
|
+
rf"\1{new_constraint}", content
|
431
|
+
)
|
432
|
+
|
433
|
+
if num_replacements > 0:
|
434
|
+
pyproject_path.write_text(new_content)
|
435
|
+
print(
|
436
|
+
f"Updated dayhoff-tools constraint in {pyproject_path} to '{new_constraint}'"
|
437
|
+
)
|
438
|
+
else:
|
439
|
+
print(
|
440
|
+
f"Warning: Could not find dayhoff-tools dependency line in {pyproject_path} to update constraint."
|
441
|
+
)
|
442
|
+
|
443
|
+
except FileNotFoundError:
|
444
|
+
print(f"Error: {pyproject_path} not found.")
|
445
|
+
return
|
446
|
+
except Exception as e:
|
447
|
+
print(f"Error updating {pyproject_path}: {e}")
|
448
|
+
# Continue to sync step even if pyproject update fails?
|
449
|
+
# For now, let's proceed to sync.
|
450
|
+
print("Proceeding with sync despite pyproject.toml update error.")
|
451
|
+
|
452
|
+
# Step 4: Sync environment based on updated lock file
|
453
|
+
print("Syncing environment...")
|
454
|
+
sync_cmd = ["uv", "sync", "--no-install-project"]
|
455
|
+
print(f"Running command: {BLUE}{' '.join(sync_cmd)}{RESET}")
|
456
|
+
subprocess.run(sync_cmd, check=True)
|
457
|
+
|
458
|
+
print(
|
459
|
+
"dayhoff-tools updated, pyproject.toml modified, and environment synced successfully."
|
460
|
+
)
|
461
|
+
|
370
462
|
except subprocess.CalledProcessError as e:
|
371
|
-
print(f"Error occurred
|
463
|
+
print(f"Error occurred during update/sync process: {e}")
|
372
464
|
except FileNotFoundError:
|
465
|
+
# This catches if uv command itself is not found
|
373
466
|
print("Error: 'uv' command not found. Is uv installed and in PATH?")
|
374
467
|
sys.exit(1)
|
468
|
+
except Exception as e:
|
469
|
+
# Catch any other unexpected errors
|
470
|
+
print(f"An unexpected error occurred: {e}")
|
375
471
|
|
376
472
|
|
377
|
-
def sync_dependencies(
|
473
|
+
def sync_dependencies(
|
474
|
+
install_project: bool = typer.Option(
|
475
|
+
False,
|
476
|
+
"--install-project",
|
477
|
+
help="Install the local project package itself into the environment.",
|
478
|
+
)
|
479
|
+
):
|
378
480
|
"""Update uv.lock and sync dependencies based on pyproject.toml.
|
379
481
|
|
380
|
-
|
381
|
-
|
382
|
-
|
482
|
+
By default, installs all declared dependencies without building/installing
|
483
|
+
the local project itself (--no-install-project). Use --install-project to
|
484
|
+
include the local project.
|
383
485
|
"""
|
384
|
-
|
385
|
-
|
386
|
-
|
486
|
+
# ANSI color codes
|
487
|
+
BLUE = "\033[94m"
|
488
|
+
RESET = "\033[0m"
|
387
489
|
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
)
|
490
|
+
try:
|
491
|
+
lock_cmd = ["uv", "lock"]
|
492
|
+
# Print command in blue
|
493
|
+
print(f"Running command: {BLUE}{' '.join(lock_cmd)}{RESET}")
|
494
|
+
subprocess.run(lock_cmd, check=True)
|
495
|
+
|
496
|
+
sync_cmd = ["uv", "sync", "--all-groups"]
|
497
|
+
if not install_project:
|
498
|
+
sync_cmd.append("--no-install-project")
|
499
|
+
|
500
|
+
# Print command in blue
|
501
|
+
print(f"Running command: {BLUE}{' '.join(sync_cmd)}{RESET}")
|
502
|
+
subprocess.run(sync_cmd, check=True)
|
392
503
|
|
393
504
|
print("Dependencies synced successfully.")
|
394
505
|
except subprocess.CalledProcessError as e:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: dayhoff-tools
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.19
|
4
4
|
Summary: Common tools for all the repos at Dayhoff Labs
|
5
5
|
Author: Daniel Martin-Alarcon
|
6
6
|
Author-email: dma@dayhofflabs.com
|
@@ -10,23 +10,26 @@ Classifier: Programming Language :: Python :: 3.10
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
12
12
|
Classifier: Programming Language :: Python :: 3.13
|
13
|
-
Provides-Extra:
|
14
|
-
Requires-Dist: biopython (>=1.84)
|
15
|
-
Requires-Dist: boto3 (>=1.36.8)
|
16
|
-
Requires-Dist: docker (>=7.1.0)
|
17
|
-
Requires-Dist: fair-esm (>=2.0.0)
|
13
|
+
Provides-Extra: lite
|
14
|
+
Requires-Dist: biopython (>=1.84)
|
15
|
+
Requires-Dist: boto3 (>=1.36.8)
|
16
|
+
Requires-Dist: docker (>=7.1.0)
|
17
|
+
Requires-Dist: fair-esm (>=2.0.0)
|
18
18
|
Requires-Dist: firebase-admin (>=6.5.0)
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
19
|
+
Requires-Dist: firebase-admin (>=6.5.0) ; extra == "lite"
|
20
|
+
Requires-Dist: h5py (>=3.11.0)
|
21
|
+
Requires-Dist: pandas (>=2.2.3)
|
21
22
|
Requires-Dist: pyyaml (>=6.0)
|
22
|
-
Requires-Dist:
|
23
|
-
Requires-Dist:
|
23
|
+
Requires-Dist: pyyaml (>=6.0) ; extra == "lite"
|
24
|
+
Requires-Dist: questionary (>=2.0.1)
|
25
|
+
Requires-Dist: rdkit-pypi (>=2022.9.5)
|
24
26
|
Requires-Dist: requests (>=2.31.0)
|
25
|
-
Requires-Dist:
|
26
|
-
Requires-Dist:
|
27
|
-
Requires-Dist:
|
28
|
-
Requires-Dist: transformers (==4.36.2)
|
27
|
+
Requires-Dist: requests (>=2.31.0) ; extra == "lite"
|
28
|
+
Requires-Dist: sqlalchemy (>=2.0.40,<3.0.0)
|
29
|
+
Requires-Dist: toml (>=0.10)
|
30
|
+
Requires-Dist: transformers (==4.36.2)
|
29
31
|
Requires-Dist: typer (>=0.9.0)
|
32
|
+
Requires-Dist: typer (>=0.9.0) ; extra == "lite"
|
30
33
|
Description-Content-Type: text/markdown
|
31
34
|
|
32
35
|
# dayhoff-tools
|
@@ -5,7 +5,7 @@ dayhoff_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
5
5
|
dayhoff_tools/cli/cloud_commands.py,sha256=KiYEuD3nSg8QPWBYfrhdze2La_CJe4iqK-8uOAHyS8U,35827
|
6
6
|
dayhoff_tools/cli/main.py,sha256=yorL117hknzhNybt7CTz4oKXVuQRIDXPl7huIEWga-M,3666
|
7
7
|
dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
|
8
|
-
dayhoff_tools/cli/utility_commands.py,sha256=
|
8
|
+
dayhoff_tools/cli/utility_commands.py,sha256=rbcrTsvdKivBEuVDhOFz3SoPJeLx9pCSj3XUmc6Q0lk,19044
|
9
9
|
dayhoff_tools/deployment/base.py,sha256=u-AjbtHnFLoLt33dhYXHIpV-6jcieMEHHGBGN_U9Hm0,15626
|
10
10
|
dayhoff_tools/deployment/deploy_aws.py,sha256=O0gQxHioSU_sNU8T8MD4wSOPvWc--V8eRRZzlRu035I,16446
|
11
11
|
dayhoff_tools/deployment/deploy_gcp.py,sha256=DxBM4sUzwPK9RWLP9bSfr38n1HHl-TVrp4TsbdN8pUA,5795
|
@@ -25,7 +25,7 @@ dayhoff_tools/sqlite.py,sha256=jV55ikF8VpTfeQqqlHSbY8OgfyfHj8zgHNpZjBLos_E,18672
|
|
25
25
|
dayhoff_tools/structure.py,sha256=ufN3gAodQxhnt7psK1VTQeu9rKERmo_PhoxIbB4QKMw,27660
|
26
26
|
dayhoff_tools/uniprot.py,sha256=BZYJQF63OtPcBBnQ7_P9gulxzJtqyorgyuDiPeOJqE4,16456
|
27
27
|
dayhoff_tools/warehouse.py,sha256=TqV8nex1AluNaL4JuXH5zuu9P7qmE89lSo6f_oViy6U,14965
|
28
|
-
dayhoff_tools-1.0.
|
29
|
-
dayhoff_tools-1.0.
|
30
|
-
dayhoff_tools-1.0.
|
31
|
-
dayhoff_tools-1.0.
|
28
|
+
dayhoff_tools-1.0.19.dist-info/METADATA,sha256=okG1WGmODVeiTDHJtFIiuoJCMT1aCdnKZMiK2yLAB9o,2214
|
29
|
+
dayhoff_tools-1.0.19.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
30
|
+
dayhoff_tools-1.0.19.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
|
31
|
+
dayhoff_tools-1.0.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|