setup.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import glob
  2. from setuptools import setup, find_packages
  3. import os
  4. # 读取 requirements.txt 文件内容
  5. def read_requirements():
  6. req_path = "requirements.txt"
  7. if not os.path.exists(req_path):
  8. return []
  9. with open(req_path, encoding="utf-8") as f:
  10. return [line.strip() for line in f if line.strip() and not line.startswith("#")]
  11. # 找出所有根目录下的.py文件(不包括__init__.py)
  12. def find_py_modules():
  13. return [os.path.splitext(os.path.basename(f))[0]
  14. for f in glob.glob("*.py")
  15. if os.path.isfile(f) and not f.startswith('__init__')]
  16. setup(
  17. name="crossborder",
  18. version="0.1.0",
  19. packages=find_packages(where="."),
  20. package_dir={"": "."},
  21. # 添加根目录下的.py文件
  22. py_modules=find_py_modules(),
  23. include_package_data=True,
  24. install_requires=read_requirements(),
  25. python_requires='>=3.6',
  26. entry_points={
  27. 'console_scripts': [
  28. 'run-shandong=shandong.selenium_shandong_download:main',
  29. ],
  30. },
  31. )