setup.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Copyright 2023 Avaiga Private Limited
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  4. # the License. You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  9. # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  10. # specific language governing permissions and limitations under the License.
  11. """The setup script."""
  12. import json
  13. import subprocess
  14. from pathlib import Path
  15. from setuptools import find_packages, setup
  16. from setuptools.command.build_py import build_py
  17. root_folder = Path(__file__).parent
  18. readme = Path(root_folder / "README.md").read_text("UTF-8")
  19. with open(root_folder / "taipy" / "version.json") as version_file:
  20. version = json.load(version_file)
  21. version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
  22. if vext := version.get("ext"):
  23. version_string = f"{version_string}.{vext}"
  24. requirements = [
  25. "backports.zoneinfo>=0.2.1,<0.3;python_version<'3.9'",
  26. "cookiecutter>=2.1.1,<2.2",
  27. "toml>=0.10,<0.11",
  28. "deepdiff>=6.2,<6.3",
  29. "pyarrow>=10.0.1,<11.0",
  30. "networkx>=2.6,<3.0",
  31. "openpyxl>=3.1.2,<3.2",
  32. "modin[dask]>=0.23.0,<1.0",
  33. "pymongo[srv]>=4.2.0,<5.0",
  34. "sqlalchemy>=2.0.16,<2.1",
  35. "flask>=3.0.0,<3.1",
  36. "flask-cors>=4.0.0,<5.0",
  37. "flask-socketio>=5.3.6,<6.0",
  38. "markdown>=3.4.4,<4.0",
  39. "pandas>=2.0.0,<3.0",
  40. "python-dotenv>=1.0.0,<1.1",
  41. "pytz>=2021.3,<2022.2",
  42. "tzlocal>=3.0,<5.0",
  43. "backports.zoneinfo>=0.2.1,<0.3;python_version<'3.9'",
  44. "gevent>=23.7.0,<24.0",
  45. "gevent-websocket>=0.10.1,<0.11",
  46. "kthread>=0.2.3,<0.3",
  47. "gitignore-parser>=0.1,<0.2",
  48. "simple-websocket>=0.10.1,<1.0",
  49. "twisted>=23.8.0,<24.0",
  50. "flask-restful>=0.3.9,<0.4",
  51. "passlib>=1.7.4,<1.8",
  52. "marshmallow>=3.20.1,<3.30",
  53. "apispec[yaml]>=6.3,<7.0",
  54. "apispec-webframeworks>=0.5.2,<0.6",
  55. ]
  56. def get_requirements():
  57. #TODO get requirements from the different setups in tools/packages (removing taipy packages)
  58. return requirements
  59. test_requirements = ["pytest>=3.8"]
  60. extras_require = {
  61. "ngrok": ["pyngrok>=5.1,<6.0"],
  62. "image": [
  63. "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
  64. "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
  65. ],
  66. "rdp": ["rdp>=0.8"],
  67. "arrow": ["pyarrow>=10.0.1,<11.0"],
  68. "mssql": ["pyodbc>=4"],
  69. }
  70. class NPMInstall(build_py):
  71. def run(self):
  72. subprocess.run(["python", "bundle_build.py"], cwd=root_folder / "tools" / "frontend", check=True, shell=True)
  73. build_py.run(self)
  74. setup(
  75. author="Avaiga",
  76. author_email="dev@taipy.io",
  77. python_requires=">=3.8",
  78. classifiers=[
  79. "Intended Audience :: Developers",
  80. "License :: OSI Approved :: Apache Software License",
  81. "Natural Language :: English",
  82. "Programming Language :: Python :: 3",
  83. "Programming Language :: Python :: 3.8",
  84. "Programming Language :: Python :: 3.9",
  85. "Programming Language :: Python :: 3.10",
  86. "Programming Language :: Python :: 3.11",
  87. ],
  88. description="A 360° open-source platform from Python pilots to production-ready web apps.",
  89. install_requires=get_requirements(),
  90. entry_points={
  91. "console_scripts": [
  92. "taipy = taipy._entrypoint:_entrypoint",
  93. ]
  94. },
  95. license="Apache License 2.0",
  96. long_description=readme,
  97. long_description_content_type="text/markdown",
  98. keywords="taipy",
  99. name="taipy",
  100. packages=find_packages(include=["taipy", "taipy.*"]),
  101. include_package_data=True,
  102. test_suite="tests",
  103. url="https://github.com/avaiga/taipy",
  104. version=version_string,
  105. zip_safe=False,
  106. extras_require=extras_require,
  107. cmdclass={"build_py": NPMInstall},
  108. )