Bladeren bron

feat: add back setup.py to enable custom package builds

Joao Andre 9 maanden geleden
bovenliggende
commit
90f28a397d

+ 3 - 9
.github/workflows/build-and-release-single-package.yml

@@ -51,6 +51,8 @@ jobs:
           ${{ github.event.inputs.target_package }} >> $GITHUB_OUTPUT
 
   build-and-release-package:
+    permissions:
+      contents: write
     needs: [fetch-versions]
     timeout-minutes: 20
     runs-on: ubuntu-latest
@@ -153,18 +155,10 @@ jobs:
         run: |
           cp -r taipy/_cli/. ${{ steps.set-variables.outputs.package_dir }}/taipy/_cli
 
-      - name: Update pyproject.toml
-        working-directory: ${{ steps.set-variables.outputs.package_dir }}
-        run: |
-          python tools/release/setup_project.py . prod
-
       - name: Build package
         working-directory: ${{ steps.set-variables.outputs.package_dir }}
         run: |
           python -m build
-
-      - name: Rename files
-        run: |
           for file in ./dist/*; do mv "$file" "${file//_/-}"; done
 
       - name: Create tag and release
@@ -181,7 +175,7 @@ jobs:
 
       - name: Ensure Taipy release is marked as latest
         run: |
-           gh release edit ${{needs.fetch-versions.outputs.taipy_VERSION}} --latest
+          gh release edit ${{needs.fetch-versions.outputs.taipy_VERSION}} --latest
         shell: bash
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 10 - 10
.github/workflows/build-and-release.yml

@@ -44,6 +44,12 @@ jobs:
         run: |
           python tools/release/setup_version.py ALL ${{ github.event.inputs.release_type }} ${{ github.event.inputs.target_version }} ${{ steps.extract_branch.outputs.branch }} >> $GITHUB_OUTPUT
 
+      - uses: stefanzweifel/git-auto-commit-action@v4
+        with:
+          commit_message: Update version to ${{ steps.version-setup.outputs.NEW_VERSION }}
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
   build-and-release-taipy-packages:
     needs: [fetch-versions]
     timeout-minutes: 20
@@ -151,11 +157,6 @@ jobs:
         run: |
           cp -r taipy/_cli/. ${{ steps.set-variables.outputs.package_dir }}/taipy/_cli
 
-      - name: Update pyproject.toml
-        working-directory: ${{ steps.set-variables.outputs.package_dir }}
-        run: |
-          python tools/release/setup_project.py . prod
-
       - name: Build package
         working-directory: ${{ steps.set-variables.outputs.package_dir }}
         run: |
@@ -209,14 +210,13 @@ jobs:
           python -m pip install --upgrade pip
           pip install build wheel
 
-      - name: Copy files from tools
+      - name: Backup setup.py
         run: |
-          cp -r tools/packages/taipy/. .
+          mv setup.py setup.old.py
 
-      - name: Update pyproject.toml
-        working-directory: ${{ steps.set-variables.outputs.package_dir }}
+      - name: Copy files from tools
         run: |
-          python tools/release/setup_project.py . prod
+          cp -r tools/packages/taipy/. .
 
       - name: Build Taipy package
         run: |

+ 3 - 26
.github/workflows/packaging.yml

@@ -12,15 +12,12 @@ on:
         required: false
         default: ""
 
-env:
-  NODE_OPTIONS: --max-old-space-size=4096
-
 jobs:
   standard-packages:
     timeout-minutes: 30
     strategy:
       matrix:
-        python-versions: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
+        python-versions: [ '3.8', '3.9', '3.10', '3.11', '3.12']
         os: [ubuntu-latest, macos-13, windows-latest]
 
     runs-on: ${{ matrix.os }}
@@ -31,34 +28,14 @@ jobs:
         with:
           python-version: ${{ matrix.python-versions }}
 
-      - name: Install Dependencies
-        run: |
-          pip install toml
-
       - name: Build frontends
         run: |
           python tools/frontend/bundle_build.py
 
-      - name: Update pyproject.toml
-        run: |
-          python tools/release/setup_project.py taipy/config
-          python tools/release/setup_project.py taipy/core
-          python tools/release/setup_project.py taipy/gui
-          python tools/release/setup_project.py taipy/rest
-          python tools/release/setup_project.py taipy/templates
-          python tools/release/setup_project.py .
-
-      - name: Install Taipy Subpackages
-        run: |
-          pip install taipy/config taipy/core taipy/gui taipy/rest taipy/templates
-
-      - name: Install Taipy
+      - name: Install Taipy without dependencies
         run: |
           pip install .
-
-      - name: Remove local folder
-        run: rm -r taipy
-
+          rm -r taipy
       - name: Check Taipy Installation
         run: |
           python tools/validate_taipy_install.py

+ 7 - 25
pyproject.toml

@@ -4,14 +4,13 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "taipy"
-version = "0.0.0"  # will be dynamically set
 description = "A 360° open-source platform from Python pilots to production-ready web apps."
 readme = "package_desc.md"
 requires-python = ">=3.8"
 license = {text = "Apache License 2.0"}
+authors = [{name = "Avaiga", email = "dev@taipy.io"}]
 keywords = ["taipy"]
 classifiers = [
-    "Development Status :: 5 - Production/Stable",
     "Intended Audience :: Developers",
     "License :: OSI Approved :: Apache Software License",
     "Natural Language :: English",
@@ -21,26 +20,22 @@ classifiers = [
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
-    "Topic :: Software Development",
-    "Topic :: Scientific/Engineering",
-    "Operating System :: Microsoft :: Windows",
-    "Operating System :: POSIX",
-    "Operating System :: Unix",
-    "Operating System :: MacOS",
 ]
-dependencies = []  # will be dynamically set
+dynamic = ["version", "dependencies"]
 
 [project.optional-dependencies]
-test = ["pytest>=3.8"]
 ngrok = ["pyngrok>=5.1,<6.0"]
 image = [
-    "python-magic>=0.4.24,<0.5; platform_system!='Windows'",
-    "python-magic-bin>=0.4.14,<0.5; platform_system=='Windows'"
+    "python-magic>=0.4.24,<0.5",
+    "python-magic-bin>=0.4.14,<0.5",
 ]
 rdp = ["rdp>=0.8"]
 arrow = ["pyarrow>=14.0.2,<15.0"]
 mssql = ["pyodbc>=4"]
 
+[project.scripts]
+taipy = "taipy._entrypoint:_entrypoint"
+
 [project.urls]
 Homepage = "https://www.taipy.io"
 Documentation = "https://docs.taipy.io"
@@ -48,19 +43,6 @@ Source = "https://github.com/Avaiga/taipy"
 Download = "https://pypi.org/project/taipy/#files"
 Tracker = "https://github.com/Avaiga/taipy/issues"
 Security = "https://github.com/Avaiga/taipy?tab=security-ov-file#readme"
-"Release notes" = "https://docs.taipy.io/en/release-0.0.0/relnotes/"  # version will be dynamically set
-
-[tool.setuptools.packages.find]
-include = ["taipy", "taipy.*"]
-
-[tool.setuptools.package-data]
-"taipy" = ["version.json"]
-
-[tool.setuptools]
-zip-safe = false
-
-[project.scripts]
-taipy = "taipy._entrypoint:_entrypoint"
 
 [tool.ruff]
 exclude = [

+ 63 - 0
setup.py

@@ -0,0 +1,63 @@
+# 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 json
+import platform
+import subprocess
+from pathlib import Path
+from setuptools import setup, find_packages
+from setuptools.command.build_py import build_py
+
+root_folder = Path(__file__).parent
+
+# get current version
+with open(os.path.join("taipy", "version.json")) as version_file:
+    version = json.load(version_file)
+    version_string = f'{version.get("major", 0)}.{version.get("minor", 0)}.{version.get("patch", 0)}'
+    if vext := version.get("ext"):
+        version_string = f"{version_string}.{vext}"
+
+def get_requirements():
+    reqs = set()
+    for pkg in (root_folder / "tools" / "packages").iterdir():
+        requirements_file = pkg / "setup.requirements.txt"
+        if requirements_file.exists():
+            reqs.update(requirements_file.read_text("UTF-8").splitlines())
+
+    return [r for r in reqs if r and not r.startswith("taipy")]
+
+class NPMInstall(build_py):
+    def run(self):
+        subprocess.run(
+            ["python", "bundle_build.py"],
+            cwd=root_folder / "tools" / "frontend",
+            check=True,
+            shell=platform.system() == "Windows",
+        )
+        build_py.run(self)
+
+setup(
+    version=version_string,
+    install_requires=get_requirements(),
+    packages=find_packages(include=["taipy", "taipy.*"]),
+    extras_require={
+        "ngrok": ["pyngrok>=5.1,<6.0"],
+        "image": [
+            "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
+            "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
+        ],
+        "rdp": ["rdp>=0.8"],
+        "arrow": ["pyarrow>=14.0.2,<15.0"],
+        "mssql": ["pyodbc>=4"],
+    },
+    cmdclass={"build_py": NPMInstall},
+)

+ 8 - 30
taipy/config/pyproject.toml

@@ -4,14 +4,13 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "taipy-config"
-version = "0.0.0"  # will be dynamically set
 description = "A Taipy package dedicated to easily configure a Taipy application."
 readme = "package_desc.md"
 requires-python = ">=3.8"
 license = {text = "Apache License 2.0"}
+authors = [{name = "Avaiga", email = "dev@taipy.io"}]
 keywords = ["taipy-config"]
 classifiers = [
-    "Development Status :: 5 - Production/Stable",
     "Intended Audience :: Developers",
     "License :: OSI Approved :: Apache Software License",
     "Natural Language :: English",
@@ -21,38 +20,17 @@ classifiers = [
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
-    "Topic :: Software Development",
-    "Topic :: Scientific/Engineering",
-    "Operating System :: Microsoft :: Windows",
-    "Operating System :: POSIX",
-    "Operating System :: Unix",
-    "Operating System :: MacOS",
-]
-
-dependencies = [
-    "toml>=0.10,<0.11",
-    "deepdiff>=6.7,<6.8"
 ]
+dynamic = ["version", "dependencies"]
 
 [project.optional-dependencies]
-test = [
-    "pytest>=3.8"
-]
-
-[project.urls]
-Homepage = "https://www.taipy.io"
-Documentation = "https://docs.taipy.io"
-Source = "https://github.com/Avaiga/taipy"
-Download = "https://pypi.org/project/taipy/#files"
-Tracker = "https://github.com/Avaiga/taipy/issues"
-Security = "https://github.com/Avaiga/taipy?tab=security-ov-file#readme"
-"Release notes" = "https://docs.taipy.io/en/release-0.0.0/relnotes/"  # version will be dynamically set
+testing = ["pytest>=3.8"]
 
 [tool.setuptools.packages]
-find = {where = ["."], include = ["taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*"]}
+find = {include = ["taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*"]}
 
-[tool.setuptools.package-data]
-"version" = ["version.json"]
+[project.urls]
+homepage = "https://github.com/avaiga/taipy"
 
-[tool.setuptools]
-zip-safe = false
+[tool.setuptools.data-files]
+"version" = ["version.json"]

+ 45 - 0
taipy/config/setup.py

@@ -0,0 +1,45 @@
+# 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.
+
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations under the License.
+
+"""The setup script."""
+import json
+import os
+from setuptools import find_namespace_packages, find_packages, setup
+
+with open("README.md") as readme_file:
+    readme = readme_file.read()
+
+version_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "version.json")
+
+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 = ["toml>=0.10,<0.11", "deepdiff>=6.2,<6.3"]
+
+test_requirements = ["pytest>=3.8"]
+
+setup(
+    version=version_string,
+    install_requires=requirements,
+    packages=find_namespace_packages(where=".") + find_packages(include=["taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*"]),
+    include_package_data=True,
+    data_files=[('version', ['version.json'])],
+    tests_require=test_requirements,
+)

+ 17 - 38
taipy/core/pyproject.toml

@@ -1,16 +1,16 @@
 [build-system]
-requires = ["setuptools>=42", "wheel", ]
+requires = ["setuptools>=42", "wheel"]
 build-backend = "setuptools.build_meta"
 
 [project]
 name = "taipy-core"
-version = "0.0.0"   # will be dynamically set
 description = "A Python library to build powerful and customized data-driven back-end applications."
 readme = "package_desc.md"
 requires-python = ">=3.8"
-keywords = ["taipy-core", ]
+license = {text = "Apache License 2.0"}
+authors = [{name = "Avaiga", email = "dev@taipy.io"}]
+keywords = ["taipy-core"]
 classifiers = [
-    "Development Status :: 5 - Production/Stable",
     "Intended Audience :: Developers",
     "License :: OSI Approved :: Apache Software License",
     "Natural Language :: English",
@@ -20,43 +20,22 @@ classifiers = [
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
-    "Topic :: Software Development",
-    "Topic :: Scientific/Engineering",
-    "Operating System :: Microsoft :: Windows",
-    "Operating System :: POSIX",
-    "Operating System :: Unix",
-    "Operating System :: MacOS",
 ]
-
-dependencies = []   # will be dynamically set
-
-[project.license]
-text = "Apache License 2.0"
+dynamic = ["version", "dependencies"]
 
 [project.optional-dependencies]
-test = ["pytest>=3.8", ]
-mssql = ["pyodbc>=4,<4.1", ]
-mysql = ["pymysql>1,<1.1", ]
-postgresql = ["psycopg2>2.9,<2.10", ]
-parquet = ["fastparquet==2022.11.0", "pyarrow>=14.0.2,<15.0", ]
-s3 = ["boto3==1.29.1", ]
-mongo = ["pymongo[srv]>=4.2.0,<5.0", ]
+mssql = ["pyodbc>=4,<4.1"]
+mysql = ["pymysql>1,<1.1"]
+postgresql = ["psycopg2>2.9,<2.10"]
+parquet = ["fastparquet==2022.11.0", "pyarrow>=14.0.2,<15.0"]
+s3 = ["boto3==1.29.1"]
+mongo = ["pymongo[srv]>=4.2.0,<5.0"]
 
-[project.urls]
-Homepage = "https://www.taipy.io"
-Documentation = "https://docs.taipy.io"
-Source = "https://github.com/Avaiga/taipy"
-Download = "https://pypi.org/project/taipy/#files"
-Tracker = "https://github.com/Avaiga/taipy/issues"
-Security = "https://github.com/Avaiga/taipy?tab=security-ov-file#readme"
-"Release notes" = "https://docs.taipy.io/en/release-4.0.0.dev0/relnotes/"
+[tool.setuptools.packages]
+find = {include = ["taipy", "taipy.core", "taipy.core.*"]}
 
-[tool.setuptools]
-zip-safe = false
-
-[tool.setuptools.package-data]
-taipy = ["version.json", ]
+[project.urls]
+homepage = "https://github.com/avaiga/taipy"
 
-[tool.setuptools.packages.find]
-where = [".", ]
-include = ["taipy", "taipy.core", "taipy.core.*", ]
+[tool.setuptools.data-files]
+"version" = ["version.json"]

+ 59 - 0
taipy/core/setup.py

@@ -0,0 +1,59 @@
+# 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 json
+import os
+from pathlib import Path
+from setuptools import find_namespace_packages, find_packages, setup
+
+root_folder = Path(__file__).parent
+
+with open("README.md") as readme_file:
+    readme = readme_file.read()
+
+version_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "version.json")
+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}"
+
+def get_requirements():
+    reqs = set()
+    for pkg in (root_folder / "tools" / "packages").iterdir():
+        if "taipy-core" not in str(pkg):
+            continue
+        requirements_file = pkg / "setup.requirements.txt"
+        if requirements_file.exists():
+            reqs.update(requirements_file.read_text("UTF-8").splitlines())
+
+    return [r for r in reqs if r and not r.startswith("taipy")]
+
+test_requirements = ["pytest>=3.8"]
+
+extras_require = {
+    "mssql": ["pyodbc>=4,<4.1"],
+    "mysql": ["pymysql>1,<1.1"],
+    "postgresql": ["psycopg2>2.9,<2.10"],
+    "parquet": ["fastparquet==2022.11.0", "pyarrow>=14.0.2,<15.0"],
+    "s3": ["boto3==1.29.1"],
+    "mongo": ["pymongo[srv]>=4.2.0,<5.0"],
+}
+
+setup(
+    version=version_string,
+    install_requires=get_requirements(),
+    packages=find_namespace_packages(where=".") + find_packages(include=["taipy", "taipy.core", "taipy.core.*"]),
+    include_package_data=True,
+    data_files=[('version', ['version.json'])],
+    tests_require=test_requirements,
+    extras_require=extras_require,
+)

+ 17 - 34
taipy/gui/pyproject.toml

@@ -1,16 +1,16 @@
 [build-system]
-requires = [ "setuptools>=42", "wheel", "setuptools_scm",]
+requires = ["setuptools>=42", "wheel"]
 build-backend = "setuptools.build_meta"
 
 [project]
 name = "taipy-gui"
-version = "0.0.0"  # will be set dynamically
 description = "Low-code library to create graphical user interfaces on the Web for your Python applications."
 readme = "package_desc.md"
 requires-python = ">=3.8"
-keywords = [ "taipy-gui",]
+license = {text = "Apache License 2.0"}
+authors = [{name = "Avaiga", email = "dev@taipy.io"}]
+keywords = ["taipy-gui"]
 classifiers = [
-    "Development Status :: 5 - Production/Stable",
     "Intended Audience :: Developers",
     "License :: OSI Approved :: Apache Software License",
     "Natural Language :: English",
@@ -20,39 +20,22 @@ classifiers = [
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
-    "Topic :: Software Development",
-    "Topic :: Scientific/Engineering",
-    "Operating System :: Microsoft :: Windows",
-    "Operating System :: POSIX",
-    "Operating System :: Unix",
-    "Operating System :: MacOS",
 ]
-dependencies = []  # will be set dynamically
-
-[project.license]
-text = "Apache License 2.0"
+dynamic = ["version", "dependencies"]
 
 [project.optional-dependencies]
-test = [ "pytest>=3.8",]
-ngrok = [ "pyngrok>=5.1,<6.0",]
-image = [ "python-magic>=0.4.24,<0.5; platform_system!='Windows'", "python-magic-bin>=0.4.14,<0.5; platform_system=='Windows'",]
-arrow = [ "pyarrow>=14.0.2,<15.0",]
-
-[project.urls]
-Homepage = "https://www.taipy.io"
-Documentation = "https://docs.taipy.io"
-Source = "https://github.com/Avaiga/taipy"
-Download = "https://pypi.org/project/taipy/#files"
-Tracker = "https://github.com/Avaiga/taipy/issues"
-Security = "https://github.com/Avaiga/taipy?tab=security-ov-file#readme"
-"Release notes" = "https://docs.taipy.io/en/release-0.0.0/relnotes/"  # will be set dynamically
+ngrok = ["pyngrok>=5.1,<6.0"]
+image = [
+    "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
+    "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
+]
+arrow = ["pyarrow>=14.0.2,<15.0"]
 
-[tool.setuptools]
-zip-safe = false
+[tool.setuptools.packages]
+find = {include = ["taipy", "taipy.gui", "taipy.gui.*"]}
 
-[tool.setuptools.package-data]
-taipy = [ "version.json",]
+[project.urls]
+homepage = "https://github.com/avaiga/taipy"
 
-[tool.setuptools.packages.find]
-where = [ ".",]
-include = [ "taipy", "taipy.gui", "taipy.gui.*",]
+[tool.setuptools.data-files]
+"version" = ["version.json"]

+ 71 - 0
taipy/gui/setup.py

@@ -0,0 +1,71 @@
+# 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 json
+import os
+from pathlib import Path
+from setuptools import find_namespace_packages, find_packages, setup
+from setuptools.command.build_py import build_py
+
+root_folder = Path(__file__).parent
+
+readme = Path("README.md").read_text()
+
+version_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "version.json")
+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}"
+
+def get_requirements():
+    reqs = set()
+    for pkg in (root_folder / "tools" / "packages").iterdir():
+        if "taipy-gui" not in str(pkg):
+            continue
+        requirements_file = pkg / "setup.requirements.txt"
+        if requirements_file.exists():
+            reqs.update(requirements_file.read_text("UTF-8").splitlines())
+
+    return [r for r in reqs if r and not r.startswith("taipy")]
+
+test_requirements = ["pytest>=3.8"]
+
+extras_require = {
+    "ngrok": ["pyngrok>=5.1,<6.0"],
+    "image": [
+        "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
+        "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
+    ],
+    "arrow": ["pyarrow>=14.0.2,<15.0"],
+}
+
+def _build_webapp():
+    already_exists = Path("./taipy/gui/webapp/index.html").exists()
+    if not already_exists:
+        os.system("cd ../../frontend/taipy-gui/dom && npm ci")
+        os.system("cd ../../frontend/taipy-gui && npm ci --omit=optional && npm run build")
+
+class NPMInstall(build_py):
+    def run(self):
+        _build_webapp()
+        build_py.run(self)
+
+setup(
+    version=version_string,
+    install_requires=get_requirements(),
+    packages=find_namespace_packages(where=".") + find_packages(include=["taipy", "taipy.gui", "taipy.gui.*"]),
+    include_package_data=True,
+    data_files=[("version", ["version.json"])],
+    tests_require=test_requirements,
+    extras_require=extras_require,
+    cmdclass={"build_py": NPMInstall},
+)

+ 8 - 25
taipy/rest/pyproject.toml

@@ -4,14 +4,13 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "taipy-rest"
-version = "0.0.0"  # will be dynamically set
 description = "Library to expose taipy-core REST APIs."
 readme = "package_desc.md"
 requires-python = ">=3.8"
 license = {text = "Apache License 2.0"}
+authors = [{name = "Avaiga", email = "dev@taipy.io"}]
 keywords = ["taipy-rest"]
 classifiers = [
-    "Development Status :: 5 - Production/Stable",
     "Intended Audience :: Developers",
     "License :: OSI Approved :: Apache Software License",
     "Natural Language :: English",
@@ -21,30 +20,14 @@ classifiers = [
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
-    "Topic :: Software Development",
-    "Topic :: Scientific/Engineering",
-    "Operating System :: Microsoft :: Windows",
-    "Operating System :: POSIX",
-    "Operating System :: Unix",
-    "Operating System :: MacOS",
 ]
-dependencies = []  # will be dynamically set
+dynamic = ["version", "dependencies"]
 
-[project.urls]
-Homepage = "https://www.taipy.io"
-Documentation = "https://docs.taipy.io"
-Source = "https://github.com/Avaiga/taipy"
-Download = "https://pypi.org/project/taipy/#files"
-Tracker = "https://github.com/Avaiga/taipy/issues"
-Security = "https://github.com/Avaiga/taipy?tab=security-ov-file#readme"
-"Release notes" = "https://docs.taipy.io/en/release-0.0.0/relnotes/"  # version will be dynamically set
-
-[tool.setuptools.packages.find]
-where = ["."]
-include = ["taipy", "taipy.rest"]
+[tool.setuptools.packages]
+find = {include = ["taipy", "taipy.rest"]}
 
-[tool.setuptools.package-data]
-"taipy" = ["version.json"]
+[project.urls]
+homepage = "https://github.com/avaiga/taipy"
 
-[tool.setuptools]
-zip-safe = false
+[tool.setuptools.data-files]
+"version" = ["version.json"]

+ 46 - 0
taipy/rest/setup.py

@@ -0,0 +1,46 @@
+# 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 json
+import os
+from pathlib import Path
+from setuptools import find_namespace_packages, find_packages, setup
+
+root_folder = Path(__file__).parent
+
+with open("README.md") as readme_file:
+    readme = readme_file.read()
+
+version_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "version.json")
+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}"
+
+def get_requirements():
+    reqs = set()
+    for pkg in (root_folder / "tools" / "packages").iterdir():
+        if "taipy-rest" not in str(pkg):
+            continue
+        requirements_file = pkg / "setup.requirements.txt"
+        if requirements_file.exists():
+            reqs.update(requirements_file.read_text("UTF-8").splitlines())
+
+    return [r for r in reqs if r and not r.startswith("taipy")]
+
+setup(
+    version=version_string,
+    packages=find_namespace_packages(where=".") + find_packages(include=["taipy", "taipy.rest"]),
+    include_package_data=True,
+    data_files=[('version', ['version.json'])],
+    install_requires=get_requirements(),
+)

+ 7 - 27
taipy/templates/pyproject.toml

@@ -4,14 +4,13 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "taipy-templates"
-version = "0.0.0"  # will be dynamically set
 description = "An open-source package holding Taipy application templates."
 readme = "package_desc.md"
 requires-python = ">=3.8"
 license = {text = "Apache License 2.0"}
+authors = [{name = "Avaiga", email = "dev@taipy.io"}]
 keywords = ["taipy-templates"]
 classifiers = [
-    "Development Status :: 5 - Production/Stable",
     "Intended Audience :: Developers",
     "License :: OSI Approved :: Apache Software License",
     "Natural Language :: English",
@@ -21,33 +20,14 @@ classifiers = [
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
-    "Topic :: Software Development",
-    "Topic :: Scientific/Engineering",
-    "Operating System :: Microsoft :: Windows",
-    "Operating System :: POSIX",
-    "Operating System :: Unix",
-    "Operating System :: MacOS",
 ]
-dependencies = []  # version will be dynamically set
+dynamic = ["version", "dependencies"]
 
-[project.optional-dependencies]
-test = ["pytest>=3.8"]
+[tool.setuptools.packages]
+find = {include = ["taipy"]}
 
 [project.urls]
-Homepage = "https://www.taipy.io"
-Documentation = "https://docs.taipy.io"
-Source = "https://github.com/Avaiga/taipy"
-Download = "https://pypi.org/project/taipy/#files"
-Tracker = "https://github.com/Avaiga/taipy/issues"
-Security = "https://github.com/Avaiga/taipy?tab=security-ov-file#readme"
-"Release notes" = "https://docs.taipy.io/en/release-0.0.0/relnotes/"  # version will be dynamically set
+homepage = "https://github.com/avaiga/taipy"
 
-[tool.setuptools.packages.find]
-where = ["."]
-include = ["taipy"]
-
-[tool.setuptools.package-data]
-"taipy" = ["version.json"]
-
-[tool.setuptools]
-zip-safe = false
+[tool.setuptools.data-files]
+"version" = ["version.json"]

+ 34 - 0
taipy/templates/setup.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 json
+import os
+from setuptools import find_namespace_packages, find_packages, setup
+
+with open("README.md", "rb") as readme_file:
+    readme = readme_file.read().decode("UTF-8")
+
+version_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "version.json")
+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}"
+
+test_requirements = ["pytest>=3.8"]
+
+setup(
+    packages=find_namespace_packages(where=".") + find_packages(include=["taipy"]),
+    include_package_data=True,
+    data_files=[('version', ['version.json'])],
+    test_suite="tests",
+    version=version_string,
+)

+ 3 - 40
tools/packages/taipy-config/setup.py

@@ -35,51 +35,14 @@ requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines()
 test_requirements = ["pytest>=3.8"]
 
 setup(
-    author="Avaiga",
-    author_email="dev@taipy.io",
-    python_requires=">=3.8",
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: Apache Software License",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-        "Programming Language :: Python :: 3.12",
-        "Topic :: Software Development",
-        "Topic :: Scientific/Engineering",
-        "Operating System :: Microsoft :: Windows",
-        "Operating System :: POSIX",
-        "Operating System :: Unix",
-        "Operating System :: MacOS",
-    ],
-    description="A Taipy package dedicated to easily configure a Taipy application.",
+    version=version_string,
     install_requires=requirements,
-    long_description=package_desc,
-    long_description_content_type="text/markdown",
-    include_package_data=True,
-    license="Apache License 2.0",
-    keywords="taipy-config",
-    name="taipy-config",
     packages=find_packages(
         where=root_folder, include=[
             "taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*", "taipy._cli", "taipy._cli.*"
         ]
     ),
-    test_suite="tests",
+    include_package_data=True,
+    data_files=[('version', ['version.json'])],
     tests_require=test_requirements,
-    version=version_string,
-    zip_safe=False,
-    project_urls={
-        "Homepage": "https://www.taipy.io",
-        "Documentation": "https://docs.taipy.io",
-        "Source": "https://github.com/Avaiga/taipy",
-        "Download": "https://pypi.org/project/taipy/#files",
-        "Tracker": "https://github.com/Avaiga/taipy/issues",
-        "Security": "https://github.com/Avaiga/taipy?tab=security-ov-file#readme",
-        f"Release notes": "https://docs.taipy.io/en/release-{version_string}/relnotes/",
-    },
 )

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

@@ -42,48 +42,11 @@ extras_require = {
 }
 
 setup(
-    author="Avaiga",
-    author_email="dev@taipy.io",
-    python_requires=">=3.8",
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: Apache Software License",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-        "Programming Language :: Python :: 3.12",
-        "Topic :: Software Development",
-        "Topic :: Scientific/Engineering",
-        "Operating System :: Microsoft :: Windows",
-        "Operating System :: POSIX",
-        "Operating System :: Unix",
-        "Operating System :: MacOS",
-    ],
-    description="A Python library to build powerful and customized data-driven back-end applications.",
+    version=version_string,
     install_requires=requirements,
-    long_description=package_desc,
-    long_description_content_type="text/markdown",
-    license="Apache License 2.0",
-    keywords="taipy-core",
-    name="taipy-core",
     packages=find_packages(where=root_folder, include=["taipy", "taipy.core", "taipy.core.*"]),
     include_package_data=True,
-    test_suite="tests",
+    data_files=[('version', ['version.json'])],
     tests_require=test_requirements,
-    version=version_string,
-    zip_safe=False,
     extras_require=extras_require,
-    project_urls={
-        "Homepage": "https://www.taipy.io",
-        "Documentation": "https://docs.taipy.io",
-        "Source": "https://github.com/Avaiga/taipy",
-        "Download": "https://pypi.org/project/taipy/#files",
-        "Tracker": "https://github.com/Avaiga/taipy/issues",
-        "Security": "https://github.com/Avaiga/taipy?tab=security-ov-file#readme",
-        f"Release notes": "https://docs.taipy.io/en/release-{version_string}/relnotes/",
-    },
 )

+ 3 - 40
tools/packages/taipy-gui/setup.py

@@ -72,49 +72,12 @@ class NPMInstall(build_py):
 
 
 setup(
-    author="Avaiga",
-    author_email="dev@taipy.io",
-    python_requires=">=3.8",
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: Apache Software License",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-        "Programming Language :: Python :: 3.12",
-        "Topic :: Software Development",
-        "Topic :: Scientific/Engineering",
-        "Operating System :: Microsoft :: Windows",
-        "Operating System :: POSIX",
-        "Operating System :: Unix",
-        "Operating System :: MacOS",
-    ],
-    description="Low-code library to create graphical user interfaces on the Web for your Python applications.",
-    long_description=package_desc,
-    long_description_content_type="text/markdown",
+    version=version_string,
     install_requires=requirements,
-    license="Apache License 2.0",
-    include_package_data=True,
-    keywords="taipy-gui",
-    name="taipy-gui",
     packages=find_packages(where=root_folder, include=["taipy", "taipy.gui", "taipy.gui.*"]),
-    test_suite="tests",
+    include_package_data=True,
+    data_files=[("version", ["version.json"])],
     tests_require=test_requirements,
-    version=version_string,
-    zip_safe=False,
     extras_require=extras_require,
     cmdclass={"build_py": NPMInstall},
-    project_urls={
-        "Homepage": "https://www.taipy.io",
-        "Documentation": "https://docs.taipy.io",
-        "Source": "https://github.com/Avaiga/taipy",
-        "Download": "https://pypi.org/project/taipy/#files",
-        "Tracker": "https://github.com/Avaiga/taipy/issues",
-        "Security": "https://github.com/Avaiga/taipy?tab=security-ov-file#readme",
-        f"Release notes": "https://docs.taipy.io/en/release-{version_string}/relnotes/",
-    },
 )

+ 1 - 36
tools/packages/taipy-rest/setup.py

@@ -33,44 +33,9 @@ with open(version_path) as version_file:
 requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines() if r]
 
 setup(
-    author="Avaiga",
-    name="taipy-rest",
-    keywords="taipy-rest",
-    python_requires=">=3.8",
     version=version_string,
-    author_email="dev@taipy.io",
     packages=find_packages(where=root_folder, include=["taipy", "taipy.rest", "taipy.rest.*"]),
     include_package_data=True,
-    long_description=package_desc,
-    long_description_content_type="text/markdown",
-    description="Library to expose taipy-core REST APIs.",
-    license="Apache License 2.0",
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: Apache Software License",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-        "Programming Language :: Python :: 3.12",
-        "Topic :: Software Development",
-        "Topic :: Scientific/Engineering",
-        "Operating System :: Microsoft :: Windows",
-        "Operating System :: POSIX",
-        "Operating System :: Unix",
-        "Operating System :: MacOS",
-    ],
+    data_files=[('version', ['version.json'])],
     install_requires=requirements,
-    project_urls={
-        "Homepage": "https://www.taipy.io",
-        "Documentation": "https://docs.taipy.io",
-        "Source": "https://github.com/Avaiga/taipy",
-        "Download": "https://pypi.org/project/taipy/#files",
-        "Tracker": "https://github.com/Avaiga/taipy/issues",
-        "Security": "https://github.com/Avaiga/taipy?tab=security-ov-file#readme",
-        f"Release notes": "https://docs.taipy.io/en/release-{version_string}/relnotes/",
-    },
 )

+ 1 - 38
tools/packages/taipy-templates/setup.py

@@ -35,46 +35,9 @@ requirements = [r for r in (setup_requirements).read_text("UTF-8").splitlines()
 test_requirements = ["pytest>=3.8"]
 
 setup(
-    author="Avaiga",
-    author_email="dev@taipy.io",
-    python_requires=">=3.8",
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: Apache Software License",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-        "Programming Language :: Python :: 3.12",
-        "Topic :: Software Development",
-        "Topic :: Scientific/Engineering",
-        "Operating System :: Microsoft :: Windows",
-        "Operating System :: POSIX",
-        "Operating System :: Unix",
-        "Operating System :: MacOS",
-    ],
-    description="An open-source package holding Taipy application templates.",
-    license="Apache License 2.0",
-    long_description=package_desc,
-    long_description_content_type="text/markdown",
-    keywords="taipy-templates",
-    name="taipy-templates",
-    install_requires=requirements,
     packages=find_packages(where=root_folder, include=["taipy"]),
     include_package_data=True,
+    data_files=[('version', ['version.json'])],
     test_suite="tests",
     version=version_string,
-    zip_safe=False,
-    project_urls={
-        "Homepage": "https://www.taipy.io",
-        "Documentation": "https://docs.taipy.io",
-        "Source": "https://github.com/Avaiga/taipy",
-        "Download": "https://pypi.org/project/taipy/#files",
-        "Tracker": "https://github.com/Avaiga/taipy/issues",
-        "Security": "https://github.com/Avaiga/taipy?tab=security-ov-file#readme",
-        f"Release notes": "https://docs.taipy.io/en/release-{version_string}/relnotes/",
-    },
 )

+ 11 - 57
tools/packages/taipy/setup.py

@@ -33,17 +33,6 @@ requirements = [r for r in (root_folder / "setup.requirements.txt").read_text("U
 
 test_requirements = ["pytest>=3.8"]
 
-extras_require = {
-    "ngrok": ["pyngrok>=5.1,<6.0"],
-    "image": [
-        "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
-        "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
-    ],
-    "rdp": ["rdp>=0.8"],
-    "arrow": ["pyarrow>=14.0.2,<15.0"],
-    "mssql": ["pyodbc>=4"],
-}
-
 
 class NPMInstall(build_py):
     def run(self):
@@ -57,53 +46,18 @@ class NPMInstall(build_py):
 
 
 setup(
-    author="Avaiga",
-    author_email="dev@taipy.io",
-    python_requires=">=3.8",
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: Apache Software License",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-        "Programming Language :: Python :: 3.12",
-        "Topic :: Software Development",
-        "Topic :: Scientific/Engineering",
-        "Operating System :: Microsoft :: Windows",
-        "Operating System :: POSIX",
-        "Operating System :: Unix",
-        "Operating System :: MacOS",
-    ],
-    description="A 360° open-source platform from Python pilots to production-ready web apps.",
+    version=version_string,
     install_requires=requirements,
-    entry_points={
-        "console_scripts": [
-            "taipy = taipy._entrypoint:_entrypoint",
-        ]
+    packages=find_packages(include=["taipy", "taipy.*"]),
+    extras_require={
+        "ngrok": ["pyngrok>=5.1,<6.0"],
+        "image": [
+            "python-magic>=0.4.24,<0.5;platform_system!='Windows'",
+            "python-magic-bin>=0.4.14,<0.5;platform_system=='Windows'",
+        ],
+        "rdp": ["rdp>=0.8"],
+        "arrow": ["pyarrow>=14.0.2,<15.0"],
+        "mssql": ["pyodbc>=4"],
     },
-    license="Apache License 2.0",
-    long_description=package_desc,
-    long_description_content_type="text/markdown",
-    keywords="taipy",
-    name="taipy",
-    packages=find_packages(include=["taipy", "taipy._cli", "taipy._cli.*", "taipy.gui_core"]),
-    include_package_data=True,
-    test_suite="tests",
-    version=version_string,
-    zip_safe=False,
-    extras_require=extras_require,
     cmdclass={"build_py": NPMInstall},
-    project_urls={
-        "Homepage": "https://www.taipy.io",
-        "Documentation": "https://docs.taipy.io",
-        "Source": "https://github.com/Avaiga/taipy",
-        "Download": "https://pypi.org/project/taipy/#files",
-        "Tracker": "https://github.com/Avaiga/taipy/issues",
-        "Security": "https://github.com/Avaiga/taipy?tab=security-ov-file#readme",
-        f"Release notes": "https://docs.taipy.io/en/release-{version_string}/relnotes/",
-    },
 )