8000 from pylock to requirement with hash via openai + a small tweaking by stonebig · Pull Request #1603 · winpython/winpython · GitHub
[go: up one dir, main page]

Skip to content

from pylock to requirement with hash via openai + a small tweaking #1603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
compatible with dot version and python-3.10
  • Loading branch information
stonebig committed May 11, 2025
commit 92022e4acb8abf34ab5bb8bdec96f2361e7913da
15 changes: 12 additions & 3 deletions pylock_to_requirements.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import tomli # or import tomllib for Python 3.11+
import hashlib
import sys
from pathlib import Path
from collections import defaultdict

# Use tomllib if available (Python 3.11+), otherwise fall back to tomli
try:
import tomllib # Python 3.11+
except ImportError:
try:
import tomli as tomllib # For older Python versions
except ImportError:
print("Please install tomli for Python < 3.11: pip install tomli")
sys.exit(1)



def parse_pylock_toml(path):
with open(path, "rb") as f:
data = tomli.load(f)
data = tomllib.load(f)

# This dictionary maps package names to (version, [hashes])
package_hashes = defaultdict(lambda: {"version": "", "hashes": []})
Expand Down
0