Prechádzať zdrojové kódy

Merge branch 'develop' into fix/#803-align-core-service-logs

ooo oo 1 rok pred
rodič
commit
43d32f00dd

+ 0 - 171
.github/workflows/build-and-release-prod.yml

@@ -1,171 +0,0 @@
-name: Build a prod version for all packages and release them
-
-on:
-  workflow_dispatch:
-
-jobs:
-  fetch-versions:
-    runs-on: ubuntu-latest
-    outputs:
-        config_VERSION: ${{ steps.version-setup.outputs.config_VERSION }}
-        core_VERSION: ${{ steps.version-setup.outputs.core_VERSION }}
-        gui_VERSION: ${{ steps.version-setup.outputs.gui_VERSION }}
-        rest_VERSION: ${{ steps.version-setup.outputs.rest_VERSION }}
-        templates_VERSION: ${{ steps.version-setup.outputs.templates_VERSION }}
-        VERSION: ${{ steps.version-setup.outputs.VERSION }}
-        NEW_VERSION: ${{ steps.version-setup.outputs.NEW_VERSION }}
-    steps:
-      - uses: actions/checkout@v4
-      - name: Setup Dev Version
-        id: version-setup
-        run: |
-          python tools/release/setup_version.py ALL production >> $GITHUB_OUTPUT
-
-  build-and-release-taipy-packages:
-    needs: [fetch-versions]
-    timeout-minutes: 20
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        package: [config, core, gui, rest, templates]
-      max-parallel: 1
-    steps:
-      - uses: actions/checkout@v4
-        with:
-          ssh-key: ${{secrets.DEPLOY_KEY}}
-      - uses: actions/setup-python@v4
-        with:
-          python-version: 3.9
-      - uses: actions/setup-node@v4
-        with:
-          node-version: '20'
-
-      - name: Extract commit hash
-        shell: bash
-        run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
-        id: extract_hash
-
-      - name: Set Build Variables
-        id: set-variables
-        run: |
-          if [ "${{ matrix.package }}" == "config" ]; then
-            echo "package_version=${{needs.fetch-versions.outputs.config_VERSION}}" >> $GITHUB_OUTPUT
-            echo "package_dir=./taipy/config" >> $GITHUB_OUTPUT
-            echo "release_name=${{needs.fetch-versions.outputs.config_VERSION}}-config" >> $GITHUB_OUTPUT
-            echo "tar_path=./dist/${{ github.event.repository.name }}-config-${{needs.fetch-versions.outputs.config_VERSION}}.tar.gz" >> $GITHUB_OUTPUT
-          elif [ "${{ matrix.package }}" == "core" ]; then
-            echo "package_version=${{needs.fetch-versions.outputs.core_VERSION}}" >> $GITHUB_OUTPUT
-            echo "package_dir=./taipy/core" >> $GITHUB_OUTPUT
-            echo "release_name=${{needs.fetch-versions.outputs.core_VERSION}}-core" >> $GITHUB_OUTPUT
-            echo "tar_path=./dist/${{ github.event.repository.name }}-core-${{needs.fetch-versions.outputs.core_VERSION}}.tar.gz" >> $GITHUB_OUTPUT
-          elif [ "${{ matrix.package }}" == "gui" ]; then
-            echo "package_version=${{needs.fetch-versions.outputs.gui_VERSION}}" >> $GITHUB_OUTPUT
-            echo "package_dir=./taipy/gui" >> $GITHUB_OUTPUT
-            echo "release_name=${{needs.fetch-versions.outputs.gui_VERSION}}-gui" >> $GITHUB_OUTPUT
-            echo "tar_path=./dist/${{ github.event.repository.name }}-gui-${{needs.fetch-versions.outputs.gui_VERSION}}.tar.gz" >> $GITHUB_OUTPUT
-          elif [ "${{ matrix.package }}" == "rest" ]; then
-            echo "package_version=${{needs.fetch-versions.outputs.rest_VERSION}}" >> $GITHUB_OUTPUT
-            echo "package_dir=./taipy/rest" >> $GITHUB_OUTPUT
-            echo "release_name=${{needs.fetch-versions.outputs.rest_VERSION}}-rest" >> $GITHUB_OUTPUT
-            echo "tar_path=./dist/${{ github.event.repository.name }}-rest-${{needs.fetch-versions.outputs.rest_VERSION}}.tar.gz" >> $GITHUB_OUTPUT
-          elif [ "${{ matrix.package }}" == "templates" ]; then
-            echo "package_version=${{needs.fetch-versions.outputs.templates_VERSION}}" >> $GITHUB_OUTPUT
-            echo "package_dir=./taipy/templates" >> $GITHUB_OUTPUT
-            echo "release_name=${{needs.fetch-versions.outputs.templates_VERSION}}-templates" >> $GITHUB_OUTPUT
-            echo "tar_path=./dist/${{ github.event.repository.name }}-templates-${{needs.fetch-versions.outputs.templates_VERSION}}.tar.gz" >> $GITHUB_OUTPUT
-          fi
-        shell: bash
-
-      - name: Update setup.requirements.txt
-        run: |
-          python tools/release/update_setup_requirements.py taipy-${{ matrix.package }} \
-            ${{needs.fetch-versions.outputs.config_VERSION}} \
-            ${{needs.fetch-versions.outputs.core_VERSION}} \
-            ${{needs.fetch-versions.outputs.gui_VERSION}} \
-            ${{needs.fetch-versions.outputs.rest_VERSION}} \
-            ${{needs.fetch-versions.outputs.templates_VERSION}} \
-            dev
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install build wheel
-
-      - name: Build package
-        working-directory: ${{ steps.set-variables.outputs.package_dir }}
-        run: python setup.py build_py && python -m build
-
-      - name: Create tag and release
-        working-directory: ${{ steps.set-variables.outputs.package_dir }}
-        run: |
-          gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --title ${{ steps.set-variables.outputs.release_name }} --notes "Release ${{ steps.set-variables.outputs.release_name }}"
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Install Package
-        working-directory: ${{ steps.set-variables.outputs.package_dir }}
-        run: |
-          pip install ${{ steps.set-variables.outputs.tar_path }}
-
-  build-and-release-taipy:
-    runs-on: ubuntu-latest
-    needs: [ build-and-release-taipy-dev-packages, fetch-versions ]
-    timeout-minutes: 20
-    steps:
-      - uses: actions/checkout@v4
-        with:
-          ssh-key: ${{secrets.DEPLOY_KEY}}
-      - name: Extract commit hash
-        shell: bash
-        run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
-        id: extract_hash
-
-      - name: Set Build Variables
-        id: set-variables
-        run: |
-          echo "package_version=${{needs.fetch-versions.outputs.VERSION}}" >> $GITHUB_OUTPUT
-          echo "release_name=${{needs.fetch-versions.outputs.VERSION}}" >> $GITHUB_OUTPUT
-          echo "tar_path=./dist/${{ github.event.repository.name }}-${{needs.fetch-versions.outputs.VERSION}}.tar.gz" >> $GITHUB_OUTPUT
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install build wheel
-
-      - name: Build Taipy package
-        run: python setup.py build_py && python -m build
-
-      - name: Create tag and release Taipy
-        run: |
-          gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --title ${{ steps.set-variables.outputs.release_name }} --notes "Release ${{ steps.set-variables.outputs.release_name }}"
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Install Taipy
-        run: |
-          pip install ${{ steps.set-variables.outputs.tar_path }}
-
-      - name: Check Taipy Installation
-        run: |
-          python tools/validate_taipy_install.py
-
-      - name: Download packages
-        run: |
-          gh release download ${{ needs.fetch-versions.outputs.config_VERSION }}-config --skip-existing --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.core_VERSION }}-core --skip-existing --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.gui_VERSION }}-gui --skip-existing --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.rest_VERSION }}-rest --skip-existing --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.templates_VERSION }}-templates --skip-existing --dir dist
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Bundle all packages in main release tag
-        run: |
-          find dist -type f -print0 | xargs -r0 gh release upload ${{ needs.fetch-versions.outputs.VERSION }} --clobber
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Reset changes
-        run: |
-          git reset --hard HEAD
-          git clean -fdx

+ 78 - 36
.github/workflows/build-and-release-dev.yml → .github/workflows/build-and-release.yml

@@ -1,12 +1,19 @@
-name: Build a dev version for all packages and release them
+name: Build all taipy packages and release them
 
 on:
   workflow_dispatch:
     inputs:
-      publish_on_pypi:
-        description: "Should the packages be published on Pypi?"
+      internal_dep_on_pypi:
+        description: "Point taipy internal dependencies to Pypi? If false it will point to the github .tar.gz release file"
         default: "false"
         required: true
+      release_type:
+        description: "The type of release to be made (dev or production)"
+        default: "dev"
+        required: true
+      target_version:
+        description: "The version of the package to be released"
+        required: true
 
 jobs:
   fetch-versions:
@@ -21,12 +28,17 @@ jobs:
         NEW_VERSION: ${{ steps.version-setup.outputs.NEW_VERSION }}
     steps:
       - uses: actions/checkout@v4
-      - name: Setup Dev Version
+      - name: Extract branch name
+        shell: bash
+        run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
+        id: extract_branch
+
+      - name: Setup Version
         id: version-setup
         run: |
-          python tools/release/setup_version.py ALL dev >> $GITHUB_OUTPUT
+          python tools/release/setup_version.py ALL ${{ github.event.inputs.release_type }} ${{ github.event.inputs.target_version }} ${{ steps.extract_branch.outputs.branch }} >> $GITHUB_OUTPUT
 
-  build-and-release-taipy-dev-packages:
+  build-and-release-taipy-packages:
     needs: [fetch-versions]
     timeout-minutes: 20
     runs-on: ubuntu-latest
@@ -89,7 +101,7 @@ jobs:
             ${{needs.fetch-versions.outputs.gui_VERSION}} \
             ${{needs.fetch-versions.outputs.rest_VERSION}} \
             ${{needs.fetch-versions.outputs.templates_VERSION}} \
-            ${{ github.event.inputs.publish_on_pypi }}
+            ${{ github.event.inputs.internal_dep_on_pypi }}
 
       - name: Copy tools
         run: |
@@ -98,7 +110,40 @@ jobs:
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          pip install build wheel
+          pip install build wheel pipenv mypy black isort
+
+      - name: Install GUI dependencies
+        if: matrix.package == 'gui'
+        run: |
+          pipenv install --dev
+
+      - name: Generate GUI pyi file
+        if: matrix.package == 'gui'
+        run: |
+          cp tools/gui/generate_pyi.py pyi_temp.py && pipenv run python pyi_temp.py && rm pyi_temp.py
+
+      - name: Build frontends
+        if: matrix.package == 'gui'
+        run: |
+          python tools/frontend/bundle_build.py
+
+      - name: Copy files from tools
+        run: |
+          cp -r tools/packages/taipy-${{matrix.package}}/. ${{ steps.set-variables.outputs.package_dir }}
+
+      - name: Build Package Structure
+        working-directory: ${{ steps.set-variables.outputs.package_dir }}
+        run: |
+          python tools/release/build_package_structure.py ${{ matrix.package }}
+
+      - name: Copy Taipy Logger
+        if: matrix.package == 'config'
+        run: |
+          cp -r taipy/logger/. ${{ steps.set-variables.outputs.package_dir }}/taipy/logger
+
+      - name: Copy _cli folder
+        run: |
+          cp -r taipy/_cli/. ${{ steps.set-variables.outputs.package_dir }}/taipy/_cli
 
       - name: Build package
         working-directory: ${{ steps.set-variables.outputs.package_dir }}
@@ -108,24 +153,18 @@ jobs:
       - name: Create tag and release
         working-directory: ${{ steps.set-variables.outputs.package_dir }}
         run: |
-          gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.set-variables.outputs.release_name }} --notes "Release Draft ${{ steps.set-variables.outputs.release_name }}"
+           if [ "${{ github.event.inputs.release_type }}" == "dev" ]; then
+            gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.set-variables.outputs.release_name }} --notes "Release Draft ${{ steps.set-variables.outputs.release_name }}"
+           else
+            gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --title ${{ steps.set-variables.outputs.release_name }} --notes "Release ${{ steps.set-variables.outputs.release_name }}"
+           fi
+        shell: bash
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
-      - name: Install Package
-        working-directory: ${{ steps.set-variables.outputs.package_dir }}
-        run: |
-          pip install ${{ steps.set-variables.outputs.tar_path }}
-
-      - name: Publish to PyPI
-        if: github.event.inputs.publish_on_pypi == 'true'
-        uses: pypa/gh-action-pypi-publish@release/v1
-
-  build-and-release-taipy-dev:
-    permissions:
-      id-token: write  # IMPORTANT: this permission is mandatory for trusted publishing
+  build-and-release-taipy:
     runs-on: ubuntu-latest
-    needs: [ build-and-release-taipy-dev-packages, fetch-versions ]
+    needs: [build-and-release-taipy-packages, fetch-versions ]
     timeout-minutes: 20
     steps:
       - uses: actions/checkout@v4
@@ -151,33 +190,36 @@ jobs:
             ${{needs.fetch-versions.outputs.gui_VERSION}} \
             ${{needs.fetch-versions.outputs.rest_VERSION}} \
             ${{needs.fetch-versions.outputs.templates_VERSION}} \
-            ${{ github.event.inputs.publish_on_pypi }}
+            ${{ github.event.inputs.internal_dep_on_pypi }}
 
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
           pip install build wheel
 
-      - name: Build Taipy package
-        run: python setup.py build_py && python -m build
 
-      - name: Create tag and release Taipy
+      - name: Backup setup.py
         run: |
-          gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.set-variables.outputs.release_name }} --notes "Release Draft ${{ steps.set-variables.outputs.release_name }}"
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          mv setup.py setup.old.py
 
-      - name: Install Taipy
+      - name: Copy files from tools
         run: |
-          pip install ${{ steps.set-variables.outputs.tar_path }}
+          cp -r tools/packages/taipy/. .
 
-      - name: Check Taipy Installation
+      - name: Build Taipy package
         run: |
-          python tools/validate_taipy_install.py
+          python setup.py build_py && python -m build
 
-      - name: Publish to PyPI
-        if: github.event.inputs.publish_on_pypi == 'true'
-        uses: pypa/gh-action-pypi-publish@release/v1
+      - name: Create tag and release Taipy
+        run: |
+          if [ "${{ github.event.inputs.release_type }}" == "dev" ]; then
+            gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.set-variables.outputs.release_name }} --notes "Release Draft ${{ steps.set-variables.outputs.release_name }}"
+          else
+            gh release create ${{ steps.set-variables.outputs.release_name }} ${{ steps.set-variables.outputs.tar_path }} --target ${{ steps.extract_hash.outputs.HASH }} --title ${{ steps.set-variables.outputs.release_name }} --notes "Release ${{ steps.set-variables.outputs.release_name }}"
+          fi
+        shell: bash
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
       - name: Download packages
         run: |

+ 1 - 1
.github/workflows/publish.yml

@@ -71,7 +71,7 @@ jobs:
   publish-main-package-to-pypi:
     permissions:
       id-token: write  # IMPORTANT: this permission is mandatory for trusted publishing
-    needs: [ test-package ]
+    needs: [publish-subpackages-to-pypi, test-package ]
     timeout-minutes: 20
     environment: publish
     runs-on: ubuntu-latest

+ 1 - 1
taipy/config/version.json

@@ -1 +1 @@
-{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"}
+{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"}

+ 2 - 0
taipy/core/setup.py

@@ -36,6 +36,8 @@ def get_requirements():
     # get requirements from the different setups in tools/packages (removing taipy packages)
     reqs = set()
     for pkg in (root_folder / "tools" / "packages").iterdir():
+        if "taipy-core" not in str(pkg):
+            continue
         requirements_file = pkg / "setup.requirements.txt"
         if requirements_file.exists():
             reqs.update(requirements_file.read_text("UTF-8").splitlines())

+ 1 - 1
taipy/core/version.json

@@ -1 +1 @@
-{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"}
+{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"}

+ 2 - 0
taipy/gui/setup.py

@@ -36,6 +36,8 @@ def get_requirements():
     # get requirements from the different setups in tools/packages (removing taipy packages)
     reqs = set()
     for pkg in (root_folder / "tools" / "packages").iterdir():
+        if "taipy-gui" not in str(pkg):
+            continue
         requirements_file = pkg / "setup.requirements.txt"
         if requirements_file.exists():
             reqs.update(requirements_file.read_text("UTF-8").splitlines())

+ 1 - 1
taipy/gui/version.json

@@ -1 +1 @@
-{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"}
+{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"}

+ 2 - 0
taipy/rest/setup.py

@@ -31,6 +31,8 @@ def get_requirements():
     # get requirements from the different setups in tools/packages (removing taipy packages)
     reqs = set()
     for pkg in (root_folder / "tools" / "packages").iterdir():
+        if "taipy-rest" not in str(pkg):
+            continue
         requirements_file = pkg / "setup.requirements.txt"
         if requirements_file.exists():
             reqs.update(requirements_file.read_text("UTF-8").splitlines())

+ 1 - 1
taipy/rest/version.json

@@ -1 +1 @@
-{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"}
+{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"}

+ 1 - 1
taipy/templates/version.json

@@ -1 +1 @@
-{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"}
+{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"}

+ 1 - 1
taipy/version.json

@@ -1 +1 @@
-{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"}
+{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"}

+ 3 - 3
tools/gui/generate_pyi.py

@@ -38,9 +38,9 @@ replaced_content = ""
 with open(gui_pyi_file, "r") as file:
     for line in file:
         if "def run(" in line:
-            line = line.replace(
-                ", run_server: bool = ..., run_in_thread: bool = ..., async_mode: str = ..., **kwargs", gui_config
-            )
+            replace_str = line[line.index(", run_server") : (line.index("**kwargs") + len("**kwargs"))]
+            # ", run_server: bool = ..., run_in_thread: bool = ..., async_mode: str = ..., **kwargs"
+            line = line.replace(replace_str, gui_config)
         replaced_content = replaced_content + line
 
 with open(gui_pyi_file, "w") as write_file:

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

@@ -1,2 +1,4 @@
 include taipy/config/*.pyi
 include taipy/config/*.json
+include *.json
+include taipy/config/setup.requirements.txt

+ 9 - 4
tools/packages/taipy-config/setup.py

@@ -13,7 +13,6 @@
 
 """The setup script."""
 import json
-
 from pathlib import Path
 
 from setuptools import find_packages, setup
@@ -22,13 +21,17 @@ root_folder = Path(__file__).parent
 
 readme = Path(root_folder / "README.md").read_text("UTF-8")
 
-with open(root_folder / "taipy" / "config" / "version.json") as version_file:
+version_path = "taipy/config/version.json"
+
+setup_requirements = Path("taipy/config/setup.requirements.txt")
+
+with open(version_path) 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 = [r for r in (root_folder / "setup.requirements.txt").read_text("UTF-8").splitlines() if r]
+requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines() if r]
 
 test_requirements = ["pytest>=3.8"]
 
@@ -56,7 +59,9 @@ setup(
     keywords="taipy-config",
     name="taipy-config",
     packages=find_packages(
-        where=root_folder, include=["taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*"]
+        where=root_folder, include=[
+            "taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*", "taipy._cli", "taipy._cli.*"
+        ]
     ),
     test_suite="tests",
     tests_require=test_requirements,

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

@@ -1,2 +1,4 @@
 include taipy/core/*.json
 include taipy/core/config/*.json
+include *.json
+include taipy/core/setup.requirements.txt

+ 6 - 2
tools/packages/taipy-core/setup.py

@@ -22,13 +22,17 @@ root_folder = Path(__file__).parent
 
 readme = Path(root_folder / "README.md").read_text("UTF-8")
 
-with open(root_folder / "taipy" / "core" / "version.json") as version_file:
+version_path = "taipy/core/version.json"
+
+setup_requirements = Path("taipy/core/setup.requirements.txt")
+
+with open(version_path) 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 = [r for r in (root_folder / "setup.requirements.txt").read_text("UTF-8").splitlines() if r]
+requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines() if r]
 
 test_requirements = ["pytest>=3.8"]
 

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

@@ -2,3 +2,5 @@ recursive-include taipy/gui/webapp *
 include taipy/gui/version.json
 include taipy/gui/viselements.json
 include taipy/gui/*.pyi
+include *.json
+include taipy/gui/setup.requirements.txt

+ 7 - 2
tools/packages/taipy-gui/setup.py

@@ -14,6 +14,7 @@
 """The setup script."""
 
 import json
+import os
 import platform
 from pathlib import Path
 import subprocess
@@ -25,13 +26,17 @@ root_folder = Path(__file__).parent
 
 readme = Path(root_folder / "README.md").read_text("UTF-8")
 
-with open(root_folder / "taipy" / "gui" / "version.json") as version_file:
+version_path = os.path.join(root_folder, "taipy/gui/version.json")
+
+setup_requirements = Path("taipy/gui/setup.requirements.txt")
+
+with open(version_path) 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 = [r for r in (root_folder / "setup.requirements.txt").read_text("UTF-8").splitlines() if r]
+requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines() if r]
 
 test_requirements = ["pytest>=3.8"]
 

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

@@ -1 +1,3 @@
 include taipy/rest/*.json
+include *.json
+include taipy/rest/setup.requirements.txt

+ 6 - 2
tools/packages/taipy-rest/setup.py

@@ -18,13 +18,17 @@ root_folder = Path(__file__).parent
 
 readme = Path(root_folder / "README.md").read_text("UTF-8")
 
-with open(root_folder / "taipy" / "rest" / "version.json") as version_file:
+version_path = "taipy/rest/version.json"
+
+setup_requirements = Path("taipy/rest/setup.requirements.txt")
+
+with open(version_path) 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 = [r for r in (root_folder / "setup.requirements.txt").read_text("UTF-8").splitlines() if r]
+requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines() if r]
 
 setup(
     author="Avaiga",

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

@@ -1 +1,3 @@
 recursive-include taipy/templates *
+include *.json
+include taipy/templates/setup.requirements.txt

+ 6 - 2
tools/packages/taipy-templates/setup.py

@@ -21,13 +21,17 @@ root_folder = Path(__file__).parent
 
 readme = Path(root_folder / "README.md").read_text("UTF-8")
 
-with open(root_folder / "taipy" / "templates" / "version.json") as version_file:
+version_path = "taipy/templates/version.json"
+
+setup_requirements = Path("taipy/templates/setup.requirements.txt")
+
+with open(version_path) 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 = [r for r in (root_folder / "setup.requirements.txt").read_text("UTF-8").splitlines() if r]
+requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines() if r]
 
 test_requirements = ["pytest>=3.8"]
 

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

@@ -1,3 +1,28 @@
+recursive-include tools *
+
+# Package taipy
 include taipy/*.json
 include taipy/gui_core/*.json
 include taipy/gui_core/lib/*.js
+
+# Package taipy-config
+include taipy/config/*.pyi
+include taipy/config/*.json
+
+# Package taipy-core
+include taipy/core/*.json
+include taipy/core/config/*.json
+
+# Package taipy-gui
+recursive-include taipy/gui/webapp *
+include taipy/gui/version.json
+include taipy/gui/viselements.json
+include taipy/gui/*.pyi
+
+# Package taipy-rest
+include taipy/rest/*.json
+
+# Package taipy-templates
+recursive-include taipy/templates *
+
+include setup.requirements.txt

+ 7 - 17
tools/packages/taipy/setup.py

@@ -48,22 +48,12 @@ extras_require = {
 
 class NPMInstall(build_py):
     def run(self):
-        with_shell = platform.system() == "Windows"
-        print(f"Building taipy frontend bundle in {root_folder}.")
-        already_exists = (root_folder / "taipy" / "gui_core" / "lib" / "taipy-gui-core.js").exists()
-        if already_exists:
-            print(f'Found taipy frontend bundle in {root_folder / "taipy" / "gui_core" / "lib"}.')
-        else:
-            # Specify the correct path to taipy-gui in gui/.env file
-            env_file_path = root_folder / "frontend" / "taipy" / ".env"
-            if not env_file_path.exists():
-                with open(env_file_path, "w") as env_file:
-                    env_file.write(f"TAIPY_DIR={root_folder}\n")
-            subprocess.run(["npm", "ci"], cwd=root_folder / "frontend" / "taipy", check=True, shell=with_shell)
-            subprocess.run(
-                ["npm", "run", "build"], cwd=root_folder / "frontend" / "taipy", check=True, shell=with_shell
-            )
-
+        subprocess.run(
+            ["python", "bundle_build.py"],
+            cwd=root_folder / "tools" / "frontend",
+            check=True,
+            shell=platform.system() == "Windows",
+        )
         build_py.run(self)
 
 
@@ -94,7 +84,7 @@ setup(
     long_description_content_type="text/markdown",
     keywords="taipy",
     name="taipy",
-    packages=find_packages(include=["taipy", "taipy._cli", "taipy.gui_core"]),
+    packages=find_packages(include=["taipy", "taipy._cli", "taipy._cli.*", "taipy.gui_core"]),
     include_package_data=True,
     test_suite="tests",
     url="https://github.com/avaiga/taipy",

+ 31 - 0
tools/release/build_package_structure.py

@@ -0,0 +1,31 @@
+# Copyright 2021-2024 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 os
+import shutil
+import sys
+from pathlib import Path
+
+__SKIP = ["LICENSE", "MANIFEST.in", "taipy", "setup.py", "tools"]
+
+
+if __name__ == "__main__":
+    _package = sys.argv[1]
+    _package_path = f"taipy/{_package}"
+
+    Path(_package_path).mkdir(parents=True, exist_ok=True)
+
+    for file_name in os.listdir("."):
+        if file_name.lower().endswith(".md") or file_name in __SKIP:
+            continue
+        shutil.move(file_name, _package_path)
+
+    shutil.copy("../__init__.py", "./taipy/__init__.py")

+ 1 - 1
tools/release/setup_version.py

@@ -22,7 +22,7 @@ class Version:
     major: str
     minor: str
     patch: str
-    ext: str
+    ext: Optional[str] = None
 
     def bump_ext_version(self) -> None:
         if not self.ext:

+ 17 - 4
tools/release/update_setup_requirements.py

@@ -1,3 +1,14 @@
+# Copyright 2021-2024 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 os
 import sys
 from typing import Dict
@@ -8,8 +19,10 @@ BASE_PATH = "./tools/packages"
 def __build_taipy_package_line(line: str, version: str, publish_on_py_pi: bool) -> str:
     _line = line.strip()
     if publish_on_py_pi:
-        return f"{_line}=={version}"
-    return f"{_line} @ https://github.com/Avaiga/taipy/releases/download/{version}/{version}.tar.gz\n"
+        return f"{_line}=={version}\n"
+    tag = f"{version}-{_line.split('-')[1]}"
+    tar_name = f"{_line}-{version}"
+    return f"{_line} @ https://github.com/Avaiga/taipy/releases/download/{tag}/{tar_name}.tar.gz\n"
 
 
 def update_setup_requirements(package: str, versions: Dict, publish_on_py_pi: bool) -> None:
@@ -21,7 +34,7 @@ def update_setup_requirements(package: str, versions: Dict, publish_on_py_pi: bo
                 line = __build_taipy_package_line(line, v, publish_on_py_pi)
             lines.append(line)
 
-    with open(_path, 'w') as file:
+    with open(_path, "w") as file:
         file.writelines(lines)
 
 
@@ -34,6 +47,6 @@ if __name__ == "__main__":
         "taipy-rest": sys.argv[5],
         "taipy-templates": sys.argv[6],
     }
-    _publish_on_py_pi = bool(sys.argv[7])
+    _publish_on_py_pi = True if sys.argv[7] == "true" else False
 
     update_setup_requirements(_package, _versions, _publish_on_py_pi)