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
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 = "The learnware package supports the submission, usability testing, organization, identification, deployment, and reuse of learnware."
  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. # What packages are required for this module to be executed?
  24. # `estimator` may depend on other packages. In order to reduce dependencies, it is not written here.
  25. REQUIRED = [
  26. "numpy>=1.20.0",
  27. "pandas>=0.25.1",
  28. "scipy>=1.0.0",
  29. "tqdm>=4.65.0",
  30. "scikit-learn>=0.22",
  31. "joblib>=1.2.0",
  32. "pyyaml>=6.0",
  33. "fire>=0.3.1",
  34. "psutil>=5.9.4",
  35. "sqlalchemy>=2.0.21",
  36. "shortuuid>=1.0.11",
  37. "docker>=6.1.3",
  38. "rapidfuzz>=3.4.0",
  39. "langdetect>=1.0.9",
  40. "huggingface-hub<0.18",
  41. "transformers>=4.34.1",
  42. "portalocker>=2.0.0",
  43. "qpsolvers[clarabel]>=4.0.1",
  44. "geatpy>=2.7.0;python_version<'3.11'",
  45. ]
  46. DEV_REQUIRED = [
  47. # For documentations
  48. "sphinx",
  49. "sphinx_book_theme==0.3.3",
  50. # CI dependencies
  51. "pytest>=3",
  52. "wheel",
  53. "setuptools",
  54. "pylint",
  55. # For static analysis
  56. "mypy<0.981",
  57. "flake8",
  58. "black==23.1.0",
  59. "pre-commit",
  60. ]
  61. FULL_REQUIRED = [
  62. # The default full requirements for learnware package
  63. "torch==2.0.1",
  64. "torchvision==0.15.2",
  65. "torch-optimizer>=0.3.0",
  66. "lightgbm>=3.3.0",
  67. "sentence_transformers==2.2.2",
  68. "fast_pytorch_kmeans==0.2.0.1",
  69. ]
  70. here = os.path.abspath(os.path.dirname(__file__))
  71. with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
  72. long_description = f.read()
  73. if __name__ == "__main__":
  74. setup(
  75. name=NAME,
  76. version=VERSION,
  77. license="Apache-2.0 Licence",
  78. url="https://github.com/Learnware-LAMDA/learnware",
  79. packages=find_packages(),
  80. include_package_data=True,
  81. description=DESCRIPTION,
  82. long_description=long_description,
  83. long_description_content_type="text/markdown",
  84. python_requires=REQUIRES_PYTHON,
  85. install_requires=REQUIRED,
  86. extras_require={
  87. "dev": DEV_REQUIRED,
  88. "full": FULL_REQUIRED,
  89. },
  90. classifiers=[
  91. "Intended Audience :: Science/Research",
  92. "Intended Audience :: Developers",
  93. "Programming Language :: Python",
  94. "Topic :: Software Development",
  95. "Topic :: Scientific/Engineering",
  96. "Operating System :: POSIX :: Linux",
  97. "Operating System :: Microsoft :: Windows",
  98. "Programming Language :: Python :: 3.8",
  99. "Programming Language :: Python :: 3.9",
  100. "Programming Language :: Python :: 3.10",
  101. "Programming Language :: Python :: 3.11",
  102. ],
  103. )