Skip to content

Commit e637fdf

Browse files
Package management script (#638)
1 parent 97549df commit e637fdf

18 files changed

+1063
-87
lines changed

.github/actions/install/action.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: install
2+
description: Install the package and dependencies
3+
inputs:
4+
python-version:
5+
required: true
6+
description: 'Python version'
7+
os:
8+
required: true
9+
description: 'Operating system'
10+
install-gui:
11+
required: false
12+
description: 'Whether to install the GUI dependencies'
13+
default: true
14+
pipfile-version:
15+
required: false
16+
description: 'The Pipfile type: one of min, max'
17+
default: 'min'
18+
outputs:
19+
to-update:
20+
description: "True if the dependencies can be updated"
21+
value: ${{ steps.install-dependencies.outputs.diff != '' }}
22+
runs:
23+
using: "composite"
24+
steps:
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ inputs.python-version }}
28+
29+
- name: Install pipenv
30+
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
31+
shell: bash
32+
33+
- name: Install minimum supported dependencies
34+
if: inputs.pipfile-version == 'min'
35+
run: pipenv install --dev --python=${{ inputs.python-version }}
36+
shell: bash
37+
38+
- name: Install maximum version supported dependencies
39+
if: inputs.pipfile-version == 'max'
40+
run: |
41+
# Override the current Pipfile with the Pipfile containing the max versions
42+
rm Pipfile
43+
mv tools/packages/pipfiles/Pipfile${{ inputs.python-version }}.max Pipfile
44+
pipenv install --dev --python=${{ inputs.python-version }}
45+
shell: bash
46+
47+
- name: Setup LibMagic (MacOS)
48+
if: inputs.os == 'macos-latest' && inputs.install-gui
49+
run: brew install libmagic
50+
shell: bash
51+
52+
- uses: actions/setup-node@v4
53+
if: inputs.install-gui
54+
with:
55+
node-version: 20
56+
57+
- name: Frontend Bundle Build
58+
if: inputs.install-gui
59+
run: pipenv run python tools/frontend/bundle_build.py
60+
shell: bash
61+
62+
- name: Install Playwright
63+
if: inputs.install-gui
64+
run: pipenv run playwright install chromium --with-deps
65+
shell: bash
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Dependencies management
2+
3+
on:
4+
schedule:
5+
# Run each Sunday at mid day
6+
- cron: 00 12 * * 0
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
latest-versions:
12+
timeout-minutes: 20
13+
strategy:
14+
matrix:
15+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
16+
os: [ubuntu-latest]
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{matrix.python-version}}
27+
28+
- name: Check if the latest version supported is up to date.
29+
id: ensure-dependencies-are-up-to-date
30+
working-directory: tools/packages
31+
run: |
32+
# Ensure dependencies are aligned between Taipy packages
33+
pip install -r requirements.txt
34+
python check-dependencies.py ensure-same-version
35+
36+
# Try to update the Pipfile.
37+
# Any new packages available are printed to stdout.
38+
# If nothing is printed, the Pipfile is up to date and workflow can stop.
39+
echo 'diff<<EOF' >> "$GITHUB_OUTPUT"
40+
bash check-dependencies.sh pipfiles/Pipfile${{matrix.python-version}}.max >> "$GITHUB_OUTPUT"
41+
echo EOF >> "$GITHUB_OUTPUT"
42+
cat pipfiles/Pipfile${{matrix.python-version}}.max
43+
44+
- name: Create the pull_request
45+
# Python3.8 must not update the dependencies.
46+
if: steps.ensure-dependencies-are-up-to-date.outputs.diff != '' and ${{matrix.python-version}} != '3.8'
47+
uses: peter-evans/create-pull-request@v5
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
commit-message: Update dependencies
51+
branch: dependencies/update-python${{matrix.python-version}}
52+
base: develop
53+
title: 'New dependencies available for Python${{matrix.python-version}}'
54+
body: |
55+
${{ steps.ensure-dependencies-are-up-to-date.outputs.diff }}
56+
draft: false
57+
add-paths: |
58+
tools/packages/pipfiles/Pipfile${{matrix.python-version}}.max
59+
tools/packages/taipy*/*requirements.txt

.github/workflows/overall-tests.yml

Lines changed: 20 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
matrix:
1919
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
2020
os: [ubuntu-latest, windows-latest, macos-latest]
21+
pipfile-version: ['min', 'max']
2122
runs-on: ${{ matrix.os }}
2223
steps:
2324
- uses: actions/checkout@v4
@@ -26,82 +27,48 @@ jobs:
2627
with:
2728
python-version: ${{matrix.python-version}}
2829

29-
- name: Install pipenv
30-
run: pip install --upgrade pipenv
31-
32-
- name: Install Setuptools and wheel
33-
run: pipenv run pip install --upgrade setuptools wheel
34-
35-
- name: Install Dependencies
36-
run: pipenv install --dev --python=${{ matrix.python-version }}
37-
38-
- name: Setup LibMagic (MacOS)
39-
if: matrix.os == 'macos-latest'
40-
run: brew install libmagic
30+
- name: Install dependencies
31+
id: install-dependencies
32+
uses: ./.github/actions/install
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
os: ${{ matrix.os }}
36+
pipfile-version: ${{ matrix.pipfile-version }}
4137

4238
- name: Pytest
4339
run: pipenv run pytest -m "not orchestrator_dispatcher and not standalone and not teste2e" --cov=taipy --cov-append --cov-report="xml:overall-coverage.xml" --cov-report term-missing tests
4440

4541
- name: Coverage
46-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
42+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' && matrix.pipfile-version == 'min'
4743
uses: MishaKav/pytest-coverage-comment@main
4844
with:
4945
pytest-xml-coverage-path: ./overall-coverage.xml
5046
title: Taipy Overall Coverage Report
5147

52-
submit_tests:
48+
intermittent-tests:
5349
needs: [partial-tests]
5450
timeout-minutes: 40
5551
strategy:
5652
fail-fast: false
5753
matrix:
5854
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
5955
os: [ubuntu-latest, windows-latest, macos-latest]
56+
orchestrator: ['orchestrator_dispatcher', 'standalone']
57+
pipfile-version: ['min', 'max']
6058
runs-on: ${{ matrix.os }}
6159
steps:
6260
- uses: actions/checkout@v4
6361
- uses: actions/setup-python@v5
6462
with:
6563
python-version: ${{matrix.python-version}}
6664

67-
- name: Install pipenv
68-
run: pip install --upgrade pipenv
69-
70-
- name: Install Dependencies
71-
run: pipenv install --dev --python=${{ matrix.python-version }}
72-
73-
- name: Setup LibMagic (MacOS)
74-
if: matrix.os == 'macos-latest'
75-
run: brew install libmagic
76-
77-
- name: Pytest Core orchestrator_dispatcher
78-
run: pipenv run pytest -m "orchestrator_dispatcher" tests/core
79-
80-
standalone_tests:
81-
needs: [partial-tests]
82-
timeout-minutes: 40
83-
strategy:
84-
fail-fast: false
85-
matrix:
86-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
87-
os: [ubuntu-latest, windows-latest, macos-latest]
88-
runs-on: ${{ matrix.os }}
89-
steps:
90-
- uses: actions/checkout@v4
91-
92-
- uses: actions/setup-python@v5
65+
- name: Install dependencies
66+
uses: ./.github/actions/install
9367
with:
94-
python-version: ${{matrix.python-version}}
95-
96-
- name: Install pipenv
97-
run: pip install --upgrade pipenv
68+
os: ${{ matrix.os }}
69+
install-gui: false
70+
python-version: ${{ matrix.python-version }}
71+
pipfile-version: ${{ matrix.pipfile-version }}
9872

99-
- name: Install Dependencies
100-
run: pipenv install --dev --python=${{ matrix.python-version }}
101-
102-
- name: Setup LibMagic (MacOS)
103-
if: matrix.os == 'macos-latest'
104-
run: brew install libmagic
105-
106-
- name: Pytest Core standalone
107-
run: pipenv run pytest -m "standalone" tests/core
73+
- name: Pytest Core orchestrator_dispatcher
74+
run: pipenv run pytest -m "${{ matrix.orchestrator }}" tests/core

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def get_requirements():
4545
# get requirements from the different setups in tools/packages (removing taipy packages)
4646
reqs = set()
4747
for pkg in (root_folder / "tools" / "packages").iterdir():
48-
reqs.update((pkg / "setup.requirements.txt").read_text("UTF-8").splitlines())
48+
requirements_file = pkg / "setup.requirements.txt"
49+
if requirements_file.exists():
50+
reqs.update(requirements_file.read_text("UTF-8").splitlines())
4951

5052
return [r for r in reqs if r and not r.startswith("taipy")]
5153

0 commit comments

Comments
 (0)