From 2fcb13f21d8f49e035d94f4327cc4d9ad4df1cae Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Fri, 1 Mar 2024 07:30:25 -0300 Subject: [PATCH 01/14] chore: add MANIFEST.in to gui package --- .github/workflows/build-and-release-dev.yml | 12 +++++++++++- taipy/gui/MANIFEST.in | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 taipy/gui/MANIFEST.in diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release-dev.yml index 3f578b7304..c346c3ea83 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release-dev.yml @@ -98,7 +98,17 @@ 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 --verbose + + - 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 package working-directory: ${{ steps.set-variables.outputs.package_dir }} diff --git a/taipy/gui/MANIFEST.in b/taipy/gui/MANIFEST.in new file mode 100644 index 0000000000..20c55dbbba --- /dev/null +++ b/taipy/gui/MANIFEST.in @@ -0,0 +1,5 @@ +# Package taipy-gui +recursive-include webapp * +include version.json +include viselements.json +include *.pyi From 2e9f8ea134e0d3f6421218e4b558bb17fb5fa005 Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Fri, 1 Mar 2024 09:45:48 -0300 Subject: [PATCH 02/14] chore: add MANIFEST.in to subpackages --- .github/workflows/build-and-release-dev.yml | 2 +- taipy/config/MANIFEST.in | 5 +++++ taipy/core/MANIFEST.in | 4 ++++ taipy/core/setup.py | 2 ++ taipy/gui/MANIFEST.in | 2 ++ taipy/gui/setup.py | 2 ++ taipy/rest/MANIFEST.in | 4 ++++ taipy/rest/setup.py | 2 ++ taipy/templates/MANIFEST.in | 4 ++++ 9 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 taipy/config/MANIFEST.in create mode 100644 taipy/core/MANIFEST.in create mode 100644 taipy/rest/MANIFEST.in create mode 100644 taipy/templates/MANIFEST.in diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release-dev.yml index c346c3ea83..b2d540e189 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release-dev.yml @@ -103,7 +103,7 @@ jobs: - name: Install GUI dependencies if: matrix.package == 'gui' run: | - pipenv install --dev --verbose + pipenv install --dev - name: Generate GUI pyi file if: matrix.package == 'gui' diff --git a/taipy/config/MANIFEST.in b/taipy/config/MANIFEST.in new file mode 100644 index 0000000000..4f0d177566 --- /dev/null +++ b/taipy/config/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tools * + +# Package taipy-config +include *.pyi +include *.json diff --git a/taipy/core/MANIFEST.in b/taipy/core/MANIFEST.in new file mode 100644 index 0000000000..89d019e4ae --- /dev/null +++ b/taipy/core/MANIFEST.in @@ -0,0 +1,4 @@ +recursive-include tools * + +# Package taipy-core +include *.json diff --git a/taipy/core/setup.py b/taipy/core/setup.py index 59417f9d59..1c2f2937d5 100644 --- a/taipy/core/setup.py +++ b/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 pkg: + continue requirements_file = pkg / "setup.requirements.txt" if requirements_file.exists(): reqs.update(requirements_file.read_text("UTF-8").splitlines()) diff --git a/taipy/gui/MANIFEST.in b/taipy/gui/MANIFEST.in index 20c55dbbba..b55c64a825 100644 --- a/taipy/gui/MANIFEST.in +++ b/taipy/gui/MANIFEST.in @@ -1,3 +1,5 @@ +recursive-include tools * + # Package taipy-gui recursive-include webapp * include version.json diff --git a/taipy/gui/setup.py b/taipy/gui/setup.py index a36dc4c050..5811f1da08 100644 --- a/taipy/gui/setup.py +++ b/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 pkg: + continue requirements_file = pkg / "setup.requirements.txt" if requirements_file.exists(): reqs.update(requirements_file.read_text("UTF-8").splitlines()) diff --git a/taipy/rest/MANIFEST.in b/taipy/rest/MANIFEST.in new file mode 100644 index 0000000000..7901db8f8a --- /dev/null +++ b/taipy/rest/MANIFEST.in @@ -0,0 +1,4 @@ +recursive-include tools * + +# Package taipy-rest +include *.json diff --git a/taipy/rest/setup.py b/taipy/rest/setup.py index db21540dbd..255b11b65e 100644 --- a/taipy/rest/setup.py +++ b/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 pkg: + continue requirements_file = pkg / "setup.requirements.txt" if requirements_file.exists(): reqs.update(requirements_file.read_text("UTF-8").splitlines()) diff --git a/taipy/templates/MANIFEST.in b/taipy/templates/MANIFEST.in new file mode 100644 index 0000000000..6d1947573e --- /dev/null +++ b/taipy/templates/MANIFEST.in @@ -0,0 +1,4 @@ +recursive-include tools * + +# Package taipy-templates +recursive-include . From 84d1d4a5f4b1d5b85422f723432fc14cd53069fa Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Fri, 1 Mar 2024 10:51:40 -0300 Subject: [PATCH 03/14] fix: build subpackage structure --- .github/workflows/build-and-release-dev.yml | 6 ++++ taipy/core/setup.py | 2 +- taipy/gui/setup.py | 2 +- taipy/rest/setup.py | 2 +- tools/release/build_package_structure.py | 34 +++++++++++++++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 tools/release/build_package_structure.py diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release-dev.yml index b2d540e189..9cc11a7cff 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release-dev.yml @@ -110,6 +110,12 @@ jobs: run: | cp tools/gui/generate_pyi.py pyi_temp.py && pipenv run python pyi_temp.py && rm pyi_temp.py + - name: Build Package Structure + working-directory: ${{ steps.set-variables.outputs.package_dir }} + run: | + python tools/release/build_package_structure.py ${{ matrix.package }} + ls -lah + - name: Build package working-directory: ${{ steps.set-variables.outputs.package_dir }} run: | diff --git a/taipy/core/setup.py b/taipy/core/setup.py index 1c2f2937d5..7e944ed7e9 100644 --- a/taipy/core/setup.py +++ b/taipy/core/setup.py @@ -36,7 +36,7 @@ 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 pkg: + if "taipy-core" not in str(pkg): continue requirements_file = pkg / "setup.requirements.txt" if requirements_file.exists(): diff --git a/taipy/gui/setup.py b/taipy/gui/setup.py index 5811f1da08..f7d4cda9e6 100644 --- a/taipy/gui/setup.py +++ b/taipy/gui/setup.py @@ -36,7 +36,7 @@ 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 pkg: + if "taipy-gui" not in str(pkg): continue requirements_file = pkg / "setup.requirements.txt" if requirements_file.exists(): diff --git a/taipy/rest/setup.py b/taipy/rest/setup.py index 255b11b65e..f0fc05531e 100644 --- a/taipy/rest/setup.py +++ b/taipy/rest/setup.py @@ -31,7 +31,7 @@ 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 pkg: + if "taipy-rest" not in str(pkg): continue requirements_file = pkg / "setup.requirements.txt" if requirements_file.exists(): diff --git a/tools/release/build_package_structure.py b/tools/release/build_package_structure.py new file mode 100644 index 0000000000..fbe0960433 --- /dev/null +++ b/tools/release/build_package_structure.py @@ -0,0 +1,34 @@ +# 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", ".json")) or file_name in __SKIP: + continue + shutil.move(file_name, _package_path) + + for file_name in os.listdir("../"): + if os.path.isdir(file_name): + continue + shutil.move(file_name, ".") From b74dd3fbaadbb125f69e49818984416bb2d20e44 Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Fri, 1 Mar 2024 11:38:27 -0300 Subject: [PATCH 04/14] chore: add frontend build step --- .github/workflows/build-and-release-dev.yml | 13 ++++++++++--- taipy/gui/MANIFEST.in | 2 +- tools/gui/generate_pyi.py | 6 +++--- tools/release/build_package_structure.py | 5 ----- tools/release/update_setup_requirements.py | 17 ++++++++++++++--- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release-dev.yml index 9cc11a7cff..68b9d96e4b 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release-dev.yml @@ -110,11 +110,15 @@ jobs: 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: Build Package Structure working-directory: ${{ steps.set-variables.outputs.package_dir }} run: | python tools/release/build_package_structure.py ${{ matrix.package }} - ls -lah - name: Build package working-directory: ${{ steps.set-variables.outputs.package_dir }} @@ -138,8 +142,6 @@ jobs: 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 runs-on: ubuntu-latest needs: [ build-and-release-taipy-dev-packages, fetch-versions ] timeout-minutes: 20 @@ -169,6 +171,11 @@ jobs: ${{needs.fetch-versions.outputs.templates_VERSION}} \ ${{ github.event.inputs.publish_on_pypi }} + - name: Replace setup.py + run: | + mv setup.py setup.old.py + cp tools/packages/taipy/setup.py . + - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/taipy/gui/MANIFEST.in b/taipy/gui/MANIFEST.in index b55c64a825..84ea5458c8 100644 --- a/taipy/gui/MANIFEST.in +++ b/taipy/gui/MANIFEST.in @@ -1,7 +1,7 @@ recursive-include tools * # Package taipy-gui -recursive-include webapp * +recursive-include taipy/gui/webapp * include version.json include viselements.json include *.pyi diff --git a/tools/gui/generate_pyi.py b/tools/gui/generate_pyi.py index ec9d6c0a8d..c7eab57d00 100644 --- a/tools/gui/generate_pyi.py +++ b/tools/gui/generate_pyi.py @@ -38,9 +38,9 @@ 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: diff --git a/tools/release/build_package_structure.py b/tools/release/build_package_structure.py index fbe0960433..66efd5d26b 100644 --- a/tools/release/build_package_structure.py +++ b/tools/release/build_package_structure.py @@ -27,8 +27,3 @@ if file_name.lower().endswith((".md", ".json")) or file_name in __SKIP: continue shutil.move(file_name, _package_path) - - for file_name in os.listdir("../"): - if os.path.isdir(file_name): - continue - shutil.move(file_name, ".") diff --git a/tools/release/update_setup_requirements.py b/tools/release/update_setup_requirements.py index 189e764dd2..10197a160d 100644 --- a/tools/release/update_setup_requirements.py +++ b/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,7 +19,7 @@ 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}=={version}\n" return f"{_line} @ https://github.com/Avaiga/taipy/releases/download/{version}/{version}.tar.gz\n" @@ -21,7 +32,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 +45,6 @@ def update_setup_requirements(package: str, versions: Dict, publish_on_py_pi: bo "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) From 6e2c7eea3975991dd8c1b1dfca02874fb696f351 Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Fri, 1 Mar 2024 14:24:55 -0300 Subject: [PATCH 05/14] chore: copy all files inside tools/packages --- .github/workflows/build-and-release-dev.yml | 32 ++++++++++++++++----- taipy/config/MANIFEST.in | 5 ---- taipy/core/MANIFEST.in | 4 --- taipy/gui/MANIFEST.in | 7 ----- taipy/rest/MANIFEST.in | 4 --- taipy/templates/MANIFEST.in | 4 --- tools/packages/taipy-config/MANIFEST.in | 2 ++ tools/packages/taipy-config/setup.py | 13 ++++++--- tools/packages/taipy-core/MANIFEST.in | 2 ++ tools/packages/taipy-core/setup.py | 8 ++++-- tools/packages/taipy-gui/MANIFEST.in | 2 ++ tools/packages/taipy-gui/setup.py | 9 ++++-- tools/packages/taipy-rest/MANIFEST.in | 2 ++ tools/packages/taipy-rest/setup.py | 8 ++++-- tools/packages/taipy-templates/MANIFEST.in | 2 ++ tools/packages/taipy-templates/setup.py | 8 ++++-- tools/packages/taipy/MANIFEST.in | 25 ++++++++++++++++ tools/packages/taipy/setup.py | 24 +++++----------- tools/release/build_package_structure.py | 4 ++- tools/release/update_setup_requirements.py | 4 ++- 20 files changed, 107 insertions(+), 62 deletions(-) delete mode 100644 taipy/config/MANIFEST.in delete mode 100644 taipy/core/MANIFEST.in delete mode 100644 taipy/gui/MANIFEST.in delete mode 100644 taipy/rest/MANIFEST.in delete mode 100644 taipy/templates/MANIFEST.in diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release-dev.yml index 68b9d96e4b..43d8806431 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release-dev.yml @@ -115,11 +115,24 @@ jobs: 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 }} run: | @@ -143,7 +156,7 @@ jobs: build-and-release-taipy-dev: runs-on: ubuntu-latest - needs: [ build-and-release-taipy-dev-packages, fetch-versions ] + needs: [build-and-release-taipy-dev-packages, fetch-versions ] timeout-minutes: 20 steps: - uses: actions/checkout@v4 @@ -171,18 +184,23 @@ jobs: ${{needs.fetch-versions.outputs.templates_VERSION}} \ ${{ github.event.inputs.publish_on_pypi }} - - name: Replace setup.py - run: | - mv setup.py setup.old.py - cp tools/packages/taipy/setup.py . - - name: Install dependencies run: | python -m pip install --upgrade pip pip install build wheel + + - name: Backup setup.py + run: | + mv setup.py setup.old.py + + - name: Copy files from tools + run: | + cp -r tools/packages/taipy/. . + - 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 run: | diff --git a/taipy/config/MANIFEST.in b/taipy/config/MANIFEST.in deleted file mode 100644 index 4f0d177566..0000000000 --- a/taipy/config/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -recursive-include tools * - -# Package taipy-config -include *.pyi -include *.json diff --git a/taipy/core/MANIFEST.in b/taipy/core/MANIFEST.in deleted file mode 100644 index 89d019e4ae..0000000000 --- a/taipy/core/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -recursive-include tools * - -# Package taipy-core -include *.json diff --git a/taipy/gui/MANIFEST.in b/taipy/gui/MANIFEST.in deleted file mode 100644 index 84ea5458c8..0000000000 --- a/taipy/gui/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -recursive-include tools * - -# Package taipy-gui -recursive-include taipy/gui/webapp * -include version.json -include viselements.json -include *.pyi diff --git a/taipy/rest/MANIFEST.in b/taipy/rest/MANIFEST.in deleted file mode 100644 index 7901db8f8a..0000000000 --- a/taipy/rest/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -recursive-include tools * - -# Package taipy-rest -include *.json diff --git a/taipy/templates/MANIFEST.in b/taipy/templates/MANIFEST.in deleted file mode 100644 index 6d1947573e..0000000000 --- a/taipy/templates/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -recursive-include tools * - -# Package taipy-templates -recursive-include . diff --git a/tools/packages/taipy-config/MANIFEST.in b/tools/packages/taipy-config/MANIFEST.in index 7a982882c7..145c00a7e5 100644 --- a/tools/packages/taipy-config/MANIFEST.in +++ b/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 diff --git a/tools/packages/taipy-config/setup.py b/tools/packages/taipy-config/setup.py index 7cb4352a60..f3dde84632 100644 --- a/tools/packages/taipy-config/setup.py +++ b/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 @@ 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 @@ 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, diff --git a/tools/packages/taipy-core/MANIFEST.in b/tools/packages/taipy-core/MANIFEST.in index ff63bc7925..7f1627cbc3 100644 --- a/tools/packages/taipy-core/MANIFEST.in +++ b/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 diff --git a/tools/packages/taipy-core/setup.py b/tools/packages/taipy-core/setup.py index 3c0321621e..65079f65d3 100644 --- a/tools/packages/taipy-core/setup.py +++ b/tools/packages/taipy-core/setup.py @@ -22,13 +22,17 @@ 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"] diff --git a/tools/packages/taipy-gui/MANIFEST.in b/tools/packages/taipy-gui/MANIFEST.in index 6eaef66516..524fdf95bc 100644 --- a/tools/packages/taipy-gui/MANIFEST.in +++ b/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 diff --git a/tools/packages/taipy-gui/setup.py b/tools/packages/taipy-gui/setup.py index d0813e69f9..d9de825a7f 100644 --- a/tools/packages/taipy-gui/setup.py +++ b/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 @@ 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"] diff --git a/tools/packages/taipy-rest/MANIFEST.in b/tools/packages/taipy-rest/MANIFEST.in index dd9d9e0361..c8d6ce0f68 100644 --- a/tools/packages/taipy-rest/MANIFEST.in +++ b/tools/packages/taipy-rest/MANIFEST.in @@ -1 +1,3 @@ include taipy/rest/*.json +include *.json +include taipy/rest/setup.requirements.txt diff --git a/tools/packages/taipy-rest/setup.py b/tools/packages/taipy-rest/setup.py index fe8441be10..24fd4b052a 100644 --- a/tools/packages/taipy-rest/setup.py +++ b/tools/packages/taipy-rest/setup.py @@ -18,13 +18,17 @@ 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", diff --git a/tools/packages/taipy-templates/MANIFEST.in b/tools/packages/taipy-templates/MANIFEST.in index c6f4085d41..e0e4a86e92 100644 --- a/tools/packages/taipy-templates/MANIFEST.in +++ b/tools/packages/taipy-templates/MANIFEST.in @@ -1 +1,3 @@ recursive-include taipy/templates * +include *.json +include taipy/templates/setup.requirements.txt diff --git a/tools/packages/taipy-templates/setup.py b/tools/packages/taipy-templates/setup.py index 5062f2f327..9f9a64b26f 100644 --- a/tools/packages/taipy-templates/setup.py +++ b/tools/packages/taipy-templates/setup.py @@ -21,13 +21,17 @@ 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"] diff --git a/tools/packages/taipy/MANIFEST.in b/tools/packages/taipy/MANIFEST.in index 2be5860e9e..b73be19cf2 100644 --- a/tools/packages/taipy/MANIFEST.in +++ b/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 diff --git a/tools/packages/taipy/setup.py b/tools/packages/taipy/setup.py index 8898fb3d39..518f47ab54 100644 --- a/tools/packages/taipy/setup.py +++ b/tools/packages/taipy/setup.py @@ -48,22 +48,12 @@ 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 @@ def run(self): 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", diff --git a/tools/release/build_package_structure.py b/tools/release/build_package_structure.py index 66efd5d26b..d58765dd9f 100644 --- a/tools/release/build_package_structure.py +++ b/tools/release/build_package_structure.py @@ -24,6 +24,8 @@ Path(_package_path).mkdir(parents=True, exist_ok=True) for file_name in os.listdir("."): - if file_name.lower().endswith((".md", ".json")) or file_name in __SKIP: + 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") diff --git a/tools/release/update_setup_requirements.py b/tools/release/update_setup_requirements.py index 10197a160d..1c71a789db 100644 --- a/tools/release/update_setup_requirements.py +++ b/tools/release/update_setup_requirements.py @@ -20,7 +20,9 @@ def __build_taipy_package_line(line: str, version: str, publish_on_py_pi: bool) _line = line.strip() if publish_on_py_pi: return f"{_line}=={version}\n" - return f"{_line} @ https://github.com/Avaiga/taipy/releases/download/{version}/{version}.tar.gz\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: From 1f802c5d9fb4507e41c85d61242d6f215b0ce01a Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 10:05:49 -0300 Subject: [PATCH 06/14] feat: update to dev3 --- .github/workflows/build-and-release-dev.yml | 32 ++++++++++----------- .github/workflows/publish.yml | 2 +- taipy/config/version.json | 2 +- taipy/core/version.json | 2 +- taipy/gui/version.json | 2 +- taipy/rest/version.json | 2 +- taipy/templates/version.json | 2 +- taipy/version.json | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release-dev.yml index 43d8806431..c61bd22c89 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release-dev.yml @@ -145,14 +145,14 @@ jobs: 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: 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 +# - 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: runs-on: ubuntu-latest @@ -208,17 +208,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Taipy - run: | - pip install ${{ steps.set-variables.outputs.tar_path }} +# - name: Install Taipy +# run: | +# pip install ${{ steps.set-variables.outputs.tar_path }} - - name: Check Taipy Installation - run: | - python tools/validate_taipy_install.py +# - name: Check Taipy Installation +# run: | +# python tools/validate_taipy_install.py - - name: Publish to PyPI - if: github.event.inputs.publish_on_pypi == 'true' - uses: pypa/gh-action-pypi-publish@release/v1 +# - name: Publish to PyPI +# if: github.event.inputs.publish_on_pypi == 'true' +# uses: pypa/gh-action-pypi-publish@release/v1 - name: Download packages run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27a75cdfce..d4dd80c79b 100644 --- a/.github/workflows/publish.yml +++ b/.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 diff --git a/taipy/config/version.json b/taipy/config/version.json index b396e25a07..ed206ccd53 100644 --- a/taipy/config/version.json +++ b/taipy/config/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"} +{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} diff --git a/taipy/core/version.json b/taipy/core/version.json index b396e25a07..ed206ccd53 100644 --- a/taipy/core/version.json +++ b/taipy/core/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"} +{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} diff --git a/taipy/gui/version.json b/taipy/gui/version.json index b396e25a07..ed206ccd53 100644 --- a/taipy/gui/version.json +++ b/taipy/gui/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"} +{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} diff --git a/taipy/rest/version.json b/taipy/rest/version.json index b396e25a07..ed206ccd53 100644 --- a/taipy/rest/version.json +++ b/taipy/rest/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"} +{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} diff --git a/taipy/templates/version.json b/taipy/templates/version.json index b396e25a07..ed206ccd53 100644 --- a/taipy/templates/version.json +++ b/taipy/templates/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"} +{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} diff --git a/taipy/version.json b/taipy/version.json index b396e25a07..ed206ccd53 100644 --- a/taipy/version.json +++ b/taipy/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev2"} +{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} From 63f96f46ec5b2b3e86d824a5c191b503eece0ed9 Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 11:12:19 -0300 Subject: [PATCH 07/14] fix: combine dev and prod actions into only one --- .github/workflows/build-and-release-dev.yml | 43 ++--- .github/workflows/build-and-release-prod.yml | 171 ------------------- 2 files changed, 13 insertions(+), 201 deletions(-) delete mode 100644 .github/workflows/build-and-release-prod.yml diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release-dev.yml index c61bd22c89..fc56030aa3 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release-dev.yml @@ -3,10 +3,14 @@ name: Build a dev version for all 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 jobs: fetch-versions: @@ -21,12 +25,12 @@ jobs: NEW_VERSION: ${{ steps.version-setup.outputs.NEW_VERSION }} steps: - uses: actions/checkout@v4 - - name: Setup Dev Version + - 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_OUTPUT - build-and-release-taipy-dev-packages: + build-and-release-taipy-packages: needs: [fetch-versions] timeout-minutes: 20 runs-on: ubuntu-latest @@ -89,7 +93,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: | @@ -145,18 +149,9 @@ jobs: 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: + 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 @@ -182,7 +177,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: Install dependencies run: | @@ -208,18 +203,6 @@ jobs: 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: Publish to PyPI -# if: github.event.inputs.publish_on_pypi == 'true' -# uses: pypa/gh-action-pypi-publish@release/v1 - - name: Download packages run: | gh release download ${{ needs.fetch-versions.outputs.config_VERSION }}-config --skip-existing --dir dist diff --git a/.github/workflows/build-and-release-prod.yml b/.github/workflows/build-and-release-prod.yml deleted file mode 100644 index fa1578413d..0000000000 --- a/.github/workflows/build-and-release-prod.yml +++ /dev/null @@ -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 From c0bd54e8e348c1c036425441c7c69d51d4a86aef Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 11:26:50 -0300 Subject: [PATCH 08/14] fix: name and description of the action --- .../{build-and-release-dev.yml => build-and-release.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build-and-release-dev.yml => build-and-release.yml} (99%) diff --git a/.github/workflows/build-and-release-dev.yml b/.github/workflows/build-and-release.yml similarity index 99% rename from .github/workflows/build-and-release-dev.yml rename to .github/workflows/build-and-release.yml index fc56030aa3..db9a002c41 100644 --- a/.github/workflows/build-and-release-dev.yml +++ b/.github/workflows/build-and-release.yml @@ -1,4 +1,4 @@ -name: Build a dev version for all packages and release them +name: Build all taipy packages and release them on: workflow_dispatch: From ce955426eefa674e5fe5cf4022b1948d261d555e Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 11:34:23 -0300 Subject: [PATCH 09/14] fix: remove pre release tag if production version --- .github/workflows/build-and-release.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index db9a002c41..dce0983758 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -145,7 +145,12 @@ 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 }} @@ -199,7 +204,12 @@ jobs: - 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 }} --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 }} From b56b1c3ca084c21baa51306430075f57ec27edb3 Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 11:45:04 -0300 Subject: [PATCH 10/14] fix: extra parameters to setup production version --- .github/workflows/build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index dce0983758..dee901f1e3 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -28,7 +28,7 @@ jobs: - name: Setup Version id: version-setup run: | - python tools/release/setup_version.py ALL ${{ github.event.inputs.release_type }} >> $GITHUB_OUTPUT + python tools/release/setup_version.py ALL ${{ github.event.inputs.release_type }} ${{ github.event.inputs.version }} ${{ steps.extract_branch.outputs.branch }} >> $GITHUB_OUTPUT build-and-release-taipy-packages: needs: [fetch-versions] From 9ca3d1c87239e581bae77bf25574d509911dfe80 Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 11:58:05 -0300 Subject: [PATCH 11/14] fix: make version extension optional (cherry picked from commit 52e819b1c1063c38017b0f37ac4cd5d47a576bb2) --- tools/release/setup_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/release/setup_version.py b/tools/release/setup_version.py index af3008ac0c..6b5c44ef37 100644 --- a/tools/release/setup_version.py +++ b/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: From 8173640218582f1c3c7eb9066bdf1e946445140a Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 12:06:10 -0300 Subject: [PATCH 12/14] fix: add input version (cherry picked from commit d098d7953b1b1c2bc0733cc1511c2629fb3b81a1) --- .github/workflows/build-and-release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index dee901f1e3..f696a35b34 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -11,6 +11,9 @@ on: 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: @@ -25,10 +28,15 @@ jobs: NEW_VERSION: ${{ steps.version-setup.outputs.NEW_VERSION }} steps: - uses: actions/checkout@v4 + - name: Extract commit hash + shell: bash + run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + id: extract_hash + - name: Setup Version id: version-setup run: | - python tools/release/setup_version.py ALL ${{ github.event.inputs.release_type }} ${{ github.event.inputs.version }} ${{ steps.extract_branch.outputs.branch }} >> $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-packages: needs: [fetch-versions] From b2fe931ae87111812fb69ebcdf4f6d3bee6f6e3b Mon Sep 17 00:00:00 2001 From: Joao Andre Date: Mon, 4 Mar 2024 12:14:25 -0300 Subject: [PATCH 13/14] fix: branch name step reference (cherry picked from commit e6186739045eabe16f373faf50ffb4a73fd1658b) --- .github/workflows/build-and-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index f696a35b34..b0b9cdb4f1 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -28,10 +28,10 @@ jobs: NEW_VERSION: ${{ steps.version-setup.outputs.NEW_VERSION }} steps: - uses: actions/checkout@v4 - - name: Extract commit hash + - name: Extract branch name shell: bash - run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - id: extract_hash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch - name: Setup Version id: version-setup From 5bb6b4ccc7e487f32a20913c18734950a3922903 Mon Sep 17 00:00:00 2001 From: jrobinAV Date: Mon, 4 Mar 2024 16:27:07 +0100 Subject: [PATCH 14/14] Change version to 3.2.0.dev0 in all version.json --- taipy/config/version.json | 2 +- taipy/core/version.json | 2 +- taipy/gui/version.json | 2 +- taipy/rest/version.json | 2 +- taipy/templates/version.json | 2 +- taipy/version.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/taipy/config/version.json b/taipy/config/version.json index ed206ccd53..c6a379f417 100644 --- a/taipy/config/version.json +++ b/taipy/config/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} +{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"} diff --git a/taipy/core/version.json b/taipy/core/version.json index ed206ccd53..c6a379f417 100644 --- a/taipy/core/version.json +++ b/taipy/core/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} +{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"} diff --git a/taipy/gui/version.json b/taipy/gui/version.json index ed206ccd53..c6a379f417 100644 --- a/taipy/gui/version.json +++ b/taipy/gui/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} +{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"} diff --git a/taipy/rest/version.json b/taipy/rest/version.json index ed206ccd53..c6a379f417 100644 --- a/taipy/rest/version.json +++ b/taipy/rest/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} +{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"} diff --git a/taipy/templates/version.json b/taipy/templates/version.json index ed206ccd53..c6a379f417 100644 --- a/taipy/templates/version.json +++ b/taipy/templates/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} +{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"} diff --git a/taipy/version.json b/taipy/version.json index ed206ccd53..c6a379f417 100644 --- a/taipy/version.json +++ b/taipy/version.json @@ -1 +1 @@ -{"major": 3, "minor": 1, "patch": 0, "ext": "dev3"} +{"major": 3, "minor": 2, "patch": 0, "ext": "dev0"}