Skip to content

Commit

Permalink
Merge pull request #1634 from Avaiga/feature/add-pyproject
Browse files Browse the repository at this point in the history
feat: replace setup.py with pyproject.toml
  • Loading branch information
joaoandre-avaiga committed Aug 13, 2024
2 parents b126c80 + 75c915e commit e2bd93a
Show file tree
Hide file tree
Showing 16 changed files with 478 additions and 591 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build-and-release-single-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,15 @@ 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 setup.py build_py && python -m build
python -m build
- name: Rename files
run: |
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ 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 setup.py build_py && python -m build
python -m build
for file in ./dist/*; do mv "$file" "${file//_/-}"; done
- name: Create tag and release
Expand Down Expand Up @@ -204,18 +209,18 @@ jobs:
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: Update pyproject.toml
working-directory: ${{ steps.set-variables.outputs.package_dir }}
run: |
python tools/release/setup_project.py . prod
- name: Build Taipy package
run: |
python setup.py build_py && python -m build
python -m build
- name: Create tag and release Taipy
run: |
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,28 @@ 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: Install Taipy without dependencies
- 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
run: |
pip install .
Expand Down
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
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"}
keywords = ["taipy"]
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",
]
dependencies = [] # will be dynamically set

[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'"
]
rdp = ["rdp>=0.8"]
arrow = ["pyarrow>=14.0.2,<15.0"]
mssql = ["pyodbc>=4"]

[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]
include = ["taipy", "taipy.*"]

[tool.setuptools.package-data]
"taipy" = ["version.json"]

[tool.setuptools]
zip-safe = false

[project.scripts]
taipy = "taipy._entrypoint:_entrypoint"

[tool.ruff]
exclude = [
".git",
Expand Down
121 changes: 0 additions & 121 deletions setup.py

This file was deleted.

58 changes: 58 additions & 0 deletions taipy/config/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
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"}
keywords = ["taipy-config"]
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",
]

dependencies = [
"toml>=0.10,<0.11",
"deepdiff>=6.7,<6.8"
]

[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

[tool.setuptools.packages]
find = {where = ["."], include = ["taipy", "taipy.config", "taipy.config.*", "taipy.logger", "taipy.logger.*"]}

[tool.setuptools.package-data]
"version" = ["version.json"]

[tool.setuptools]
zip-safe = false
Loading

0 comments on commit e2bd93a

Please sign in to comment.