Spaces:
Sleeping
Sleeping
fix: Use absolute paths in nano-graphrag setup.py
Browse files- Fix requirements.txt path resolution using os.path.join
- Fix readme.md and __init__.py path resolution
- Should resolve "No such file or directory" errors during installation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- nano-graphrag/setup.py +9 -3
nano-graphrag/setup.py
CHANGED
|
@@ -1,13 +1,17 @@
|
|
| 1 |
import setuptools
|
| 2 |
from setuptools import find_packages
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
long_description = fh.read()
|
| 6 |
|
| 7 |
|
| 8 |
vars2find = ["__author__", "__version__", "__url__"]
|
| 9 |
vars2readme = {}
|
| 10 |
-
|
|
|
|
| 11 |
for line in f.readlines():
|
| 12 |
for v in vars2find:
|
| 13 |
if line.startswith(v):
|
|
@@ -15,7 +19,9 @@ with open("./nano_graphrag/__init__.py") as f:
|
|
| 15 |
vars2readme[v] = line.split("=")[1]
|
| 16 |
|
| 17 |
deps = []
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
for line in f.readlines():
|
| 20 |
if not line.strip():
|
| 21 |
continue
|
|
|
|
| 1 |
import setuptools
|
| 2 |
from setuptools import find_packages
|
| 3 |
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
readme_path = os.path.join(os.path.dirname(__file__), "readme.md")
|
| 7 |
+
with open(readme_path, "r") as fh:
|
| 8 |
long_description = fh.read()
|
| 9 |
|
| 10 |
|
| 11 |
vars2find = ["__author__", "__version__", "__url__"]
|
| 12 |
vars2readme = {}
|
| 13 |
+
init_path = os.path.join(os.path.dirname(__file__), "nano_graphrag", "__init__.py")
|
| 14 |
+
with open(init_path) as f:
|
| 15 |
for line in f.readlines():
|
| 16 |
for v in vars2find:
|
| 17 |
if line.startswith(v):
|
|
|
|
| 19 |
vars2readme[v] = line.split("=")[1]
|
| 20 |
|
| 21 |
deps = []
|
| 22 |
+
# Use absolute path to requirements.txt
|
| 23 |
+
requirements_path = os.path.join(os.path.dirname(__file__), "requirements.txt")
|
| 24 |
+
with open(requirements_path) as f:
|
| 25 |
for line in f.readlines():
|
| 26 |
if not line.strip():
|
| 27 |
continue
|