From 456672149b781ad42ce046561f3e2a9a860efd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Fri, 20 Sep 2024 04:08:23 +0200 Subject: [PATCH] use current version as default for new custom components (#3957) --- .../.templates/jinja/custom_components/pyproject.toml.jinja2 | 2 +- reflex/custom_components/custom_components.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 index e70a835a5..1bc1d53c3 100644 --- a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +++ b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 @@ -12,7 +12,7 @@ requires-python = ">=3.8" authors = [{ name = "", email = "YOUREMAIL@domain.com" }] keywords = ["reflex","reflex-custom-components"] -dependencies = ["reflex>=0.4.2"] +dependencies = ["reflex>={{ reflex_version }}"] classifiers = ["Development Status :: 4 - Beta"] diff --git a/reflex/custom_components/custom_components.py b/reflex/custom_components/custom_components.py index a47de6feb..e6957f8fd 100644 --- a/reflex/custom_components/custom_components.py +++ b/reflex/custom_components/custom_components.py @@ -65,7 +65,9 @@ def _create_package_config(module_name: str, package_name: str): with open(CustomComponents.PYPROJECT_TOML, "w") as f: f.write( templates.CUSTOM_COMPONENTS_PYPROJECT_TOML.render( - module_name=module_name, package_name=package_name + module_name=module_name, + package_name=package_name, + reflex_version=constants.Reflex.VERSION, ) )