소스 검색

test global packaging and prepare individual packaging

Fred Lefévère-Laoide 1 년 전
부모
커밋
5b5a7fd4ce

+ 2 - 18
.github/workflows/packaging.yml

@@ -28,25 +28,9 @@ jobs:
         with:
           python-version: ${{ matrix.python-versions }}
 
-      - name: Get taipy-gui version from setup.py
-        id: taipy_gui_version
+      - name: Build frontends
         run: |
-          echo """
-          with open('setup.py') as f:
-              for line in f:
-                  if 'taipy-gui' in line:
-                      start = line.find('taipy-gui')
-                      end = line.rstrip().find('\",')
-                      print(f'VERSION={line[start:end]}')
-                      break
-          """ > ${{ runner.temp }}/get_gui_version.py
-          python ${{ runner.temp }}/get_gui_version.py >> $GITHUB_OUTPUT
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          # install taipy-gui from based on setup.py version
-          pip install "${{ steps.taipy_gui_version.outputs.VERSION }}"
+          python tools/frontend/bundle_build.py
 
       - name: Install Taipy without dependencies
         run: |

+ 15 - 0
MANIFEST.in

@@ -1,3 +1,18 @@
 include taipy/*.json
 include taipy/gui_core/*.json
 include taipy/gui_core/lib/*.js
+
+include taipy/config/*.pyi
+include taipy/config/*.json
+
+include taipy/core/*.json
+include taipy/core/config/*.json
+
+recursive-include taipy/gui/webapp *
+include taipy/gui/version.json
+include taipy/gui/viselements.json
+include taipy/gui/*.pyi
+
+include taipy/rest/*.json
+
+recursive-include taipy/templates *

+ 45 - 33
setup.py

@@ -13,18 +13,17 @@
 
 
 import json
-import os
-import sysconfig
-from importlib.util import find_spec
+import subprocess
 from pathlib import Path
 
-from setuptools import find_namespace_packages, find_packages, setup
+from setuptools import find_packages, setup
 from setuptools.command.build_py import build_py
 
-with open("README.md", "rb") as readme_file:
-    readme = readme_file.read().decode("UTF-8")
+root_folder = Path(__file__).parent
 
-with open(f"taipy{os.sep}version.json") as version_file:
+readme = Path(root_folder / "README.md").read_text("UTF-8")
+
+with open(root_folder / "taipy" / "version.json") as version_file:
     version = json.load(version_file)
     version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
     if vext := version.get("ext"):
@@ -33,11 +32,44 @@ with open(f"taipy{os.sep}version.json") as version_file:
 requirements = [
     "backports.zoneinfo>=0.2.1,<0.3;python_version<'3.9'",
     "cookiecutter>=2.1.1,<2.2",
-    "taipy-gui@git+https://git@github.com/Avaiga/taipy-gui.git@develop",
-    "taipy-rest@git+https://git@github.com/Avaiga/taipy-rest.git@develop",
-    "taipy-templates@git+https://git@github.com/Avaiga/taipy-templates.git@develop",
+
+    "toml>=0.10,<0.11",
+    "deepdiff>=6.2,<6.3",
+
+    "pyarrow>=10.0.1,<11.0",
+    "networkx>=2.6,<3.0",
+    "openpyxl>=3.1.2,<3.2",
+    "modin[dask]>=0.23.0,<1.0",
+    "pymongo[srv]>=4.2.0,<5.0",
+    "sqlalchemy>=2.0.16,<2.1",
+
+    "flask>=3.0.0,<3.1",
+    "flask-cors>=4.0.0,<5.0",
+    "flask-socketio>=5.3.6,<6.0",
+    "markdown>=3.4.4,<4.0",
+    "pandas>=2.0.0,<3.0",
+    "python-dotenv>=1.0.0,<1.1",
+    "pytz>=2021.3,<2022.2",
+    "tzlocal>=3.0,<5.0",
+    "backports.zoneinfo>=0.2.1,<0.3;python_version<'3.9'",
+    "gevent>=23.7.0,<24.0",
+    "gevent-websocket>=0.10.1,<0.11",
+    "kthread>=0.2.3,<0.3",
+    "gitignore-parser>=0.1,<0.2",
+    "simple-websocket>=0.10.1,<1.0",
+    "twisted>=23.8.0,<24.0",
+
+    "flask-restful>=0.3.9,<0.4",
+    "passlib>=1.7.4,<1.8",
+    "marshmallow>=3.20.1,<3.30",
+    "apispec[yaml]>=6.3,<7.0",
+    "apispec-webframeworks>=0.5.2,<0.6",
 ]
 
+def get_requirements():
+    #TODO get requirements from the different setups in tools/packages (removing taipy packages)
+    return requirements
+
 test_requirements = ["pytest>=3.8"]
 
 extras_require = {
@@ -52,29 +84,9 @@ extras_require = {
 }
 
 
-def _build_webapp():
-    already_exists = Path("./taipy/gui_core/lib/taipy-gui-core.js").exists()
-    if not already_exists:
-        # default site-packages path is from the current python interpreter
-        site_packages_path = sysconfig.get_path("purelib")
-        # taipy-gui should be available through setup_requires option
-        # taipy-gui at this step is installed in a backend site-packages separated from the one being used by pip
-        if find_spec("taipy") and find_spec("taipy.gui"):
-            import taipy
-
-            site_packages_path = Path(taipy.__file__).absolute().parent.parent
-
-        # Specify the correct path to taipy-gui in gui/.env file
-        env_file_path = Path(__file__).absolute().parent / "frontend" / "taipy" / ".env"
-        if not os.path.exists(env_file_path):
-            with open(env_file_path, "w") as env_file:
-                env_file.write(f"TAIPY_GUI_DIR={site_packages_path}\n")
-        os.system("cd frontend/taipy && npm ci && npm run build")
-
-
 class NPMInstall(build_py):
     def run(self):
-        _build_webapp()
+        subprocess.run(["python", "bundle_build.py"], cwd=root_folder / "tools" / "frontend", check=True, shell=True)
         build_py.run(self)
 
 
@@ -93,7 +105,7 @@ setup(
         "Programming Language :: Python :: 3.11",
     ],
     description="A 360° open-source platform from Python pilots to production-ready web apps.",
-    install_requires=requirements,
+    install_requires=get_requirements(),
     entry_points={
         "console_scripts": [
             "taipy = taipy._entrypoint:_entrypoint",
@@ -104,7 +116,7 @@ setup(
     long_description_content_type="text/markdown",
     keywords="taipy",
     name="taipy",
-    packages=find_namespace_packages(where="taipy") + find_packages(include=["taipy"]),
+    packages=find_packages(include=["taipy", "taipy.*"]),
     include_package_data=True,
     test_suite="tests",
     url="https://github.com/avaiga/taipy",

+ 20 - 7
tools/frontend/bundle_build.py

@@ -1,19 +1,31 @@
-import os
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+import subprocess
 import sys
 from pathlib import Path
 
 
-def build_gui(root_path):
+def build_gui(root_path: Path):
     print(f"Building taipy-gui frontend bundle in {root_path}.")
     already_exists = (root_path / "taipy" / "gui" / "webapp" / "index.html").exists()
     if already_exists:
         print(f'Found taipy-gui frontend bundle in {root_path  / "taipy" / "gui" / "webapp"}.')
     else:
-        os.system("cd frontend/taipy-gui/dom && npm ci")
-        os.system("cd frontend/taipy-gui && npm ci --omit=optional && npm run build")
+        subprocess.run(["npm", "ci"], cwd=root_path / "frontend" / "taipy-gui" / "dom", check=True, shell=True)
+        subprocess.run(["npm", "ci", "--omit=optional"], cwd=root_path / "frontend" / "taipy-gui", check=True, shell=True)
+        subprocess.run(["npm", "run", "build"], cwd=root_path / "frontend" / "taipy-gui", check=True, shell=True)
 
 
-def build_taipy(root_path):
+def build_taipy(root_path: Path):
     print(f"Building taipy frontend bundle in {root_path}.")
     already_exists = (root_path / "taipy" / "gui_core" / "lib" / "taipy-gui-core.js").exists()
     if already_exists:
@@ -21,10 +33,11 @@ def build_taipy(root_path):
     else:
         # Specify the correct path to taipy-gui in gui/.env file
         env_file_path = root_path / "frontend" / "taipy" / ".env"
-        if not os.path.exists(env_file_path):
+        if not env_file_path.exists():
             with open(env_file_path, "w") as env_file:
                 env_file.write(f"TAIPY_GUI_DIR={root_path}\n")
-        os.system("cd frontend/taipy && npm ci && npm run build")
+        subprocess.run(["npm", "ci"], cwd=root_path / "frontend" / "taipy", check=True, shell=True)
+        subprocess.run(["npm", "run", "build"], cwd=root_path / "frontend" / "taipy", check=True, shell=True)
 
 
 if __name__ == "__main__":

+ 2 - 0
tools/packages/taipy-config/MANIFEST.in

@@ -0,0 +1,2 @@
+include ../../../taipy/config/*.pyi
+include ../../../taipy/config/*.json

+ 64 - 0
tools/packages/taipy-config/setup.py

@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+"""The setup script."""
+import json
+
+from pathlib import Path
+
+from setuptools import find_packages, setup
+
+# assuming we're in tools/packages/taipy-config
+root_folder = Path(__file__).parent.parent.parent.parent
+
+readme = Path(root_folder / "README.md").read_text("UTF-8")
+
+with open(root_folder / "taipy" / "config" / "version.json") as version_file:
+    version = json.load(version_file)
+    version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
+    if vext := version.get("ext"):
+        version_string = f"{version_string}.{vext}"
+
+requirements = ["toml>=0.10,<0.11", "deepdiff>=6.2,<6.3"]
+
+test_requirements = ["pytest>=3.8"]
+
+setup(
+    author="Avaiga",
+    author_email="dev@taipy.io",
+    python_requires=">=3.8",
+    classifiers=[
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Apache Software License",
+        "Natural Language :: English",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+    ],
+    description="A Taipy package dedicated to easily configure a Taipy application.",
+    install_requires=requirements,
+    long_description=readme,
+    long_description_content_type="text/markdown",
+    include_package_data=True,
+    license="Apache License 2.0",
+    keywords="taipy-config",
+    name="taipy-config",
+    package_dir = {"" : "../../.."},
+    packages=find_packages(where=root_folder, include=["taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*"]),
+    test_suite="tests",
+    tests_require=test_requirements,
+    url="https://github.com/avaiga/taipy-config",
+    version=version_string,
+    zip_safe=False,
+)

+ 2 - 0
tools/packages/taipy-core/MANIFEST.in

@@ -0,0 +1,2 @@
+include ../../../taipy/core/*.json
+include ../../../taipy/core/config/*.json

+ 81 - 0
tools/packages/taipy-core/setup.py

@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+"""The setup script."""
+import json
+
+from pathlib import Path
+
+from setuptools import find_packages, setup
+
+root_folder = Path(__file__).parent.parent.parent.parent
+
+readme = Path(root_folder / "README.md").read_text("UTF-8")
+
+with open(root_folder / "taipy" / "core" / "version.json") as version_file:
+    version = json.load(version_file)
+    version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
+    if vext := version.get("ext"):
+        version_string = f"{version_string}.{vext}"
+
+requirements = [
+    "pyarrow>=10.0.1,<11.0",
+    "networkx>=2.6,<3.0",
+    "openpyxl>=3.1.2,<3.2",
+    "modin[dask]>=0.23.0,<1.0",
+    "pymongo[srv]>=4.2.0,<5.0",
+    "sqlalchemy>=2.0.16,<2.1",
+    "toml>=0.10,<0.11",
+    "taipy-config",
+]
+
+test_requirements = ["pytest>=3.8"]
+
+extras_require = {
+    "fastparquet": ["fastparquet==2022.11.0"],
+    "mssql": ["pyodbc>=4,<4.1"],
+    "mysql": ["pymysql>1,<1.1"],
+    "postgresql": ["psycopg2>2.9,<2.10"],
+}
+
+setup(
+    author="Avaiga",
+    author_email="dev@taipy.io",
+    python_requires=">=3.8",
+    classifiers=[
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Apache Software License",
+        "Natural Language :: English",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+    ],
+    description="A Python library to build powerful and customized data-driven back-end applications.",
+    install_requires=requirements,
+    long_description=readme,
+    long_description_content_type="text/markdown",
+    license="Apache License 2.0",
+    keywords="taipy-core",
+    name="taipy-core",
+    package_dir = {"" : "../../.."},
+    packages=find_packages(where=root_folder, include=["taipy", "taipy.core", "taipy.core.*"]),
+    include_package_data=True,
+    test_suite="tests",
+    tests_require=test_requirements,
+    url="https://github.com/avaiga/taipy-core",
+    version=version_string,
+    zip_safe=False,
+    extras_require=extras_require,
+)

+ 4 - 0
tools/packages/taipy-gui/MANIFEST.in

@@ -0,0 +1,4 @@
+recursive-include ../../../taipy/gui/webapp *
+include ../../../taipy/gui/version.json
+include ../../../taipy/gui/viselements.json
+include ../../../taipy/gui/*.pyi

+ 101 - 0
tools/packages/taipy-gui/setup.py

@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+"""The setup script."""
+
+import json
+from pathlib import Path
+import subprocess
+
+from setuptools import find_packages, setup
+from setuptools.command.build_py import build_py
+
+root_folder = Path(__file__).parent.parent.parent.parent
+
+readme = Path(root_folder / "README.md").read_text("UTF-8")
+
+with open(root_folder / "taipy" / "gui" / "version.json") as version_file:
+    version = json.load(version_file)
+    version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
+    if vext := version.get("ext"):
+        version_string = f"{version_string}.{vext}"
+
+requirements = [
+    "flask>=3.0.0,<3.1",
+    "flask-cors>=4.0.0,<5.0",
+    "flask-socketio>=5.3.6,<6.0",
+    "markdown>=3.4.4,<4.0",
+    "pandas>=2.0.0,<3.0",
+    "python-dotenv>=1.0.0,<1.1",
+    "pytz>=2021.3,<2022.2",
+    "tzlocal>=3.0,<5.0",
+    "backports.zoneinfo>=0.2.1,<0.3;python_version<'3.9'",
+    "gevent>=23.7.0,<24.0",
+    "gevent-websocket>=0.10.1,<0.11",
+    "kthread>=0.2.3,<0.3",
+    "taipy-config",
+    "gitignore-parser>=0.1,<0.2",
+    "simple-websocket>=0.10.1,<1.0",
+    "twisted>=23.8.0,<24.0",
+]
+
+test_requirements = ["pytest>=3.8"]
+
+extras_require = {
+    "ngrok": ["pyngrok>=5.1,<6.0"],
+    "image": [
+        "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
+        "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
+    ],
+    "arrow": ["pyarrow>=10.0.1,<11.0"],
+}
+
+
+class NPMInstall(build_py):
+    def run(self):
+        subprocess.run(["python", "bundle_build.py", "gui"], cwd=root_folder / "tools" / "frontend", check=True, shell=True)
+        build_py.run(self)
+
+
+setup(
+    author="Avaiga",
+    author_email="dev@taipy.io",
+    python_requires=">=3.8",
+    classifiers=[
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Apache Software License",
+        "Natural Language :: English",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+    ],
+    description="Low-code library to create graphical user interfaces on the Web for your Python applications.",
+    long_description=readme,
+    long_description_content_type="text/markdown",
+    install_requires=requirements,
+    license="Apache License 2.0",
+    include_package_data=True,
+    keywords="taipy-gui",
+    name="taipy-gui",
+    package_dir = {"" : "../../.."},
+    packages=find_packages(where=root_folder, include=["taipy", "taipy.gui", "taipy.gui.*"]),
+    test_suite="tests",
+    tests_require=test_requirements,
+    url="https://github.com/avaiga/taipy-gui",
+    version=version_string,
+    zip_safe=False,
+    extras_require=extras_require,
+    cmdclass={"build_py": NPMInstall},
+)

+ 1 - 0
tools/packages/taipy-rest/MANIFEST.in

@@ -0,0 +1 @@
+include ../../../taipy/rest/*.json

+ 60 - 0
tools/packages/taipy-rest/setup.py

@@ -0,0 +1,60 @@
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+import json
+
+from pathlib import Path
+
+from setuptools import find_namespace_packages, find_packages, setup
+
+root_folder = Path(__file__).parent.parent.parent.parent
+
+readme = Path(root_folder / "README.md").read_text("UTF-8")
+
+with open(root_folder / "taipy" / "rest" / "version.json") as version_file:
+    version = json.load(version_file)
+    version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
+    if vext := version.get("ext"):
+        version_string = f"{version_string}.{vext}"
+
+setup(
+    author="Avaiga",
+    name="taipy-rest",
+    keywords="taipy-rest",
+    python_requires=">=3.8",
+    version=version_string,
+    author_email="dev@taipy.io",
+    package_dir = {"" : "../../.."},
+    packages=find_packages(where=root_folder, include=["taipy", "taipy.rest", "taipy.rest.*"]),
+    include_package_data=True,
+    long_description=readme,
+    long_description_content_type="text/markdown",
+    description="Library to expose taipy-core REST APIs.",
+    license="Apache License 2.0",
+    classifiers=[
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Apache Software License",
+        "Natural Language :: English",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+    ],
+    install_requires=[
+        "flask>=3.0.0,<3.1",
+        "flask-restful>=0.3.9,<0.4",
+        "passlib>=1.7.4,<1.8",
+        "marshmallow>=3.20.1,<3.30",
+        "apispec[yaml]>=6.3,<7.0",
+        "apispec-webframeworks>=0.5.2,<0.6",
+        "taipy-core@git+https://git@github.com/Avaiga/taipy-core.git@develop",
+    ],
+)

+ 1 - 0
tools/packages/taipy-templates/MANIFEST.in

@@ -0,0 +1 @@
+recursive-include ../../../taipy/templates *

+ 59 - 0
tools/packages/taipy-templates/setup.py

@@ -0,0 +1,59 @@
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+"""The setup script."""
+
+import json
+
+from pathlib import Path
+
+from setuptools import find_packages, setup
+
+root_folder = Path(__file__).parent.parent.parent.parent
+
+readme = Path(root_folder / "README.md").read_text("UTF-8")
+
+with open(root_folder / "taipy" / "templates" / "version.json") as version_file:
+    version = json.load(version_file)
+    version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
+    if vext := version.get("ext"):
+        version_string = f"{version_string}.{vext}"
+
+test_requirements = ["pytest>=3.8"]
+
+setup(
+    author="Avaiga",
+    author_email="dev@taipy.io",
+    python_requires=">=3.8",
+    classifiers=[
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Apache Software License",
+        "Natural Language :: English",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+    ],
+    description="An open-source package holding Taipy application templates.",
+    license="Apache License 2.0",
+    long_description=readme,
+    long_description_content_type="text/markdown",
+    keywords="taipy-templates",
+    name="taipy-templates",
+    package_dir = {"" : "../../.."},
+    packages=find_packages(where=root_folder, include=["taipy"]),
+    include_package_data=True,
+    test_suite="tests",
+    url="https://github.com/avaiga/taipy-templates",
+    version=version_string,
+    zip_safe=False,
+)

+ 3 - 0
tools/packages/taipy/MANIFEST.in

@@ -0,0 +1,3 @@
+include ../../../taipy/*.json
+include ../../../taipy/gui_core/*.json
+include ../../../taipy/gui_core/lib/*.js

+ 95 - 0
tools/packages/taipy/setup.py

@@ -0,0 +1,95 @@
+# Copyright 2023 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+"""The setup script."""
+
+
+import json
+from pathlib import Path
+
+from setuptools import find_packages, setup
+from setuptools.command.build_py import build_py
+import subprocess
+
+root_folder = Path(__file__).parent.parent.parent.parent
+
+readme = Path(root_folder / "README.md").read_text("UTF-8")
+
+with open(root_folder / "taipy" / "version.json") as version_file:
+    version = json.load(version_file)
+    version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
+    if vext := version.get("ext"):
+        version_string = f"{version_string}.{vext}"
+
+requirements = [
+    "backports.zoneinfo>=0.2.1,<0.3;python_version<'3.9'",
+    "cookiecutter>=2.1.1,<2.2",
+    "taipy-gui",
+    "taipy-rest",
+    "taipy-templates",
+]
+
+test_requirements = ["pytest>=3.8"]
+
+extras_require = {
+    "ngrok": ["pyngrok>=5.1,<6.0"],
+    "image": [
+        "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
+        "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
+    ],
+    "rdp": ["rdp>=0.8"],
+    "arrow": ["pyarrow>=10.0.1,<11.0"],
+    "mssql": ["pyodbc>=4"],
+}
+
+
+class NPMInstall(build_py):
+    def run(self):
+        subprocess.run(["python", "bundle_build.py", "taipy"], cwd=root_folder / "tools" / "frontend", check=True, shell=True)
+        build_py.run(self)
+
+
+setup(
+    author="Avaiga",
+    author_email="dev@taipy.io",
+    python_requires=">=3.8",
+    classifiers=[
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Apache Software License",
+        "Natural Language :: English",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+    ],
+    description="A 360° open-source platform from Python pilots to production-ready web apps.",
+    install_requires=requirements,
+    entry_points={
+        "console_scripts": [
+            "taipy = taipy._entrypoint:_entrypoint",
+        ]
+    },
+    license="Apache License 2.0",
+    long_description=readme,
+    long_description_content_type="text/markdown",
+    keywords="taipy",
+    name="taipy",
+    package_dir = {"" : "../../.."},
+    packages=find_packages(where=root_folder, include=["taipy", "taipy.gui_core", "taipy._cli"]),
+    include_package_data=True,
+    test_suite="tests",
+    url="https://github.com/avaiga/taipy",
+    version=version_string,
+    zip_safe=False,
+    extras_require=extras_require,
+    cmdclass={"build_py": NPMInstall},
+)