Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflow to check dependencies on release branch #4050

Merged
merged 37 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8db5faf
add workflow to check dependencies on release branch
Lendemor Oct 3, 2024
cbd0a18
rename action to follow convention of other actions
Lendemor Oct 3, 2024
9603a90
update workflow
Lendemor Oct 3, 2024
08baba5
bump poetry version
Lendemor Oct 3, 2024
ba58483
relock deps
Lendemor Oct 3, 2024
386fbc3
update check to ignore pyright and ruff
Lendemor Oct 3, 2024
9d47fa6
oops, you saw nothing
Lendemor Oct 3, 2024
c0a8a32
split dep check in two job
Lendemor Oct 3, 2024
4fe5d00
fix frontend dep check
Lendemor Oct 3, 2024
2fce6e2
fix stuff
Lendemor Oct 3, 2024
4f8dede
hmm yeah
Lendemor Oct 3, 2024
d3ef53f
nope nope nope
Lendemor Oct 3, 2024
1089074
sigh
Lendemor Oct 3, 2024
b7c5dc9
Merge branch 'main' into release/test_check_dep
Lendemor Oct 4, 2024
4a32c5a
bump js versions for some packages
Lendemor Oct 4, 2024
54ab0e2
fix some warnings in tests
Lendemor Oct 4, 2024
2425dd8
fix tests
Lendemor Oct 4, 2024
398ce13
try some options
Lendemor Oct 4, 2024
f200ab7
try to set asyncio policy
Lendemor Oct 4, 2024
2892d78
debug dep check
Lendemor Oct 4, 2024
8c11b2d
fix attempt for backend dep
Lendemor Oct 4, 2024
31976ef
clean up output for backend check
Lendemor Oct 4, 2024
89d6315
run bun outdated on reflex-web to catch most of the packages
Lendemor Oct 4, 2024
57e8a8b
fix python version
Lendemor Oct 4, 2024
20ba460
fix python version
Lendemor Oct 4, 2024
3251609
add missing env
Lendemor Oct 4, 2024
62f236f
fix bun command
Lendemor Oct 4, 2024
2d1c588
fix workdir of frontend check
Lendemor Oct 4, 2024
427f6db
update packages version
Lendemor Oct 4, 2024
5ebb95b
up-pin plotly.js version
Lendemor Oct 4, 2024
0ebad79
add debug ouput
Lendemor Oct 5, 2024
4e7b266
clean frontend dep check output
Lendemor Oct 5, 2024
208c591
fix output
Lendemor Oct 5, 2024
1b73899
fix async tests for redis
Lendemor Oct 7, 2024
9c8b715
relock poetry.lock
Lendemor Oct 7, 2024
4919191
Non-async functions do not need pytest_asyncio.fixture
masenf Oct 7, 2024
ebd2e69
test_state: close StateManagerRedis connection in test to avoid warning
masenf Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup_build_env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inputs:
poetry-version:
description: 'Poetry version to install'
required: false
default: '1.3.1'
default: '1.8.3'
run-poetry-install:
description: 'Whether to run poetry install on current dir'
required: false
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/check_outdated_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: check-outdated-dependencies

on:
push: # This will trigger the action when a pull request is opened or updated.
branches:
- 'release/**' # This will trigger the action when any branch starting with "release/" is created.
workflow_dispatch: # Allow manual triggering if needed.

jobs:
backend:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- uses: ./.github/actions/setup_build_env
with:
python-version: '3.9'
run-poetry-install: true
create-venv-at-path: .venv

- name: Check outdated backend dependencies
run: |
outdated=$(poetry show -oT)
echo "Outdated:"
echo "$outdated"

filtered_outdated=$(echo "$outdated" | grep -vE 'pyright|ruff' || true)

if [ ! -z "$filtered_outdated" ]; then
echo "Outdated dependencies found:"
echo "$filtered_outdated"
exit 1
else
echo "All dependencies are up to date. (pyright and ruff are ignored)"
fi


frontend:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: '3.10.11'
run-poetry-install: true
create-venv-at-path: .venv
- name: Clone Reflex Website Repo
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-web
ref: main
path: reflex-web
- name: Install Requirements for reflex-web
working-directory: ./reflex-web
run: poetry run uv pip install -r requirements.txt
- name: Install additional dependencies for DB access
run: poetry run uv pip install psycopg2-binary
- name: Init Website for reflex-web
working-directory: ./reflex-web
run: poetry run reflex init
- name: Run Website and Check for errors
run: |
poetry run bash scripts/integration.sh ./reflex-web dev
- name: Check outdated frontend dependencies
working-directory: ./reflex-web/.web
run: |
raw_outdated=$(/home/runner/.local/share/reflex/bun/bin/bun outdated)
outdated=$(echo "$raw_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\|' || true)
echo "Outdated:"
echo "$outdated"

# Ignore 3rd party dependencies that are not updated.
filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion' || true)
no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true)


if [ ! -z "$no_extra" ]; then
echo "Outdated dependencies found:"
echo "$filtered_outdated"
exit 1
else
echo "All dependencies are up to date. (3rd party packages are ignored)"
fi

185 changes: 95 additions & 90 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ reflex-hosting-cli = ">=0.1.2,<2.0"
charset-normalizer = ">=3.3.2,<4.0"
wheel = ">=0.42.0,<1.0"
build = ">=1.0.3,<2.0"
setuptools = ">=69.1.1,<70.2"
setuptools = ">=75.0"
httpx = ">=0.25.1,<1.0"
twine = ">=4.0.0,<6.0"
tomlkit = ">=0.12.4,<1.0"
lazy_loader = ">=0.4"
reflex-chakra = ">=0.6.0"

[tool.poetry.group.dev.dependencies]
pytest = ">=7.1.2,<8.0"
pytest = ">=7.1.2,<9.0"
pytest-mock = ">=3.10.0,<4.0"
pyright = ">=1.1.229,<1.1.335"
darglint = ">=1.8.1,<2.0"
toml = ">=0.10.2,<1.0"
pytest-asyncio = ">=0.20.1,<0.22.0" # https://github.com/pytest-dev/pytest-asyncio/issues/706
pytest-cov = ">=4.0.0,<5.0"
pytest-asyncio = ">=0.24.0"
pytest-cov = ">=4.0.0,<6.0"
ruff = "^0.4.9"
pandas = ">=2.1.1,<3.0"
pillow = ">=10.0.0,<11.0"
Expand Down Expand Up @@ -100,3 +100,7 @@ lint.pydocstyle.convention = "google"
"reflex/.templates/*.py" = ["D100", "D103", "D104"]
"*.pyi" = ["D301", "D415", "D417", "D418", "E742"]
"*/blank.py" = ["I001"]

[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
2 changes: 1 addition & 1 deletion reflex/components/core/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class UploadFilesProvider(Component):
class Upload(MemoizationLeaf):
"""A file upload component."""

library = "react-dropzone@14.2.3"
library = "react-dropzone@14.2.9"

tag = "ReactDropzone"

Expand Down
4 changes: 2 additions & 2 deletions reflex/components/datadisplay/dataeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ class DataEditor(NoSSRComponent):

tag = "DataEditor"
is_default = True
library: str = "@glideapps/glide-data-grid@^5.3.0"
library: str = "@glideapps/glide-data-grid@^6.0.3"
lib_dependencies: List[str] = [
"lodash@^4.17.21",
"marked@^4.0.10",
"marked@^14.1.2",
"react-responsive-carousel@^3.2.7",
]

Expand Down
4 changes: 2 additions & 2 deletions reflex/components/gridjs/datatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
class Gridjs(Component):
"""A component that wraps a nivo bar component."""

library = "gridjs-react@6.0.1"
library = "gridjs-react@6.1.1"

lib_dependencies: List[str] = ["gridjs@6.0.6"]
lib_dependencies: List[str] = ["gridjs@6.2.0"]


class DataTable(Gridjs):
Expand Down
10 changes: 5 additions & 5 deletions reflex/components/markdown/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_base_component_map() -> dict[str, Callable]:
class Markdown(Component):
"""A markdown component."""

library = "react-markdown@8.0.7"
library = "react-markdown@9.0.1"

tag = "ReactMarkdown"

Expand Down Expand Up @@ -157,19 +157,19 @@ def add_imports(self) -> ImportDict | list[ImportDict]:
return [
{
"": "katex/dist/katex.min.css",
"remark-math@5.1.1": ImportVar(
"remark-math@6.0.0": ImportVar(
tag=_REMARK_MATH._js_expr, is_default=True
),
"remark-gfm@3.0.1": ImportVar(
"remark-gfm@4.0.0": ImportVar(
tag=_REMARK_GFM._js_expr, is_default=True
),
"remark-unwrap-images@4.0.0": ImportVar(
tag=_REMARK_UNWRAP_IMAGES._js_expr, is_default=True
),
"rehype-katex@6.0.3": ImportVar(
"rehype-katex@7.0.1": ImportVar(
tag=_REHYPE_KATEX._js_expr, is_default=True
),
"rehype-raw@6.1.1": ImportVar(
"rehype-raw@7.0.0": ImportVar(
tag=_REHYPE_RAW._js_expr, is_default=True
),
},
Expand Down
2 changes: 1 addition & 1 deletion reflex/components/plotly/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Plotly(NoSSRComponent):

library = "react-plotly.js@2.6.0"

lib_dependencies: List[str] = ["plotly.js@2.22.0"]
lib_dependencies: List[str] = ["plotly.js@2.35.2"]

tag = "Plot"

Expand Down
2 changes: 1 addition & 1 deletion reflex/components/radix/primitives/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class FormComponent(RadixPrimitiveComponentWithClassName):
"""Base class for all @radix-ui/react-form components."""

library = "@radix-ui/react-form@^0.0.3"
library = "@radix-ui/react-form@^0.1.0"


class FormRoot(FormComponent, HTMLForm):
Expand Down
2 changes: 1 addition & 1 deletion reflex/components/react_player/react_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ReactPlayer(NoSSRComponent):
reference: https://github.com/cookpete/react-player.
"""

library = "react-player@2.12.0"
library = "react-player@2.16.0"

tag = "ReactPlayer"

Expand Down
2 changes: 1 addition & 1 deletion reflex/components/sonner/toast.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Config:
class Toaster(Component):
"""A Toaster Component for displaying toast notifications."""

library: str = "sonner@1.4.41"
library: str = "sonner@1.5.0"

tag = "Toaster"

Expand Down
28 changes: 14 additions & 14 deletions reflex/constants/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Bun(SimpleNamespace):
"""Bun constants."""

# The Bun version.
VERSION = "1.1.10"
VERSION = "1.1.29"
# Min Bun Version
MIN_VERSION = "0.7.0"
# The directory to store the bun.
Expand Down Expand Up @@ -116,21 +116,21 @@ class Commands(SimpleNamespace):
PATH = "package.json"

DEPENDENCIES = {
"@babel/standalone": "7.25.3",
"@emotion/react": "11.11.1",
"axios": "1.6.0",
"@babel/standalone": "7.25.7",
"@emotion/react": "11.13.3",
"axios": "1.7.7",
"json5": "2.2.3",
"next": "14.2.13",
"next-sitemap": "4.1.8",
"next-themes": "0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-focus-lock": "2.11.3",
"socket.io-client": "4.6.1",
"universal-cookie": "4.0.4",
"next": "14.2.14",
"next-sitemap": "4.2.3",
"next-themes": "0.3.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-focus-lock": "2.13.2",
"socket.io-client": "4.8.0",
"universal-cookie": "7.2.0",
}
DEV_DEPENDENCIES = {
"autoprefixer": "10.4.14",
"postcss": "8.4.31",
"autoprefixer": "10.4.20",
"postcss": "8.4.47",
"postcss-import": "16.1.0",
}
2 changes: 1 addition & 1 deletion reflex/constants/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Tailwind(SimpleNamespace):
"""Tailwind constants."""

# The Tailwindcss version
VERSION = "tailwindcss@3.3.2"
VERSION = "tailwindcss@3.4.13"
# The Tailwind config.
CONFIG = "tailwind.config.js"
# Default Tailwind content paths
Expand Down
4 changes: 2 additions & 2 deletions tests/units/components/core/test_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from reflex.components.base.fragment import Fragment
from reflex.components.core.cond import Cond, cond
from reflex.components.radix.themes.typography.text import Text
from reflex.state import BaseState, State
from reflex.state import BaseState
from reflex.utils.format import format_state_name
from reflex.vars.base import LiteralVar, Var, computed_var

Expand Down Expand Up @@ -124,7 +124,7 @@ def test_cond_no_else():
def test_cond_computed_var():
"""Test if cond works with computed vars."""

class CondStateComputed(State):
class CondStateComputed(BaseState):
@computed_var
def computed_int(self) -> int:
return 0
Expand Down
4 changes: 2 additions & 2 deletions tests/units/components/core/test_foreach.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ForEachState(BaseState):
color_index_tuple: Tuple[int, str] = (0, "red")


class TestComponentState(ComponentState):
class ComponentStateTest(ComponentState):
"""A test component state."""

foo: bool
Expand Down Expand Up @@ -288,5 +288,5 @@ def test_foreach_component_state():
with pytest.raises(TypeError):
Foreach.create(
ForEachState.colors_list,
TestComponentState.create,
ComponentStateTest.create,
)
14 changes: 7 additions & 7 deletions tests/units/components/core/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from reflex.vars.base import LiteralVar, Var


class TestUploadState(State):
class UploadStateTest(State):
"""Test upload state."""

def drop_handler(self, files):
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_upload_create():

up_comp_2 = Upload.create(
id="foo_id",
on_drop=TestUploadState.drop_handler([]), # type: ignore
on_drop=UploadStateTest.drop_handler([]), # type: ignore
)
assert isinstance(up_comp_2, Upload)
assert up_comp_2.is_used
Expand All @@ -65,7 +65,7 @@ def test_upload_create():

up_comp_3 = Upload.create(
id="foo_id",
on_drop=TestUploadState.drop_handler,
on_drop=UploadStateTest.drop_handler,
)
assert isinstance(up_comp_3, Upload)
assert up_comp_3.is_used
Expand All @@ -75,7 +75,7 @@ def test_upload_create():

up_comp_4 = Upload.create(
id="foo_id",
on_drop=TestUploadState.not_drop_handler([]), # type: ignore
on_drop=UploadStateTest.not_drop_handler([]), # type: ignore
)
assert isinstance(up_comp_4, Upload)
assert up_comp_4.is_used
Expand All @@ -91,7 +91,7 @@ def test_styled_upload_create():

styled_up_comp_2 = StyledUpload.create(
id="foo_id",
on_drop=TestUploadState.drop_handler([]), # type: ignore
on_drop=UploadStateTest.drop_handler([]), # type: ignore
)
assert isinstance(styled_up_comp_2, StyledUpload)
assert styled_up_comp_2.is_used
Expand All @@ -101,7 +101,7 @@ def test_styled_upload_create():

styled_up_comp_3 = StyledUpload.create(
id="foo_id",
on_drop=TestUploadState.drop_handler,
on_drop=UploadStateTest.drop_handler,
)
assert isinstance(styled_up_comp_3, StyledUpload)
assert styled_up_comp_3.is_used
Expand All @@ -111,7 +111,7 @@ def test_styled_upload_create():

styled_up_comp_4 = StyledUpload.create(
id="foo_id",
on_drop=TestUploadState.not_drop_handler([]), # type: ignore
on_drop=UploadStateTest.not_drop_handler([]), # type: ignore
)
assert isinstance(styled_up_comp_4, StyledUpload)
assert styled_up_comp_4.is_used
Expand Down
File renamed without changes.
Loading
Loading