diff --git a/cookiecutter/v2/{{ cookiecutter.package_name }}/README.md b/cookiecutter/v2/{{ cookiecutter.package_name }}/README.md index 76d37c3d..f75f3555 100644 --- a/cookiecutter/v2/{{ cookiecutter.package_name }}/README.md +++ b/cookiecutter/v2/{{ cookiecutter.package_name }}/README.md @@ -39,9 +39,9 @@ To package this component for distribution: npm run build ``` -2. Build the Python wheel using UV (from the project root with `pyproject.toml`): +2. Build the Python wheel using UV (from the project root): ```sh - uv run --with build python -m build --wheel + uv build ``` This will create a `dist/` directory containing your wheel. The wheel includes the compiled frontend from `{{ cookiecutter.import_name }}/frontend/build`. diff --git a/cookiecutter/v2/{{ cookiecutter.package_name }}/pyproject.toml b/cookiecutter/v2/{{ cookiecutter.package_name }}/pyproject.toml index c81fc679..5c6dbc7d 100644 --- a/cookiecutter/v2/{{ cookiecutter.package_name }}/pyproject.toml +++ b/cookiecutter/v2/{{ cookiecutter.package_name }}/pyproject.toml @@ -9,8 +9,7 @@ description = "{{ cookiecutter.description }}" readme = "README.md" requires-python = ">=3.10" authors = [{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}" }] -# TODO: Restore this -# dependencies = ["streamlit >= 1.51"] +dependencies = ["streamlit >= 1.51"] [project.optional-dependencies] devel = [ @@ -33,7 +32,3 @@ include-package-data = true [tool.setuptools.package-data] {{ cookiecutter.import_name }} = ["frontend/build/**/*", "pyproject.toml"] - -[[tool.streamlit.component.components]] -name = "{{ cookiecutter.import_name }}" -asset_dir = "{{ cookiecutter.import_name }}/frontend/build" diff --git a/cookiecutter/v2/{{ cookiecutter.package_name }}/{{ cookiecutter.import_name }}/pyproject.toml b/cookiecutter/v2/{{ cookiecutter.package_name }}/{{ cookiecutter.import_name }}/pyproject.toml new file mode 100644 index 00000000..05a46996 --- /dev/null +++ b/cookiecutter/v2/{{ cookiecutter.package_name }}/{{ cookiecutter.import_name }}/pyproject.toml @@ -0,0 +1,8 @@ +# Ship a minimal metadata file that can be picked up by Streamlit at runtime. +[project] +name = "{{ cookiecutter.package_name }}" +version = "0.0.1" + +[[tool.streamlit.component.components]] +name = "{{ cookiecutter.import_name }}" +asset_dir = "frontend/build" diff --git a/templates/v2/template-reactless/README.md b/templates/v2/template-reactless/README.md index f60ab3dd..9b01b1a0 100644 --- a/templates/v2/template-reactless/README.md +++ b/templates/v2/template-reactless/README.md @@ -39,9 +39,9 @@ To package this component for distribution: npm run build ``` -2. Build the Python wheel using UV (from the project root with `pyproject.toml`): +2. Build the Python wheel using UV (from the project root): ```sh - uv run --with build python -m build --wheel + uv build ``` This will create a `dist/` directory containing your wheel. The wheel includes the compiled frontend from `my_component/frontend/build`. diff --git a/templates/v2/template-reactless/my_component/pyproject.toml b/templates/v2/template-reactless/my_component/pyproject.toml new file mode 100644 index 00000000..c1b6f2a0 --- /dev/null +++ b/templates/v2/template-reactless/my_component/pyproject.toml @@ -0,0 +1,8 @@ +# Ship a minimal metadata file that can be picked up by Streamlit at runtime. +[project] +name = "streamlit-custom-component" +version = "0.0.1" + +[[tool.streamlit.component.components]] +name = "my_component" +asset_dir = "frontend/build" diff --git a/templates/v2/template-reactless/pyproject.toml b/templates/v2/template-reactless/pyproject.toml index 22a48225..d935dc3b 100644 --- a/templates/v2/template-reactless/pyproject.toml +++ b/templates/v2/template-reactless/pyproject.toml @@ -9,8 +9,7 @@ description = "Streamlit component that allows you to do X" readme = "README.md" requires-python = ">=3.10" authors = [{ name = "John Smith", email = "john@example.com" }] -# TODO: Restore this -# dependencies = ["streamlit >= 1.51"] +dependencies = ["streamlit >= 1.51"] [project.optional-dependencies] devel = [ @@ -33,7 +32,3 @@ include-package-data = true [tool.setuptools.package-data] my_component = ["frontend/build/**/*", "pyproject.toml"] - -[[tool.streamlit.component.components]] -name = "my_component" -asset_dir = "my_component/frontend/build" diff --git a/templates/v2/template/README.md b/templates/v2/template/README.md index f60ab3dd..9b01b1a0 100644 --- a/templates/v2/template/README.md +++ b/templates/v2/template/README.md @@ -39,9 +39,9 @@ To package this component for distribution: npm run build ``` -2. Build the Python wheel using UV (from the project root with `pyproject.toml`): +2. Build the Python wheel using UV (from the project root): ```sh - uv run --with build python -m build --wheel + uv build ``` This will create a `dist/` directory containing your wheel. The wheel includes the compiled frontend from `my_component/frontend/build`. diff --git a/templates/v2/template/my_component/pyproject.toml b/templates/v2/template/my_component/pyproject.toml new file mode 100644 index 00000000..c1b6f2a0 --- /dev/null +++ b/templates/v2/template/my_component/pyproject.toml @@ -0,0 +1,8 @@ +# Ship a minimal metadata file that can be picked up by Streamlit at runtime. +[project] +name = "streamlit-custom-component" +version = "0.0.1" + +[[tool.streamlit.component.components]] +name = "my_component" +asset_dir = "frontend/build" diff --git a/templates/v2/template/pyproject.toml b/templates/v2/template/pyproject.toml index 22a48225..d935dc3b 100644 --- a/templates/v2/template/pyproject.toml +++ b/templates/v2/template/pyproject.toml @@ -9,8 +9,7 @@ description = "Streamlit component that allows you to do X" readme = "README.md" requires-python = ">=3.10" authors = [{ name = "John Smith", email = "john@example.com" }] -# TODO: Restore this -# dependencies = ["streamlit >= 1.51"] +dependencies = ["streamlit >= 1.51"] [project.optional-dependencies] devel = [ @@ -33,7 +32,3 @@ include-package-data = true [tool.setuptools.package-data] my_component = ["frontend/build/**/*", "pyproject.toml"] - -[[tool.streamlit.component.components]] -name = "my_component" -asset_dir = "my_component/frontend/build"