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.5 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
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import os
  2. from setuptools import find_packages, setup
  3. from enum import Enum
  4. def read(rel_path: str) -> str:
  5. here = os.path.abspath(os.path.dirname(__file__))
  6. with open(os.path.join(here, rel_path), encoding="utf-8") as fp:
  7. return fp.read()
  8. def get_version(rel_path: str) -> str:
  9. for line in read(rel_path).splitlines():
  10. if line.startswith("__version__"):
  11. delim = '"' if '"' in line else "'"
  12. return line.split(delim)[1]
  13. raise RuntimeError("Unable to find version string.")
  14. # Package meta-data.
  15. NAME = "learnware"
  16. DESCRIPTION = "learnware market project"
  17. REQUIRES_PYTHON = ">=3.6.0"
  18. VERSION = get_version("learnware/__init__.py")
  19. # BEFORE importing setuptools, remove MANIFEST. Otherwise it may not be
  20. # properly updated when the contents of directories change (true for distutils,
  21. # not sure about setuptools).
  22. if os.path.exists("MANIFEST"):
  23. os.remove("MANIFEST")
  24. # What packages are required for this module to be executed?
  25. # `estimator` may depend on other packages. In order to reduce dependencies, it is not written here.
  26. REQUIRED = [
  27. "numpy>=1.20.0",
  28. "pandas>=0.25.1",
  29. "scipy>=1.0.0",
  30. "tqdm>=4.65.0",
  31. "scikit-learn>=0.22",
  32. "joblib>=1.2.0",
  33. "pyyaml>=6.0",
  34. "fire>=0.3.1",
  35. "psutil>=5.9.4",
  36. "sqlalchemy>=2.0.21",
  37. "shortuuid>=1.0.11",
  38. "docker>=6.1.3",
  39. "rapidfuzz>=3.4.0",
  40. "langdetect>=1.0.9",
  41. "huggingface-hub<0.18",
  42. "transformers>=4.34.1",
  43. "portalocker>=2.0.0",
  44. "qpsolvers[clarabel]>=4.0.1",
  45. "geatpy>=2.7.0;python_version<'3.11'",
  46. ]
  47. DEV_REQUIRED = [
  48. # For documentations
  49. "sphinx",
  50. "sphinx_book_theme==0.3.3",
  51. # CI dependencies
  52. "pytest>=3",
  53. "wheel",
  54. "setuptools",
  55. "pylint",
  56. # For static analysis
  57. "mypy<0.981",
  58. "flake8",
  59. "black==23.1.0",
  60. "pre-commit",
  61. ]
  62. FULL_REQUIRED = [
  63. # The default full requirements for learnware package
  64. "torch==2.0.1",
  65. "torchvision==0.15.2",
  66. "torch-optimizer>=0.3.0",
  67. "lightgbm>=3.3.0",
  68. "sentence_transformers==2.2.2",
  69. "fast_pytorch_kmeans==0.2.0.1",
  70. ]
  71. here = os.path.abspath(os.path.dirname(__file__))
  72. with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
  73. long_description = f.read()
  74. if __name__ == "__main__":
  75. setup(
  76. name=NAME,
  77. version=VERSION,
  78. license="MIT Licence",
  79. url="https://github.com/Learnware-LAMDA/Learnware",
  80. packages=find_packages(),
  81. include_package_data=True,
  82. description=DESCRIPTION,
  83. long_description=long_description,
  84. long_description_content_type="text/markdown",
  85. python_requires=REQUIRES_PYTHON,
  86. install_requires=REQUIRED,
  87. extras_require={
  88. "dev": DEV_REQUIRED,
  89. "full": FULL_REQUIRED,
  90. },
  91. classifiers=[
  92. "Intended Audience :: Science/Research",
  93. "Intended Audience :: Developers",
  94. "Programming Language :: Python",
  95. "Topic :: Software Development",
  96. "Topic :: Scientific/Engineering",
  97. "Operating System :: POSIX :: Linux",
  98. "Operating System :: Microsoft :: Windows",
  99. "Operating System :: MacOS",
  100. "Programming Language :: Python :: 3.7",
  101. "Programming Language :: Python :: 3.8",
  102. "Programming Language :: Python :: 3.9",
  103. "Programming Language :: Python :: 3.10",
  104. "Programming Language :: Python :: 3.11",
  105. ],
  106. )