mirror of
https://github.com/onyx-and-iris/bible.git
synced 2026-09-15 07:32:34 +00:00
first commit
This commit is contained in:
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
import pathlib
|
||||
import tomllib
|
||||
|
||||
import tomlkit
|
||||
|
||||
root = pathlib.Path(__file__).resolve().parents[1]
|
||||
pixi_path = root / 'pixi.toml'
|
||||
pyproject_path = root / 'pyproject.toml'
|
||||
|
||||
pixi = tomllib.loads(pixi_path.read_text())
|
||||
pyproject = tomllib.loads(pyproject_path.read_text())
|
||||
|
||||
# --- Sync version ---
|
||||
pixi_version = pixi['package']['version']
|
||||
pyproject['project']['version'] = pixi_version
|
||||
|
||||
# --- Sync only [package.run-dependencies] ---
|
||||
run_deps = pixi.get('package', {}).get('run-dependencies', {})
|
||||
runtime_deps = [f'{k}{v}' if isinstance(v, str) else k for k, v in run_deps.items()]
|
||||
|
||||
pyproject['project']['dependencies'] = runtime_deps
|
||||
|
||||
# --- Write back ---
|
||||
pixi_path.write_text(tomlkit.dumps(pixi))
|
||||
pyproject_path.write_text(tomlkit.dumps(pyproject))
|
||||
|
||||
print(
|
||||
f'Synced version {pixi_version} and {len(runtime_deps)} runtime dependencies from [package.run-dependencies].'
|
||||
)
|
||||
Reference in New Issue
Block a user