1 Star 0 Fork 2

CC/sqllineage

forked from xiaofeng01/sqllineage 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 3.15 KB
一键复制 编辑 原始数据 按行查看 历史
reata 提交于 2024-05-05 23:00 . chore: bump version to 1.5.3 (#610)
import os
import platform
import shlex
import shutil
import subprocess
from setuptools import find_packages, setup
from setuptools.command.egg_info import egg_info
from sqllineage import NAME, STATIC_FOLDER, VERSION
with open("README.md", "r") as f:
long_description = f.read()
class EggInfoWithJS(egg_info):
"""
egginfo is a hook both for
1) building source code distribution (python setup.py sdist)
2) building wheel distribution (python setup.py bdist_wheel)
3) installing from source code (python setup.py install) or pip install from GitHub
In this step, frontend code will be built to match MANIFEST.in list so that later the static files will be copied to
site-packages correctly as package_data. When building a distribution, no building process is needed at install time
"""
def run(self) -> None:
static_path = os.path.join(NAME, STATIC_FOLDER)
if os.path.exists(static_path) or "READTHEDOCS" in os.environ:
pass
else:
js_path = "sqllineagejs"
use_shell = True if platform.system() == "Windows" else False
subprocess.check_call(
shlex.split("npm install"), cwd=js_path, shell=use_shell
)
subprocess.check_call(
shlex.split("npm run build"), cwd=js_path, shell=use_shell
)
shutil.move(os.path.join(js_path, STATIC_FOLDER), static_path)
super().run()
setup(
name=NAME,
version=VERSION,
author="Reata",
author_email="reddevil.hjw@gmail.com",
description="SQL Lineage Analysis Tool powered by Python",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/reata/sqllineage",
packages=find_packages(exclude=("tests",)),
package_data={"": [f"{STATIC_FOLDER}/*", f"{STATIC_FOLDER}/**/**/*", "data/**/*"]},
include_package_data=True,
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
],
python_requires=">=3.8",
install_requires=[
"sqlparse==0.5.0",
"networkx>=2.4",
"sqlfluff==3.0.5",
"sqlalchemy>=2.0.0",
],
entry_points={"console_scripts": ["sqllineage = sqllineage.cli:main"]},
extras_require={
"ci": [
"bandit",
"black",
"flake8",
"flake8-blind-except",
"flake8-builtins",
"flake8-import-order",
"flake8-logging-format",
"mypy",
"pytest",
"pytest-cov",
"tox",
"twine",
"wheel",
],
"docs": ["Sphinx>=3.2.0", "sphinx_rtd_theme>=0.5.0"],
},
cmdclass={"egg_info": EggInfoWithJS},
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/chenzechao/sqllineage.git
git@gitee.com:chenzechao/sqllineage.git
chenzechao
sqllineage
sqllineage
master

搜索帮助