Spaces:
Sleeping
Sleeping
| import setuptools | |
| from setuptools import find_packages | |
| import os | |
| readme_path = os.path.join(os.path.dirname(__file__), "readme.md") | |
| with open(readme_path, "r") as fh: | |
| long_description = fh.read() | |
| vars2find = ["__author__", "__version__", "__url__"] | |
| vars2readme = {} | |
| init_path = os.path.join(os.path.dirname(__file__), "nano_graphrag", "__init__.py") | |
| with open(init_path) as f: | |
| for line in f.readlines(): | |
| for v in vars2find: | |
| if line.startswith(v): | |
| line = line.replace(" ", "").replace('"', "").replace("'", "").strip() | |
| vars2readme[v] = line.split("=")[1] | |
| deps = [] | |
| # Use absolute path to requirements.txt | |
| requirements_path = os.path.join(os.path.dirname(__file__), "requirements.txt") | |
| with open(requirements_path) as f: | |
| for line in f.readlines(): | |
| if not line.strip(): | |
| continue | |
| deps.append(line.strip()) | |
| setuptools.setup( | |
| name="nano-graphrag", | |
| url=vars2readme["__url__"], | |
| version=vars2readme["__version__"], | |
| author=vars2readme["__author__"], | |
| description="A simple, easy-to-hack GraphRAG implementation", | |
| long_description=long_description, | |
| long_description_content_type="text/markdown", | |
| packages=find_packages(), | |
| classifiers=[ | |
| "Programming Language :: Python :: 3", | |
| "License :: OSI Approved :: MIT License", | |
| "Operating System :: OS Independent", | |
| ], | |
| python_requires=">=3.9", | |
| install_requires=deps, | |
| ) | |