-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b5b3d1
commit 2fed007
Showing
2 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python3 | ||
import sys | ||
import yaml | ||
|
||
if len(sys.argv) != 2: | ||
print("Usage: python extract_pytorch_version.py <package_name>") | ||
sys.exit(1) | ||
|
||
package_name = sys.argv[1] | ||
|
||
# Load the lock file | ||
try: | ||
with open('conda-lock.yml', 'r') as lock_file: | ||
lock_data = yaml.safe_load(lock_file) | ||
except FileNotFoundError: | ||
print("Lock file 'conda-lock.yml' not found.") | ||
sys.exit(1) | ||
|
||
# Extract the version of the specified package | ||
package_version = None | ||
for package in lock_data['package']: | ||
if package['name'] == package_name and package['platform'] == 'linux-64': | ||
package_version = package['version'] | ||
break | ||
|
||
if package_version: | ||
print(package_version) | ||
else: | ||
print(f"{package_name}-not-found") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters