Skip to content

Commit 4cb7f8b

Browse files
Add scripts/check_min_deps.py to validate lower bounds (#6585)
* Add `scripts/check_min_deps.py` to validate lower bounds Ensures that pyright has equivalent results on lowest direct dependencies and latest direct dependencies. * Fix package lower bounds reflex: * httpx bump for `mounts` parameter typing * redis bump for set operation typing to allow bytes keys * reflex-base, reflex-components-radix bump for compiler changes * reflex-hosting-cli min version for reflex_cli_v2 reflex-base: * pydantic bump to align with reflex reflex-components-core: * python_multipart lower bound to get python_multipart.multipart * starlette lower bound to get UploadFiles and friends * typing_extensions lower bound to get Self reflex-components-radix: * reflex-base bump for compiler plugin changes reflex-docgen * pyyaml bump for python3.14 compat * min_deps.yml only tries oldest and latest supported python versions * support py3.10 for check_min_deps.py * Avoid KeyError on diagnostic["range"] Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 7281317 commit 4cb7f8b

10 files changed

Lines changed: 632 additions & 23 deletions

File tree

.github/workflows/min_deps.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: check-min-deps
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.id || github.sha }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: ["main"]
10+
paths-ignore:
11+
- "**/*.md"
12+
pull_request:
13+
branches: ["main"]
14+
paths-ignore:
15+
- "**/*.md"
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
defaults:
22+
run:
23+
shell: bash
24+
25+
jobs:
26+
# Single-source the list of checkable packages from the script so the matrix
27+
# below stays in sync as packages are added or removed.
28+
discover:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
packages: ${{ steps.list.outputs.packages }}
32+
steps:
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
persist-credentials: false
36+
- uses: ./.github/actions/setup_build_env
37+
with:
38+
python-version: "3.14"
39+
- id: list
40+
run: echo "packages=$(uv run --no-project python scripts/check_min_deps.py --list)" >> "$GITHUB_OUTPUT"
41+
42+
check:
43+
needs: discover
44+
timeout-minutes: 30
45+
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
package: ${{ fromJSON(needs.discover.outputs.packages) }}
50+
python-version: ["3.10", "3.14"]
51+
steps:
52+
# fetch-tags/fetch-depth are required: each package is built editable via
53+
# uv-dynamic-versioning, which derives the version from git tags/history.
54+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55+
with:
56+
fetch-tags: true
57+
fetch-depth: 0
58+
persist-credentials: false
59+
- uses: ./.github/actions/setup_build_env
60+
with:
61+
python-version: ${{ matrix.python-version }}
62+
run-uv-sync: true
63+
- name: Check minimum declared dependency versions
64+
run: uv run --no-sync python scripts/check_min_deps.py --python "${{ matrix.python-version }}" "${{ matrix.package }}"

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ uv run pytest tests/integration # integration t
1919
uv run ruff check . # lint
2020
uv run ruff format . # format
2121
uv run pyright reflex tests # type check
22+
uv run python scripts/check_min_deps.py # validate each package's declared minimum dep versions (pyright in isolated min-version envs)
2223
uv run python scripts/make_pyi.py # regenerate .pyi stubs
2324
uv run pre-commit run --all-files # all pre-commit hooks
2425
```

packages/reflex-base/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maintainers = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
99
requires-python = ">=3.10"
1010
dependencies = [
1111
"packaging >=24.2,<27",
12-
"pydantic >=1.10.21,<3.0",
12+
"pydantic >=2.12.0,<3.0",
1313
"rich >=13,<15",
1414
"typing_extensions >=4.13.0",
1515
"platformdirs >=4.3.7,<5.0",

packages/reflex-components-core/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ dependencies = [
1111
"reflex-base >= 0.9.2",
1212
"reflex-components-lucide >= 0.9.0",
1313
"reflex-components-sonner >= 0.9.0",
14-
"python_multipart",
15-
"starlette",
16-
"typing_extensions",
14+
"python_multipart >= 0.0.21",
15+
"starlette >= 0.47.0",
16+
"typing_extensions >= 4.0.0",
1717
]
1818

1919
[tool.hatch.version]

packages/reflex-components-radix/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
88
maintainers = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
99
requires-python = ">=3.10"
1010
dependencies = [
11-
"reflex-base >= 0.9.0",
11+
"reflex-base >= 0.9.2",
1212
"reflex-components-core >= 0.9.0",
1313
"reflex-components-lucide >= 0.9.0",
1414
]

packages/reflex-docgen/pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ authors = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
88
maintainers = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
99
requires-python = ">=3.10"
1010
dependencies = [
11-
"griffelib>=2.0.1",
12-
"mistletoe>=1.4.0",
13-
"pyyaml>=6.0",
11+
"griffelib >= 2.0.1",
12+
"mistletoe >= 1.4.0",
13+
"pyyaml >= 6.0.3",
1414
"reflex >= 0.9.0",
15-
"typing-extensions",
1615
"typing-inspection>=0.4.2",
1716
]
1817

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ requires-python = ">=3.10,<4.0"
2222
dependencies = [
2323
"click >=8.2",
2424
"granian[reload] >=2.5.5",
25-
"httpx >=0.23.3,<1.0",
25+
"httpx >=0.26,<1.0",
2626
"packaging >=24.2,<27",
2727
"psutil >=7.0.0,<8.0; sys_platform == 'win32'",
2828
"python-multipart >=0.0.20,<1.0",
2929
"python-socketio >=5.12.0,<6.0",
30-
"redis >=5.2.1,<8.0",
31-
"reflex-hosting-cli",
30+
"redis >=6.4,<8.0",
3231
"rich >=13,<16",
3332
"starlette >=0.47.0",
3433
"typing_extensions >=4.13.0",
3534
"wrapt >=1.17.0,<3.0",
36-
"reflex-base >= 0.9.0",
35+
"reflex-base >= 0.9.3",
3736
"reflex-components-code >= 0.9.0",
3837
"reflex-components-core >= 0.9.0",
3938
"reflex-components-dataeditor >= 0.9.0",
@@ -42,10 +41,11 @@ dependencies = [
4241
"reflex-components-markdown >= 0.9.0",
4342
"reflex-components-moment >= 0.9.0",
4443
"reflex-components-plotly >= 0.9.0",
45-
"reflex-components-radix >= 0.9.0",
44+
"reflex-components-radix >= 0.9.2",
4645
"reflex-components-react-player >= 0.9.0",
4746
"reflex-components-recharts >= 0.9.0",
4847
"reflex-components-sonner >= 0.9.0",
48+
"reflex-hosting-cli >= 0.1.66",
4949
]
5050

5151
classifiers = [
@@ -250,6 +250,7 @@ preview = true
250250
"*/.templates/apps/blank/code/*" = ["INP001"]
251251
"*/blank.py" = ["I001"]
252252
"docs/package/scripts/*.py" = ["INP001"]
253+
"scripts/check_min_deps.py" = ["T201"]
253254

254255
[tool.pytest.ini_options]
255256
filterwarnings = "ignore:fields may not start with an underscore:RuntimeWarning"

0 commit comments

Comments
 (0)