forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 2.22 KB
/
python-min-deps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Python Minimum Dependency Versions
on:
push:
branches:
- "develop"
pull_request:
types: [opened, synchronize, reopened]
# Allows workflow to be called from other workflows
workflow_call:
inputs:
ref:
required: true
type: string
# Avoid duplicate workflows on same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-python-min
cancel-in-progress: true
defaults:
run:
shell: bash
env:
FORCE_COLOR: "1"
jobs:
py-min-deps-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
PYTHON_VERSION: "${{needs.build_info.outputs.PYTHON_MIN_VERSION}}"
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Set Python version vars
uses: ./.github/actions/build_info
- name: Set up Python ${{ env.PYTHON_MIN_VERSION }}
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_MIN_VERSION }}"
- name: Setup virtual env
uses: ./.github/actions/make_init
with:
use_cached_venv: false
- name: Install min dependencies (force reinstall)
run: uv pip install -r lib/min-constraints-gen.txt --force-reinstall
- name: Generate Protobufs
run: make protobuf
- name: Make local modules visible
run: uv pip install --editable ./lib --no-deps
- name: Run Python Tests
run: make pytest
- name: CLI Smoke Tests
run: make cli-smoke-tests
- name: Validate min-constraints-gen
run: |
make gen-min-dep-constraints
git_status=$(git status --porcelain -- lib/min-constraints-gen.txt)
if [[ -n $git_status ]]; then
echo "::error::The min constraints file is out of date! Please run \`make gen-min-dep-constraints\` and commit the result."
echo "::group::git diff lib/min-constraints-gen.txt"
git diff lib/min-constraints-gen.txt
echo "::endgroup::"
exit 1
else
echo "min constraints file is up to date."
fi