Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions cookiecutter/v2/{{ cookiecutter.package_name }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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"
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions templates/v2/template-reactless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
8 changes: 8 additions & 0 deletions templates/v2/template-reactless/my_component/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 1 addition & 6 deletions templates/v2/template-reactless/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" }]
# TODO: Restore this
# dependencies = ["streamlit >= 1.51"]
dependencies = ["streamlit >= 1.51"]

[project.optional-dependencies]
devel = [
Expand All @@ -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"
4 changes: 2 additions & 2 deletions templates/v2/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
8 changes: 8 additions & 0 deletions templates/v2/template/my_component/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 1 addition & 6 deletions templates/v2/template/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" }]
# TODO: Restore this
# dependencies = ["streamlit >= 1.51"]
dependencies = ["streamlit >= 1.51"]

[project.optional-dependencies]
devel = [
Expand All @@ -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"