|
@@ -0,0 +1,39 @@
|
|
|
+import glob
|
|
|
+
|
|
|
+from setuptools import setup, find_packages
|
|
|
+import os
|
|
|
+
|
|
|
+# 读取 requirements.txt 文件内容
|
|
|
+def read_requirements():
|
|
|
+ req_path = "requirements.txt"
|
|
|
+ if not os.path.exists(req_path):
|
|
|
+ return []
|
|
|
+ with open(req_path, encoding="utf-8") as f:
|
|
|
+ return [line.strip() for line in f if line.strip() and not line.startswith("#")]
|
|
|
+
|
|
|
+
|
|
|
+# 找出所有根目录下的.py文件(不包括__init__.py)
|
|
|
+def find_py_modules():
|
|
|
+ return [os.path.splitext(os.path.basename(f))[0]
|
|
|
+ for f in glob.glob("*.py")
|
|
|
+ if os.path.isfile(f) and not f.startswith('__init__')]
|
|
|
+
|
|
|
+
|
|
|
+setup(
|
|
|
+ name="crossborder",
|
|
|
+ version="0.1.0",
|
|
|
+ packages=find_packages(where="."),
|
|
|
+ package_dir={"": "."},
|
|
|
+
|
|
|
+ # 添加根目录下的.py文件
|
|
|
+ py_modules=find_py_modules(),
|
|
|
+
|
|
|
+ include_package_data=True,
|
|
|
+ install_requires=read_requirements(),
|
|
|
+ python_requires='>=3.6',
|
|
|
+ entry_points={
|
|
|
+ 'console_scripts': [
|
|
|
+ 'run-shandong=shandong.selenium_shandong_download:main',
|
|
|
+ ],
|
|
|
+ },
|
|
|
+)
|