setup.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright 2021-2025 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 for taipy-common package"""
  12. import json
  13. from pathlib import Path
  14. from setuptools import find_packages, setup
  15. root_folder = Path(__file__).parent
  16. package_desc = Path(root_folder / "package_desc.md").read_text("UTF-8")
  17. version_path = "taipy/common/version.json"
  18. setup_requirements = Path("taipy/common/setup.requirements.txt")
  19. with open(version_path) 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 = [r for r in (setup_requirements).read_text("UTF-8").splitlines() if r]
  25. test_requirements = ["pytest>=3.8"]
  26. setup(
  27. version=version_string,
  28. install_requires=requirements,
  29. packages=find_packages(
  30. where=root_folder, include=[
  31. "taipy",
  32. "taipy.common",
  33. "taipy.common.*",
  34. "taipy.common.config",
  35. "taipy.common.config.*",
  36. "taipy.common.logger",
  37. "taipy.common.logger.*",
  38. "taipy.common._cli",
  39. "taipy.common._cli.*"
  40. ]
  41. ),
  42. include_package_data=True,
  43. data_files=[('version', [version_path])],
  44. tests_require=test_requirements,
  45. )