Bladeren bron

chore: change setup.requirements to githubs dev version

Joao Andre 1 jaar geleden
bovenliggende
commit
054daa4d1f

+ 27 - 9
.github/workflows/build-and-release-dev.yml

@@ -1,10 +1,7 @@
 name: Build a dev version for all packages and release them
 name: Build a dev version for all packages and release them
 
 
 on:
 on:
-  pull_request_review:
-    types: [submitted]
-  push:
-    branches: [ develop, dev/*, release/*, feature/* ]
+  workflow_dispatch:
 
 
 jobs:
 jobs:
   fetch-versions:
   fetch-versions:
@@ -79,6 +76,15 @@ jobs:
           fi
           fi
         shell: bash
         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}}
+
       - name: Install dependencies
       - name: Install dependencies
         run: |
         run: |
           python -m pip install --upgrade pip
           python -m pip install --upgrade pip
@@ -108,6 +114,11 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
         with:
         with:
           ssh-key: ${{secrets.DEPLOY_KEY}}
           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
       - name: Set Build Variables
         id: set-variables
         id: set-variables
         run: |
         run: |
@@ -115,6 +126,11 @@ jobs:
           echo "release_name=${{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
           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
       - name: Build Taipy package
         run: python setup.py build_py && python -m build
         run: python setup.py build_py && python -m build
 
 
@@ -134,11 +150,13 @@ jobs:
 
 
       - name: Download packages
       - name: Download packages
         run: |
         run: |
-          gh release download ${{ needs.fetch-versions.outputs.config_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.core_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.gui_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.rest_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.templates_VERSION }} --dir dist
+          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
       - name: Bundle all packages in main release tag
         run: |
         run: |

+ 36 - 21
.github/workflows/build-and-release-prod.yml

@@ -2,10 +2,7 @@ name: Build a dev version for all packages and release them
 
 
 on:
 on:
   workflow_dispatch:
   workflow_dispatch:
-    inputs:
-      version:
-        description: "The release/package version to create (ex: 1.0.0)"
-        required: true
+
 jobs:
 jobs:
   fetch-versions:
   fetch-versions:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
@@ -18,15 +15,11 @@ jobs:
         VERSION: ${{ steps.version-setup.outputs.VERSION }}
         VERSION: ${{ steps.version-setup.outputs.VERSION }}
         NEW_VERSION: ${{ steps.version-setup.outputs.NEW_VERSION }}
         NEW_VERSION: ${{ steps.version-setup.outputs.NEW_VERSION }}
     steps:
     steps:
-      - name: Extract branch name
-        shell: bash
-        run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
-        id: extract_branch
-
+      - uses: actions/checkout@v4
       - name: Setup Dev Version
       - name: Setup Dev Version
         id: version-setup
         id: version-setup
         run: |
         run: |
-          python tools/release/setup_version.py ALL prod ${{ github.event.inputs.version }} ${{ steps.extract_branch.outputs.branch }} >> $GITHUB_OUTPUT
+          python tools/release/setup_version.py ALL production >> $GITHUB_OUTPUT
 
 
   build-and-release-taipy-packages:
   build-and-release-taipy-packages:
     needs: [fetch-versions]
     needs: [fetch-versions]
@@ -35,6 +28,7 @@ jobs:
     strategy:
     strategy:
       matrix:
       matrix:
         package: [config, core, gui, rest, templates]
         package: [config, core, gui, rest, templates]
+      max-parallel: 1
     steps:
     steps:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
         with:
         with:
@@ -82,6 +76,16 @@ jobs:
           fi
           fi
         shell: bash
         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
       - name: Install dependencies
         run: |
         run: |
           python -m pip install --upgrade pip
           python -m pip install --upgrade pip
@@ -94,7 +98,7 @@ jobs:
       - name: Create tag and release
       - name: Create tag and release
         working-directory: ${{ steps.set-variables.outputs.package_dir }}
         working-directory: ${{ steps.set-variables.outputs.package_dir }}
         run: |
         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 }}"
+          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:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
 
@@ -108,6 +112,14 @@ jobs:
     needs: [ build-and-release-taipy-dev-packages, fetch-versions ]
     needs: [ build-and-release-taipy-dev-packages, fetch-versions ]
     timeout-minutes: 20
     timeout-minutes: 20
     steps:
     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
       - name: Set Build Variables
         id: set-variables
         id: set-variables
         run: |
         run: |
@@ -115,12 +127,17 @@ jobs:
           echo "release_name=${{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
           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
       - name: Build Taipy package
         run: python setup.py build_py && python -m build
         run: python setup.py build_py && python -m build
 
 
       - name: Create tag and release Taipy
       - name: Create tag and release Taipy
         run: |
         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 }}"
+          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:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
 
@@ -134,11 +151,13 @@ jobs:
 
 
       - name: Download packages
       - name: Download packages
         run: |
         run: |
-          gh release download ${{ needs.fetch-versions.outputs.config_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.core_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.gui_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.rest_VERSION }} --dir dist
-          gh release download ${{ needs.fetch-versions.outputs.templates_VERSION }} --dir dist
+          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
       - name: Bundle all packages in main release tag
         run: |
         run: |
@@ -150,7 +169,3 @@ jobs:
         run: |
         run: |
           git reset --hard HEAD
           git reset --hard HEAD
           git clean -fdx
           git clean -fdx
-
-      - uses: stefanzweifel/git-auto-commit-action@v4
-        with:
-          commit_message: Update version to ${{ needs.fetch-versions.outputs.NEW_VERSION }}

+ 1 - 108
.github/workflows/overall-tests.yml

@@ -51,116 +51,9 @@ jobs:
           title: Taipy Overall Coverage Report
           title: Taipy Overall Coverage Report
 
 
       - name: Notify user if failed
       - name: Notify user if failed
-        if: failure()
+        if: failure() && github.event_name == 'workflow_dispatch'
         run: |
         run: |
           if [[ -n "${{ github.event.inputs.user-to-notify }}" ]]; then
           if [[ -n "${{ github.event.inputs.user-to-notify }}" ]]; then
             curl "${{ secrets.notify_endpoint }}" -d '{"username": "${{ github.event.inputs.user-to-notify }}", "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" }' -H "Content-Type: application/json"
             curl "${{ secrets.notify_endpoint }}" -d '{"username": "${{ github.event.inputs.user-to-notify }}", "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" }' -H "Content-Type: application/json"
           fi
           fi
         shell: bash
         shell: bash
-
-  submit_tests:
-    needs: linter
-    timeout-minutes: 20
-    strategy:
-      fail-fast: false
-      matrix:
-        python-version: [ '3.8', '3.9', '3.10', '3.11' ]
-        os: [ ubuntu-latest, windows-latest, macos-latest ]
-    runs-on: ${{ matrix.os }}
-    steps:
-      - uses: actions/checkout@v4
-
-      - uses: actions/setup-python@v5
-        with:
-          python-version: ${{matrix.python-version}}
-
-      - name: Install pipenv
-        run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
-
-      - name: Install Dependencies
-        run: pipenv install --dev --python=${{ matrix.python-version }}
-
-      - name: Setup LibMagic (MacOS)
-        if: matrix.os == 'macos-latest'
-        run: brew install libmagic
-
-      - name: Pytest Core orchestrator_dispatcher
-        run: pipenv run pytest -m "orchestrator_dispatcher" tests
-
-  standalone_tests:
-    needs: linter
-    timeout-minutes: 20
-    strategy:
-      fail-fast: false
-      matrix:
-        python-version: [ '3.8', '3.9', '3.10', '3.11' ]
-        os: [ ubuntu-latest, windows-latest, macos-latest ]
-    runs-on: ${{ matrix.os }}
-    steps:
-      - uses: actions/checkout@v4
-
-      - uses: dorny/paths-filter@v2
-        id: changes
-        with:
-          filters: |
-            core:
-              - 'taipy/core/**'
-
-      - uses: actions/setup-python@v5
-        with:
-          python-version: ${{matrix.python-version}}
-
-      - name: Install pipenv
-        if: steps.changes.outputs.core == 'true'
-        run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
-
-      - name: Install Dependencies
-        if: steps.changes.outputs.core == 'true'
-        run: pipenv install --dev --python=${{ matrix.python-version }}
-
-      - name: Setup LibMagic (MacOS)
-        if: matrix.os == 'macos-latest' && steps.changes.outputs.core == 'true'
-        run: brew install libmagic
-
-      - name: Pytest Core standalone
-        if: steps.changes.outputs.core == 'true'
-        run: pipenv run pytest -m "standalone" tests/core
-
-  modin_tests:
-    needs: linter
-    timeout-minutes: 20
-    strategy:
-      fail-fast: false
-      matrix:
-        python-version: [ '3.8', '3.9', '3.10', '3.11' ]
-        os: [ ubuntu-latest, windows-latest, macos-latest ]
-    runs-on: ${{ matrix.os }}
-    steps:
-      - uses: actions/checkout@v4
-
-      - uses: dorny/paths-filter@v2
-        id: changes
-        with:
-          filters: |
-            core:
-              - 'taipy/core/**'
-
-      - uses: actions/setup-python@v5
-        with:
-          python-version: ${{matrix.python-version}}
-
-      - name: Install pipenv
-        if: steps.changes.outputs.core == 'true'
-        run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
-
-      - name: Install Dependencies
-        if: steps.changes.outputs.core == 'true'
-        run: pipenv install --dev --python=${{ matrix.python-version }}
-
-      - name: Setup LibMagic (MacOS)
-        if: matrix.os == 'macos-latest' && steps.changes.outputs.core == 'true'
-        run: brew install libmagic
-
-      - name: Pytest Core modin
-        if: steps.changes.outputs.core == 'true'
-        run: pipenv run pytest -m "modin" tests/core

+ 10 - 0
.github/workflows/partial-tests.yml

@@ -11,6 +11,16 @@ jobs:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
+
+      - uses: ricardochaves/python-lint@v1.4.0
+        with:
+          use-black: false
+          use-flake8: false
+          use-isort: false
+          use-pycodestyle: false
+          use-pylint: false
+          extra-mypy-options: "--ignore-missing-imports --implicit-optional --no-namespace-packages --exclude (taipy/templates/|generate_pyi.py|tools) --follow-imports skip"
+
       - uses: chartboost/ruff-action@v1
       - uses: chartboost/ruff-action@v1
   tests:
   tests:
     needs: linter
     needs: linter

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

@@ -79,15 +79,4 @@ jobs:
         run: |
         run: |
           pip install --upgrade pip
           pip install --upgrade pip
           pip install --no-cache-dir ${{ github.event.repository.name }}==${{ github.event.inputs.version }}
           pip install --no-cache-dir ${{ github.event.repository.name }}==${{ github.event.inputs.version }}
-          python -c "import taipy as tp; tp.Scenario"
-          python -c "import taipy as tp; tp.gui"
-          python -c "import taipy as tp; tp.rest"
-
-          echo """
-          import taipy
-          from pathlib import Path
-          taipy_gui_core_path = Path(taipy.__file__).absolute().parent / 'gui_core' / 'lib' / 'taipy-gui-core.js'
-          if not taipy_gui_core_path.exists():
-              raise FileNotFoundError(f'taipy-gui-core.js not found in {taipy_gui_core_path}')
-          """ > ${{ runner.temp }}/verify_gui_core.py
-          python ${{ runner.temp }}/verify_gui_core.py
+          python tools/validate_taipy_install.py

+ 0 - 173
.github/workflows/release-dev-old.yml

@@ -1,173 +0,0 @@
-name: Create Github Dev Release
-
-on:
-  workflow_dispatch:
-    inputs:
-      taipy-gui-version:
-        description: "The taipy-gui version to use (ex: 2.3.0.dev0)"
-        required: true
-      taipy-rest-version:
-        description: "The taipy-rest version to use (ex: 2.3.0.dev0)"
-      taipy-templates-version:
-        description: "The taipy-templates version to use (ex: 2.3.0.dev0)"
-
-jobs:
-  release-dev-package:
-    timeout-minutes: 20
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v3
-        with:
-          ssh-key: ${{secrets.DEPLOY_KEY}}
-      - uses: actions/setup-python@v4
-        with:
-          python-version: 3.11
-      - uses: actions/setup-node@v4
-        with:
-          node-version: '20'
-
-      - name: Ensure package version has 'dev' suffix
-        run: |
-          echo """
-          import json, sys, os
-          SUFFIX = 'dev'
-          with open(f\"taipy{os.sep}version.json\") as version_file:
-              version_o = json.load(version_file)
-          version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
-          if vext := version_o.get(\"ext\"):
-              version = f'{version}.{vext}'
-          if SUFFIX not in version:
-              raise ValueError(f\"version {version} does not contain suffix {SUFFIX}\")
-          """ > ${{ runner.temp }}/check1.py
-          python ${{ runner.temp }}/check1.py
-
-      - name: Extract package version
-        id: current-version
-        run: |
-          echo """
-          import json, os
-          with open(f\"taipy{os.sep}version.json\") as version_file:
-              version_o = json.load(version_file)
-          version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
-          if vext := version_o.get(\"ext\"):
-              version = f'{version}.{vext}'
-          print(f'VERSION={version}')
-          """ > ${{ runner.temp }}/check2.py
-          python ${{ runner.temp }}/check2.py >> $GITHUB_OUTPUT
-
-      - name: Check taipy-gui dependencies
-        run: |
-          curl https://pypi.org/simple/taipy-gui/ | grep -o ">taipy-gui-${{ github.event.inputs.taipy-gui-version }}\.tar\.gz<"
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install build wheel
-          pip install "taipy-gui==${{ github.event.inputs.taipy-gui-version }}"
-
-      - name: Check dependencies are available
-        if: github.event.inputs.taipy-rest-version != '' && github.event.inputs.taipy-templates-version != ''
-        run: |
-          curl https://pypi.org/simple/taipy-rest/ | grep -o ">taipy-rest-${{ github.event.inputs.taipy-rest-version }}\.tar\.gz<"
-          curl https://pypi.org/simple/taipy-templates/ | grep -o ">taipy-templates-${{ github.event.inputs.taipy-templates-version }}\.tar\.gz<"
-
-      - name: Update setup.py locally
-        if: github.event.inputs.taipy-gui-version != '' && github.event.inputs.taipy-rest-version != '' && github.event.inputs.taipy-templates-version != ''
-        run: |
-          mv setup.py setup.taipy.py
-          echo """
-          import sys
-          with open('setup.taipy.py', mode='r') as setup_r, open('setup.py', mode='w') as setup_w:
-              in_requirements = False
-              looking = True
-              for line in setup_r:
-                  if looking:
-                      if line.lstrip().startswith('requirements') and line.rstrip().endswith('['):
-                          in_requirements = True
-                      elif in_requirements:
-                          if line.strip() == ']':
-                              looking = False
-                          else:
-                              if line.lstrip().startswith('\"taipy-gui@git+https'):
-                                  start = line.find('\"taipy-gui')
-                                  end = line.rstrip().find(',')
-                                  line = f'{line[:start]}\"taipy-gui=={sys.argv[1]}\"{line[end:]}'
-                              elif line.lstrip().startswith('\"taipy-rest@git+https'):
-                                  start = line.find('\"taipy-rest')
-                                  end = line.rstrip().find(',')
-                                  line = f'{line[:start]}\"taipy-rest=={sys.argv[2]}\"{line[end:]}'
-                              elif line.lstrip().startswith('\"taipy-templates@git+https'):
-                                  start = line.find('\"taipy-templates')
-                                  end = line.rstrip().find(',')
-                                  line = f'{line[:start]}\"taipy-templates=={sys.argv[3]}\"{line[end:]}'
-                  setup_w.write(line)
-          """ > ${{ runner.temp }}/write_setup_taipy.py
-          python ${{ runner.temp }}/write_setup_taipy.py "${{ github.event.inputs.taipy-gui-version }}" "${{ github.event.inputs.taipy-rest-version }}" "${{ github.event.inputs.taipy-templates-version }}"
-
-      - name: Build package
-        run: python setup.py build_py && python -m build
-
-      - name: Install the package and test it
-        run: |
-          # Install package
-          echo "Installing package..."
-          pip install ./dist/${{ github.event.repository.name }}-${{ steps.current-version.outputs.VERSION }}.tar.gz
-
-          # Run tests
-          python -c "import taipy as tp; tp.Scenario"
-          python -c "import taipy as tp; tp.gui"
-          python -c "import taipy as tp; tp.rest"
-
-          echo """
-          import taipy
-          from pathlib import Path
-          taipy_gui_core_path = Path(taipy.__file__).absolute().parent / 'gui_core' / 'lib' / 'taipy-gui-core.js'
-          if not taipy_gui_core_path.exists():
-              raise FileNotFoundError(f'taipy-gui-core.js not found in {taipy_gui_core_path}')
-          """ > ${{ runner.temp }}/verify_gui_core.py
-          python ${{ runner.temp }}/verify_gui_core.py
-
-      - name: Extract commit hash
-        shell: bash
-        run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
-        id: extract_hash
-
-      - name: Create/update release and tag
-        run: |
-          echo "Creating release ${{ steps.current-version.outputs.VERSION }}"
-          gh release create ${{ steps.current-version.outputs.VERSION }} ./dist/${{ github.event.repository.name }}-${{ steps.current-version.outputs.VERSION }}.tar.gz --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.current-version.outputs.VERSION }} --notes "Release Draft ${{ steps.current-version.outputs.VERSION }}"
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Reset changes
-        run: |
-          git reset --hard HEAD
-          git clean -fdx
-
-      - name: Increase dev version
-        id: new-version
-        run: |
-          echo """
-          import json, os
-          with open(f'taipy{os.sep}version.json') as version_file:
-              version_o = json.load(version_file)
-              if version_o is None or 'dev' not in version_o['ext']:
-                  raise ValueError('Invalid version file. Version must contain dev suffix.')
-              prev_version = version_o['ext']
-              new_version = 'dev' + str(int(version_o['ext'].replace('dev', '')) + 1)
-              with open(f'taipy{os.sep}version.json') as r:
-                  text = r.read().replace(prev_version, new_version)
-              with open(f'taipy{os.sep}version.json', mode='w') as w:
-                  w.write(text)
-              with open(f\"taipy{os.sep}version.json\") as version_file:
-                  version_o = json.load(version_file)
-              version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
-              if vext := version_o.get(\"ext\"):
-                  version = f'{version}.{vext}'
-              print(f'VERSION={version}')
-          """ > ${{ runner.temp }}/increase_dev_version.py
-          python ${{ runner.temp }}/increase_dev_version.py >> $GITHUB_OUTPUT
-
-      - uses: stefanzweifel/git-auto-commit-action@v4
-        with:
-          commit_message: Update version to ${{ steps.new-version.outputs.VERSION }}

+ 0 - 90
.github/workflows/release-dev.yml

@@ -1,90 +0,0 @@
-name: Create Github Dev Release
-
-on:
-  workflow_dispatch:
-    inputs:
-      taipy-gui-version:
-        description: "The taipy-gui version to use (ex: 2.3.0.dev0)"
-        required: true
-      taipy-rest-version:
-        description: "The taipy-rest version to use (ex: 2.3.0.dev0)"
-      taipy-templates-version:
-        description: "The taipy-templates version to use (ex: 2.3.0.dev0)"
-
-jobs:
-  release-dev-package-v2:
-    timeout-minutes: 20
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-        with:
-          ssh-key: ${{secrets.DEPLOY_KEY}}
-      - uses: actions/setup-python@v4
-        with:
-          python-version: 3.11
-      - uses: actions/setup-node@v4
-        with:
-          node-version: '20'
-
-      - name: Setup Dev Version
-        id: version-setup
-        run: |
-          python tools/release/setup_version.py taipy dev >> $GITHUB_OUTPUT
-
-      - name: Check Taipy Gui version is available
-        run: |
-          curl https://pypi.org/simple/taipy-gui/ | grep -o ">taipy-gui-${{ github.event.inputs.taipy-gui-version }}\.tar\.gz<"
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install build wheel
-
-      - name: Install Taipy Gui
-        run: |
-          pip install "taipy-gui==${{ github.event.inputs.taipy-gui-version }}"
-
-      - name: Check Taipy Rest and Taipy Templates are available
-        if: github.event.inputs.taipy-rest-version != '' && github.event.inputs.taipy-templates-version != ''
-        run: |
-          curl https://pypi.org/simple/taipy-rest/ | grep -o ">taipy-rest-${{ github.event.inputs.taipy-rest-version }}\.tar\.gz<"
-          curl https://pypi.org/simple/taipy-templates/ | grep -o ">taipy-templates-${{ github.event.inputs.taipy-templates-version }}\.tar\.gz<"
-
-      - name: Update setup.py locally
-        if: github.event.inputs.taipy-gui-version != '' && github.event.inputs.taipy-rest-version != '' && github.event.inputs.taipy-templates-version != ''
-        run: |
-          mv setup.py setup.taipy.py
-          python tools/release/update_setup.py "${{ github.event.inputs.taipy-gui-version }}" "${{ github.event.inputs.taipy-rest-version }}" "${{ github.event.inputs.taipy-templates-version }}"
-
-      - name: Build Taipy package
-        run: python setup.py build_py && python -m build
-
-      - name: Install the Taipy package and test it
-        run: |
-          # Install package
-          echo "Installing package..."
-          pip install ./dist/${{ github.event.repository.name }}-${{ steps.version-setup.outputs.VERSION }}.tar.gz
-
-      - name: Check Taipy Installation
-        run: |
-          python tools/validate_taipy_install.py
-
-      - name: Extract commit hash
-        shell: bash
-        run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
-        id: extract_hash
-
-      - name: Create/update release and tag
-        run: |
-          echo "Creating release ${{ steps.current-version.outputs.VERSION }}"
-          gh release create ${{ steps.version-setup.outputs.VERSION }} ./dist/${{ github.event.repository.name }}-${{ steps.version-setup.outputs.VERSION }}.tar.gz --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.version-setup.outputs.VERSION }} --notes "Release Draft ${{ steps.version-setup.outputs.VERSION }}"
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Reset changes
-        run: |
-          git reset --hard HEAD
-          git clean -fdx
-
-      - uses: stefanzweifel/git-auto-commit-action@v4
-        with:
-          commit_message: Update version to ${{ steps.version-setup.outputs.NEW_VERSION }}

+ 0 - 106
.github/workflows/release-old.yml

@@ -1,106 +0,0 @@
-name: Create Github Release
-
-on:
-  workflow_dispatch:
-    inputs:
-      version:
-        description: "The release/package version to create (ex: 1.0.0)"
-        required: true
-
-jobs:
-  release-package:
-    timeout-minutes: 20
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v3
-      - uses: actions/setup-python@v4
-        with:
-          python-version: 3.11
-      - uses: actions/setup-node@v4
-        with:
-          node-version: '20'
-
-      - name: Extract branch name
-        shell: bash
-        run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
-        id: extract_branch
-
-      - name: Ensure package version is properly set
-        run: |
-          echo """
-          import json, sys, os
-          with open(f\"taipy{os.sep}version.json\") as version_file:
-              version_o = json.load(version_file)
-          version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
-          if vext := version_o.get(\"ext\"):
-              version = f'{version}.{vext}'
-          if version != sys.argv[1]:
-              raise ValueError(f\"Invalid version {version} / {sys.argv[1]}\")
-          """ > ${{ runner.temp }}/check1.py
-          python ${{ runner.temp }}/check1.py "${{ github.event.inputs.version }}"
-
-      - name: Validate branch name
-        run: |
-          echo """
-          import json, sys, os
-          with open(f\"taipy{os.sep}version.json\") as version_file:
-              version = json.load(version_file)
-          if f'release/{version.get(\"major\")}.{version.get(\"minor\")}' != sys.argv[1]:
-              raise ValueError(f'Branch name mismatch: release/{version.get(\"major\")}.{version.get(\"minor\")} != {sys.argv[1]}')
-          """ > ${{ runner.temp }}/check2.py
-          python ${{ runner.temp }}/check2.py "${{ steps.extract_branch.outputs.branch }}"
-
-      - name: Modify README image file path
-        run: |
-          cp tools/modify_readme.py ${{ runner.temp }}
-          python ${{ runner.temp }}/modify_readme.py "${{ github.event.repository.name }}" "${{ steps.extract_branch.outputs.branch }}"
-
-      - name: Get taipy-gui version from setup.py
-        id: taipy_gui_version
-        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
-          pip install build wheel
-          # install taipy-gui from based on setup.py version
-          pip install "${{ steps.taipy_gui_version.outputs.VERSION }}"
-
-      - name: Build and test the package
-        run: |
-          python setup.py build_py && python -m build
-          rm -rf taipy
-          pip install dist/*.tar.gz
-          python -c "import taipy as tp; tp.Scenario"
-          python -c "import taipy as tp; tp.gui"
-          python -c "import taipy as tp; tp.rest"
-
-          echo """
-          import taipy
-          from pathlib import Path
-          taipy_gui_core_path = Path(taipy.__file__).absolute().parent / 'gui_core' / 'lib' / 'taipy-gui-core.js'
-          if not taipy_gui_core_path.exists():
-              raise FileNotFoundError(f'taipy-gui-core.js not found in {taipy_gui_core_path}')
-          """ > ${{ runner.temp }}/verify_gui_core.py
-          python ${{ runner.temp }}/verify_gui_core.py
-
-      - name: Extract commit hash
-        shell: bash
-        run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
-        id: extract_hash
-
-      - name: Create/update release and tag
-        run: |
-            gh release create ${{ github.event.inputs.version }} ./dist/${{ github.event.repository.name }}-${{ github.event.inputs.version }}.tar.gz --target ${{ steps.extract_hash.outputs.HASH }} --title ${{ github.event.inputs.version }}
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 0 - 76
.github/workflows/release.yml

@@ -1,76 +0,0 @@
-name: Create Github Release
-
-on:
-  workflow_dispatch:
-    inputs:
-      version:
-        description: "The release/package version to create (ex: 1.0.0)"
-        required: true
-
-jobs:
-  release-package:
-    timeout-minutes: 20
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v3
-      - uses: actions/setup-python@v4
-        with:
-          python-version: 3.11
-      - uses: actions/setup-node@v4
-        with:
-          node-version: '20'
-
-      - name: Extract branch name
-        shell: bash
-        run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
-        id: extract_branch
-
-      - name: Setup Version
-        id: version-setup
-        run: |
-          python tools/release/setup_version.py taipy prod "${{ github.event.inputs.version }}" "${{ steps.extract_branch.outputs.branch }}"
-
-      - name: Modify README image file path
-        run: |
-          python tools/modify_readme.py "${{ github.event.repository.name }}" "${{ steps.extract_branch.outputs.branch }}"
-
-      - name: Get taipy-gui version from setup.py
-        id: taipy_gui_version
-        run: |
-          python tools/release/extract_from_setup.py >> $GITHUB_OUTPUT
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install build wheel
-
-      - name: Install Taipy Gui
-        run: |
-          # install taipy-gui from based on setup.py version
-          pip install "${{ steps.taipy_gui_version.outputs.VERSION }}"
-
-      - name: Build Taipy package
-        run: |
-          python setup.py build_py && python -m build
-          rm -rf taipy
-
-      - name: Install the Taipy package and test it
-        run: |
-          # Install package
-          echo "Installing package..."
-          pip install dist/*.tar.gz
-
-      - name: Check Taipy Installation
-        run: |
-          python tools/validate_taipy_install.py
-
-      - name: Extract commit hash
-        shell: bash
-        run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
-        id: extract_hash
-
-      - name: Create/update release and tag
-        run: |
-            gh release create ${{ github.event.inputs.version }} ./dist/${{ github.event.repository.name }}-${{ github.event.inputs.version }}.tar.gz --target ${{ steps.extract_hash.outputs.HASH }} --title ${{ github.event.inputs.version }}
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 2 - 3
tools/release/check_releases.py

@@ -1,6 +1,5 @@
-import sys
 import os
 import os
-
+import sys
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     _path = sys.argv[1]
     _path = sys.argv[1]
@@ -17,5 +16,5 @@ if __name__ == "__main__":
 
 
     for package in packages:
     for package in packages:
         if not os.path.exists(os.path.join(_path, package)):
         if not os.path.exists(os.path.join(_path, package)):
-            print(f"Package {package} does not exist")
+            print(f"Package {package} does not exist")  # noqa: T201
             sys.exit(1)
             sys.exit(1)

+ 1 - 1
tools/release/extract_from_setup.py

@@ -7,7 +7,7 @@ def extract_gui_version(base_path: str) -> None:
             if "taipy-gui" in line:
             if "taipy-gui" in line:
                 start = line.find("taipy-gui")
                 start = line.find("taipy-gui")
                 end = line.rstrip().find('",')
                 end = line.rstrip().find('",')
-                print(f"VERSION={line[start:end]}")
+                print(f"VERSION={line[start:end]}")  # noqa: T201
                 break
                 break
 
 
 
 

+ 28 - 18
tools/release/setup_version.py

@@ -1,8 +1,8 @@
-import sys
 import json
 import json
 import os
 import os
-from dataclasses import dataclass, asdict
 import re
 import re
+import sys
+from dataclasses import asdict, dataclass
 from typing import Optional
 from typing import Optional
 
 
 
 
@@ -25,6 +25,16 @@ class Version:
         if suffix not in self.ext:
         if suffix not in self.ext:
             raise Exception(f"Version does not contain suffix {suffix}")
             raise Exception(f"Version does not contain suffix {suffix}")
 
 
+    @property
+    def name(self) -> str:
+        """returns a string representation of a version"""
+        return f"{self.major}.{self.minor}.{self.patch}"
+
+    @property
+    def dev_name(self) -> str:
+        """returns a string representation of a version"""
+        return f"{self.name}.{self.ext}"
+
     def __str__(self) -> str:
     def __str__(self) -> str:
         """returns a string representation of a version"""
         """returns a string representation of a version"""
         version_str = f"{self.major}.{self.minor}.{self.patch}"
         version_str = f"{self.major}.{self.minor}.{self.patch}"
@@ -55,16 +65,18 @@ def extract_version(base_path: str) -> Version:
 def __setup_dev_version(
 def __setup_dev_version(
     version: Version, _base_path: str, name: Optional[str] = None, bump_dev_version: bool = False
     version: Version, _base_path: str, name: Optional[str] = None, bump_dev_version: bool = False
 ) -> None:
 ) -> None:
-    name = f"{name}_VERSION" if name else "VERSION"
     version.validate_suffix()
     version.validate_suffix()
-    print(f"{name}={version}")
-    if bump_dev_version:
-        version.bump_ext_version()
+
+    name = f"{name}_VERSION" if name else "VERSION"
+    print(f"{name}={version.dev_name}")  # noqa: T201
+
+    version.bump_ext_version()
+
     __write_version_to_path(_base_path, version)
     __write_version_to_path(_base_path, version)
-    print(f"NEW_{name}={version}")
+    print(f"NEW_{name}={version.dev_name}")  # noqa: T201
 
 
 
 
-def __setup_prod_version(version: Version, target_version: str, branch_name: str) -> None:
+def __setup_prod_version(version: Version, target_version: str, branch_name: str, name: str = None) -> None:
     if str(version) != target_version:
     if str(version) != target_version:
         raise ValueError(f"Current version={version} does not match target version={target_version}")
         raise ValueError(f"Current version={version} does not match target version={target_version}")
 
 
@@ -73,6 +85,9 @@ def __setup_prod_version(version: Version, target_version: str, branch_name: str
             f"Branch name mismatch branch={branch_name} does not match target branch name={target_branch_name}"
             f"Branch name mismatch branch={branch_name} does not match target branch name={target_branch_name}"
         )
         )
 
 
+    name = f"{name}_VERSION" if name else "VERSION"
+    print(f"{name}={version.name}")  # noqa: T201
+
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     paths = (
     paths = (
@@ -88,18 +103,13 @@ if __name__ == "__main__":
         ]
         ]
     )
     )
     _environment = sys.argv[2]
     _environment = sys.argv[2]
-    should_bump = False
-
-    try:
-        should_bump = True if sys.argv[3] == "bump" else False
-    except IndexError:
-        pass
 
 
     for _path in paths:
     for _path in paths:
         _version = extract_version(_path)
         _version = extract_version(_path)
+        _name = None if _path == "taipy" else _path.split(os.sep)[-1]
+
         if _environment == "dev":
         if _environment == "dev":
-            _name = None if _path == "taipy" else _path.split(os.sep)[-1]
-            __setup_dev_version(_version, _path, _name, should_bump)
+            __setup_dev_version(_version, _path, _name)
 
 
-        if _environment == "prod":
-            __setup_prod_version(_version, sys.argv[3], sys.argv[4])
+        if _environment == "production":
+            __setup_prod_version(_version, sys.argv[3], sys.argv[4], _name)

+ 35 - 0
tools/release/update_setup_requirements.py

@@ -0,0 +1,35 @@
+import os
+import sys
+from typing import Dict
+
+BASE_PATH = "./tools/packages"
+
+
+def __build_taipy_package_line(line: str, version: str) -> str:
+    return f"{line.strip()} @ https://github.com/Avaiga/taipy/releases/download/{version}/{version}.tar.gz\n"
+
+
+def update_setup_requirements(package: str, versions: Dict) -> None:
+    _path = os.path.join(BASE_PATH, package, "setup.requirements.txt")
+    lines = []
+    with open(_path, mode="r") as req:
+        for line in req:
+            if v := versions.get(line.strip()):
+                line = __build_taipy_package_line(line, v)
+            lines.append(line)
+
+    with open(_path, 'w') as file:
+        file.writelines(lines)
+
+
+if __name__ == "__main__":
+    _package = sys.argv[1]
+    _versions = {
+        "taipy-config": sys.argv[2],
+        "taipy-core": sys.argv[3],
+        "taipy-gui": sys.argv[4],
+        "taipy-rest": sys.argv[5],
+        "taipy-templates": sys.argv[6],
+    }
+
+    update_setup_requirements(_package, _versions)

+ 2 - 1
tools/validate_taipy_install.py

@@ -23,9 +23,10 @@ def test_import_taipy_packages() -> bool:
 
 
 
 
 def test_taipy_gui_core() -> bool:
 def test_taipy_gui_core() -> bool:
-    import taipy
     from pathlib import Path
     from pathlib import Path
 
 
+    import taipy
+
     taipy_gui_core_path = Path(taipy.__file__).absolute().parent / "gui_core" / "lib" / "taipy-gui-core.js"
     taipy_gui_core_path = Path(taipy.__file__).absolute().parent / "gui_core" / "lib" / "taipy-gui-core.js"
     if not taipy_gui_core_path.exists():
     if not taipy_gui_core_path.exists():
         logging.error("File taipy-gui-core.js not found in taipy installation path")
         logging.error("File taipy-gui-core.js not found in taipy installation path")