chore: import upstream snapshot with attribution
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
gh-pages / build (push) Has been cancelled
Python Publish (pypi) / Upload release to PyPI (push) Has been cancelled
Spellcheck / spellcheck (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
gh-pages / build (push) Has been cancelled
Python Publish (pypi) / Upload release to PyPI (push) Has been cancelled
Spellcheck / spellcheck (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Copyright (c) 2025 Microsoft Corporation.
|
||||
# Licensed under the MIT License
|
||||
|
||||
|
||||
"""GraphRAG Scripts module."""
|
||||
@@ -0,0 +1,25 @@
|
||||
# Copyright (c) 2025 Microsoft Corporation.
|
||||
# Licensed under the MIT License
|
||||
|
||||
"""Copy root build assets to package directories."""
|
||||
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def copy_build_assets():
|
||||
"""Copy root build assets to package build directories so files are included in pypi distributions."""
|
||||
root_dir = Path(__file__).parent.parent
|
||||
build_assets = ["LICENSE"]
|
||||
|
||||
for package_dir in root_dir.glob("packages/*"):
|
||||
if package_dir.is_dir():
|
||||
for asset in build_assets:
|
||||
src = root_dir / asset
|
||||
dest = package_dir / asset
|
||||
if src.exists():
|
||||
shutil.copy(src, dest)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
copy_build_assets()
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
changes=$(git diff --name-only origin/main)
|
||||
has_change_doc=$(echo $changes | grep .semversioner/next-release)
|
||||
has_impacting_changes=$(echo $changes | grep graphrag)
|
||||
|
||||
if [ "$has_impacting_changes" ] && [ -z "$has_change_doc" ]; then
|
||||
echo "Check failed. Run 'uv run semversioner add-change' to update the next release version"
|
||||
exit 1
|
||||
fi
|
||||
echo "OK"
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
npx --yes cspell -c cspell.config.yaml --no-progress lint .
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
npx --yes azurite -L -l ./temp_azurite -d ./temp_azurite/debug.log
|
||||
@@ -0,0 +1,58 @@
|
||||
# Copyright (c) 2025 Microsoft Corporation.
|
||||
# Licensed under the MIT License
|
||||
|
||||
"""Update workspace dependency versions."""
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess # noqa: S404
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _get_version() -> str:
|
||||
command = ["uv", "run", "semversioner", "current-version"]
|
||||
completion = subprocess.run(command, env=os.environ, capture_output=True, text=True) # noqa: S603
|
||||
if completion.returncode != 0:
|
||||
msg = f"Failed to get current version with return code: {completion.returncode}"
|
||||
raise RuntimeError(msg)
|
||||
return completion.stdout.strip()
|
||||
|
||||
|
||||
def _get_package_paths() -> list[Path]:
|
||||
root_dir = Path(__file__).parent.parent
|
||||
return [p.resolve() for p in root_dir.glob("packages/*") if p.is_dir()]
|
||||
|
||||
|
||||
def update_workspace_dependency_versions():
|
||||
"""Update dependency versions across workspace packages.
|
||||
|
||||
Iterate through all the workspace packages and update cross-package
|
||||
dependency versions to match the current version of the workspace.
|
||||
"""
|
||||
version = _get_version()
|
||||
package_paths = _get_package_paths()
|
||||
for package_path in package_paths:
|
||||
current_package_name = package_path.name
|
||||
toml_path = package_path / "pyproject.toml"
|
||||
if not toml_path.exists() or not toml_path.is_file():
|
||||
continue
|
||||
toml_contents = toml_path.read_text(encoding="utf-8")
|
||||
|
||||
for other_package_path in package_paths:
|
||||
other_package_name = other_package_path.name
|
||||
if other_package_name == current_package_name:
|
||||
continue
|
||||
dep_pattern = rf"{other_package_name}\s*==\s*\d+\.\d+\.\d+"
|
||||
|
||||
if re.search(dep_pattern, toml_contents):
|
||||
toml_contents = re.sub(
|
||||
dep_pattern,
|
||||
f"{other_package_name}=={version}",
|
||||
toml_contents,
|
||||
)
|
||||
|
||||
toml_path.write_text(toml_contents, encoding="utf-8", newline="\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
update_workspace_dependency_versions()
|
||||
Reference in New Issue
Block a user