You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

setup.py 3.2 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import os
  2. from setuptools import find_packages, setup
  3. def read(rel_path: str) -> str:
  4. here = os.path.abspath(os.path.dirname(__file__))
  5. with open(os.path.join(here, rel_path), encoding="utf-8") as fp:
  6. return fp.read()
  7. def get_version(rel_path: str) -> str:
  8. for line in read(rel_path).splitlines():
  9. if line.startswith("__version__"):
  10. delim = '"' if '"' in line else "'"
  11. return line.split(delim)[1]
  12. raise RuntimeError("Unable to find version string.")
  13. # Package meta-data.
  14. NAME = "learnware"
  15. DESCRIPTION = "learnware market project"
  16. REQUIRES_PYTHON = ">=3.6.0"
  17. VERSION = get_version("learnware/__init__.py")
  18. # BEFORE importing setuptools, remove MANIFEST. Otherwise it may not be
  19. # properly updated when the contents of directories change (true for distutils,
  20. # not sure about setuptools).
  21. if os.path.exists("MANIFEST"):
  22. os.remove("MANIFEST")
  23. MACOS = 0
  24. WINDOWS = 1
  25. LINUX = 2
  26. def get_platform():
  27. import platform
  28. sys_platform = platform.platform().lower()
  29. if "windows" in sys_platform:
  30. return WINDOWS
  31. elif "macos" in sys_platform:
  32. return MACOS
  33. elif "linux" in sys_platform:
  34. return LINUX
  35. raise SystemError("Learnware only support MACOS/Linux/Windows")
  36. # What packages are required for this module to be executed?
  37. # `estimator` may depend on other packages. In order to reduce dependencies, it is not written here.
  38. REQUIRED = [
  39. "numpy>=1.20.0",
  40. "pandas>=0.25.1",
  41. "scipy>=1.0.0",
  42. "torch>=1.11.0",
  43. "cvxopt>=1.3.0",
  44. "tqdm>=4.65.0",
  45. "scikit-learn>=0.22",
  46. "joblib>=1.2.0",
  47. "pyyaml>=6.0",
  48. "fire>=0.3.1",
  49. "lightgbm>=3.3.0",
  50. "psutil>=5.9.4",
  51. "torchvision>=0.15.1",
  52. "sqlalchemy>=2.0.21",
  53. "shortuuid>=1.0.11",
  54. "docker>=6.1.3",
  55. "rapidfuzz>=3.4.0",
  56. "torchtext>=0.16.0",
  57. "sentence_transformers>=2.2.2",
  58. "torch-optimizer>=0.3.0",
  59. "langdetect>=1.0.9",
  60. "huggingface-hub<0.18",
  61. "portalocker>=2.0.0",
  62. ]
  63. if get_platform() != MACOS:
  64. REQUIRED.append("faiss-cpu>=1.7.1")
  65. here = os.path.abspath(os.path.dirname(__file__))
  66. with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
  67. long_description = f.read()
  68. if __name__ == "__main__":
  69. setup(
  70. name=NAME,
  71. version=VERSION,
  72. license="MIT Licence",
  73. url="https://github.com/Learnware-LAMDA/Learnware",
  74. packages=find_packages(),
  75. include_package_data=True,
  76. description=DESCRIPTION,
  77. long_description=long_description,
  78. long_description_content_type="text/markdown",
  79. python_requires=REQUIRES_PYTHON,
  80. install_requires=REQUIRED,
  81. classifiers=[
  82. "Intended Audience :: Science/Research",
  83. "Intended Audience :: Developers",
  84. "Programming Language :: Python",
  85. "Topic :: Software Development",
  86. "Topic :: Scientific/Engineering",
  87. "Operating System :: POSIX :: Linux",
  88. "Operating System :: Microsoft :: Windows",
  89. "Operating System :: MacOS",
  90. "Programming Language :: Python :: 3.6",
  91. "Programming Language :: Python :: 3.7",
  92. "Programming Language :: Python :: 3.8",
  93. ],
  94. )