Skip to content

Commit

Permalink
Merge branch 'develop' into docs/#1819-docs-updating-docs-on-element-…
Browse files Browse the repository at this point in the history
…definition
  • Loading branch information
namnguyen20999 authored Oct 3, 2024
2 parents 6d3693a + 54a986c commit 13097ee
Show file tree
Hide file tree
Showing 344 changed files with 1,642 additions and 1,207 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-and-release-single-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
description: "The version of the package to be released"
required: true
target_package:
description: "The package to be released (gui, config, core, rest, templates, taipy)"
description: "The package to be released (gui, common, core, rest, templates, taipy)"
required: true

env:
Expand All @@ -28,7 +28,7 @@ jobs:
fetch-versions:
runs-on: ubuntu-latest
outputs:
config_VERSION: ${{ steps.version-setup.outputs.config_VERSION }}
common_VERSION: ${{ steps.version-setup.outputs.common_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 }}
Expand Down Expand Up @@ -73,11 +73,11 @@ jobs:
- name: Set Build Variables
id: set-variables
run: |
if [ "${{ github.event.inputs.target_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
if [ "${{ github.event.inputs.target_package }}" == "common" ]; then
echo "package_version=${{needs.fetch-versions.outputs.common_VERSION}}" >> $GITHUB_OUTPUT
echo "package_dir=./taipy/common" >> $GITHUB_OUTPUT
echo "release_name=${{needs.fetch-versions.outputs.common_VERSION}}-common" >> $GITHUB_OUTPUT
echo "tar_path=./dist/${{ github.event.repository.name }}-common-${{needs.fetch-versions.outputs.common_VERSION}}.tar.gz" >> $GITHUB_OUTPUT
elif [ "${{ github.event.inputs.target_package }}" == "core" ]; then
echo "package_version=${{needs.fetch-versions.outputs.core_VERSION}}" >> $GITHUB_OUTPUT
echo "package_dir=./taipy/core" >> $GITHUB_OUTPUT
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Update setup.requirements.txt
run: |
python tools/release/update_setup_requirements.py taipy-${{ github.event.inputs.target_package }} \
${{needs.fetch-versions.outputs.config_VERSION}} \
${{needs.fetch-versions.outputs.common_VERSION}} \
${{needs.fetch-versions.outputs.core_VERSION}} \
${{needs.fetch-versions.outputs.gui_VERSION}} \
${{needs.fetch-versions.outputs.rest_VERSION}} \
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
python tools/release/build_package_structure.py ${{ github.event.inputs.target_package }}
- name: Copy Taipy Logger
if: github.event.inputs.target_package == 'config'
if: github.event.inputs.target_package == 'common'
run: |
cp -r taipy/logger/. ${{ steps.set-variables.outputs.package_dir }}/taipy/logger
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fetch-versions:
runs-on: ubuntu-latest
outputs:
config_VERSION: ${{ steps.version-setup.outputs.config_VERSION }}
common_VERSION: ${{ steps.version-setup.outputs.common_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 }}
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
package: [config, core, gui, rest, templates]
package: [common, core, gui, rest, templates]
max-parallel: 1
steps:
- uses: actions/checkout@v4
Expand All @@ -71,11 +71,11 @@ jobs:
- 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
if [ "${{ matrix.package }}" == "common" ]; then
echo "package_version=${{needs.fetch-versions.outputs.common_VERSION}}" >> $GITHUB_OUTPUT
echo "package_dir=./taipy/common" >> $GITHUB_OUTPUT
echo "release_name=${{needs.fetch-versions.outputs.common_VERSION}}-common" >> $GITHUB_OUTPUT
echo "tar_path=./dist/${{ github.event.repository.name }}-common-${{needs.fetch-versions.outputs.common_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
Expand All @@ -102,7 +102,7 @@ jobs:
- 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.common_VERSION}} \
${{needs.fetch-versions.outputs.core_VERSION}} \
${{needs.fetch-versions.outputs.gui_VERSION}} \
${{needs.fetch-versions.outputs.rest_VERSION}} \
Expand Down Expand Up @@ -142,15 +142,6 @@ jobs:
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: |
Expand Down Expand Up @@ -192,7 +183,7 @@ jobs:
- name: Update setup.requirements.txt
run: |
python tools/release/update_setup_requirements.py taipy \
${{needs.fetch-versions.outputs.config_VERSION}} \
${{needs.fetch-versions.outputs.common_VERSION}} \
${{needs.fetch-versions.outputs.core_VERSION}} \
${{needs.fetch-versions.outputs.gui_VERSION}} \
${{needs.fetch-versions.outputs.rest_VERSION}} \
Expand Down Expand Up @@ -233,7 +224,7 @@ jobs:

- 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.common_VERSION }}-common --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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-config-pyi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
python-version: '3.11'
- name: Update config.pyi
run: python taipy/config/stubs/generate_pyi.py
run: python taipy/common/config/stubs/generate_pyi.py
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update config.pyi"
24 changes: 6 additions & 18 deletions .github/workflows/partial-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: jpetrucciani/mypy-check@master
with:
mypy_flags: "--ignore-missing-imports --implicit-optional --no-namespace-packages --exclude (taipy/templates/|tools/|doc/gui/examples/.*/builder.py) --follow-imports skip --disable-error-code import-untyped"
mypy_flags: "--ignore-missing-imports --implicit-optional --disable-error-code attr-defined --no-namespace-packages --exclude (taipy/templates/|tools/|doc/gui/examples/.*/builder.py|taipy/common/config/config.pyi) --follow-imports skip --disable-error-code import-untyped"

- uses: chartboost/ruff-action@v1
tests:
Expand All @@ -33,19 +33,15 @@ jobs:
id: changes
with:
filters: |
cli:
- 'taipy/_cli/**'
config:
- 'taipy/config/**'
common:
- 'taipy/common/**'
core:
- 'taipy/core/**'
gui:
- 'taipy/gui/**'
- 'frontend/taipy-gui/**'
gui-core:
- 'taipy/gui_core/**'
logger:
- 'taipy/logger/**'
rest:
- 'taipy/rest/**'
templates:
Expand Down Expand Up @@ -103,13 +99,9 @@ jobs:
if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
run: pipenv run playwright install chromium --with-deps

- name: Pytest CLI
if: steps.changes.outputs.cli == 'true'
run: pipenv run pytest tests/cli

- name: Pytest Config
if: steps.changes.outputs.config == 'true'
run: pipenv run pytest tests/config
- name: Pytest Common
if: steps.changes.outputs.common == 'true'
run: pipenv run pytest tests/common

- name: Pytest Core
if: steps.changes.outputs.core == 'true'
Expand All @@ -125,10 +117,6 @@ jobs:
if: steps.changes.outputs.gui-core == 'true'
run: pipenv run pytest tests/gui_core

- name: Pytest Logger
if: steps.changes.outputs.logger == 'true'
run: pipenv run pytest tests/logger

- name: Pytest Rest
if: steps.changes.outputs.rest == 'true'
run: pipenv run pytest tests/rest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-single-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: "The tag of the package to publish on Pypi (ex: 1.0.0, 1.0.0.dev0)"
required: true
target_package:
description: "The package to be released (gui, config, core, rest, templates, taipy)"
description: "The package to be released (gui, common, core, rest, templates, taipy)"
required: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
package: [ config, core, gui, rest, templates ]
package: [ common, core, gui, rest, templates ]
max-parallel: 1
environment: publish
runs-on: ubuntu-latest
Expand Down
25 changes: 25 additions & 0 deletions doc/gui/examples/controls/input_active.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
from taipy.gui import Gui

value = 20

page = """
<|{value}|input|active=false|>
"""

if __name__ == "__main__":
Gui(page).run(title="Input - Inactive")
39 changes: 39 additions & 0 deletions doc/gui/examples/controls/input_change_delay_on_change.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
import logging

from taipy.gui import Gui

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

value = ""


# The [on_change] property is not set: Taipy GUI automatically finds and binds the global on_change()
# function to handle changes in the input control. You could set this property to your own function if necessary.
def on_change(state, var_name, v):
logging.info(f"Value of {var_name} changed to {v}")


# If change_delay is set to -1, the change event is triggered on Enter key press
page = """
<|{value}|input|change_delay=-1|>
"""


if __name__ == "__main__":
Gui(page).run(title="Input - on_change")
25 changes: 25 additions & 0 deletions doc/gui/examples/controls/input_line_shown.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
from taipy.gui import Gui

lines = "1 \n2 \n3 \n4 \n5"

page = """
<|{lines}|input|multiline|lines_shown=5|>
"""

if __name__ == "__main__":
Gui(page).run(title="Input - Lines shown")
26 changes: 26 additions & 0 deletions doc/gui/examples/controls/input_multiline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
from taipy.gui import Gui

text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec purus et nunc lacinia gravida. "


page = """
<|{text}|input|multiline|>
"""

if __name__ == "__main__":
Gui(page).run(title="Input - Multiline")
36 changes: 36 additions & 0 deletions doc/gui/examples/controls/input_on_action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
import logging

from taipy.gui import Gui

logging.basicConfig(level=logging.INFO)

def key_pressed(state, id, payload):
key = payload.get('args', [None])[0]
if key in ["F1", "F2", "F3"]:
logging.info(f"{key} key pressed")


value = 0

# on_action function is called when the action_keys are pressed
page = """
<|{value}|input|change_delay=300|on_action=key_pressed|action_keys=F1;F2;F3|>
"""

if __name__ == "__main__":
Gui(page).run(title="Input - On change")
23 changes: 23 additions & 0 deletions doc/gui/examples/controls/input_password.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
from taipy.gui import Gui

page = """
<|input|password|>
"""

if __name__ == "__main__":
Gui(page).run(title="Input - Password")
Loading

0 comments on commit 13097ee

Please sign in to comment.