Skip to content

Instantly share code, notes, and snippets.

@varun-seth
varun-seth / poetry_to_pyproject.py
Created April 10, 2023 13:21
Derive Poetry Lock from
import tomlkit
LOCK_FILE_PATH = "poetry.lock"
PYPROJECT_PATH = "pyproject.toml"
def main():
try:
with open(LOCK_FILE_PATH, "r") as lock_file:
lock_content = lock_file.read()
import requests
def format_bytes(size):
# 2**10 = 1024
power = 2 ** 10
n = 0
power_labels = {0: '', 1: 'K', 2: 'M', 3: 'G', 4: 'T'}
while size > power:
size /= power