Skip to content

Commit ebda17f

Browse files
[fix] Fixup metadata (#118)
* [fix] Fixup metadata * Add comment
1 parent b778e18 commit ebda17f

9 files changed

Lines changed: 33 additions & 24 deletions

File tree

cookiecutter/v2/{{ cookiecutter.package_name }}/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ To package this component for distribution:
3939
npm run build
4040
```
4141

42-
2. Build the Python wheel using UV (from the project root with `pyproject.toml`):
42+
2. Build the Python wheel using UV (from the project root):
4343
```sh
44-
uv run --with build python -m build --wheel
44+
uv build
4545
```
4646

4747
This will create a `dist/` directory containing your wheel. The wheel includes the compiled frontend from `{{ cookiecutter.import_name }}/frontend/build`.

cookiecutter/v2/{{ cookiecutter.package_name }}/pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ description = "{{ cookiecutter.description }}"
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
authors = [{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}" }]
12-
# TODO: Restore this
13-
# dependencies = ["streamlit >= 1.51"]
12+
dependencies = ["streamlit >= 1.51"]
1413

1514
[project.optional-dependencies]
1615
devel = [
@@ -33,7 +32,3 @@ include-package-data = true
3332

3433
[tool.setuptools.package-data]
3534
{{ cookiecutter.import_name }} = ["frontend/build/**/*", "pyproject.toml"]
36-
37-
[[tool.streamlit.component.components]]
38-
name = "{{ cookiecutter.import_name }}"
39-
asset_dir = "{{ cookiecutter.import_name }}/frontend/build"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ship a minimal metadata file that can be picked up by Streamlit at runtime.
2+
[project]
3+
name = "{{ cookiecutter.package_name }}"
4+
version = "0.0.1"
5+
6+
[[tool.streamlit.component.components]]
7+
name = "{{ cookiecutter.import_name }}"
8+
asset_dir = "frontend/build"

templates/v2/template-reactless/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ To package this component for distribution:
3939
npm run build
4040
```
4141

42-
2. Build the Python wheel using UV (from the project root with `pyproject.toml`):
42+
2. Build the Python wheel using UV (from the project root):
4343
```sh
44-
uv run --with build python -m build --wheel
44+
uv build
4545
```
4646

4747
This will create a `dist/` directory containing your wheel. The wheel includes the compiled frontend from `my_component/frontend/build`.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ship a minimal metadata file that can be picked up by Streamlit at runtime.
2+
[project]
3+
name = "streamlit-custom-component"
4+
version = "0.0.1"
5+
6+
[[tool.streamlit.component.components]]
7+
name = "my_component"
8+
asset_dir = "frontend/build"

templates/v2/template-reactless/pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ description = "Streamlit component that allows you to do X"
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
authors = [{ name = "John Smith", email = "john@example.com" }]
12-
# TODO: Restore this
13-
# dependencies = ["streamlit >= 1.51"]
12+
dependencies = ["streamlit >= 1.51"]
1413

1514
[project.optional-dependencies]
1615
devel = [
@@ -33,7 +32,3 @@ include-package-data = true
3332

3433
[tool.setuptools.package-data]
3534
my_component = ["frontend/build/**/*", "pyproject.toml"]
36-
37-
[[tool.streamlit.component.components]]
38-
name = "my_component"
39-
asset_dir = "my_component/frontend/build"

templates/v2/template/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ To package this component for distribution:
3939
npm run build
4040
```
4141

42-
2. Build the Python wheel using UV (from the project root with `pyproject.toml`):
42+
2. Build the Python wheel using UV (from the project root):
4343
```sh
44-
uv run --with build python -m build --wheel
44+
uv build
4545
```
4646

4747
This will create a `dist/` directory containing your wheel. The wheel includes the compiled frontend from `my_component/frontend/build`.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ship a minimal metadata file that can be picked up by Streamlit at runtime.
2+
[project]
3+
name = "streamlit-custom-component"
4+
version = "0.0.1"
5+
6+
[[tool.streamlit.component.components]]
7+
name = "my_component"
8+
asset_dir = "frontend/build"

templates/v2/template/pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ description = "Streamlit component that allows you to do X"
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
authors = [{ name = "John Smith", email = "john@example.com" }]
12-
# TODO: Restore this
13-
# dependencies = ["streamlit >= 1.51"]
12+
dependencies = ["streamlit >= 1.51"]
1413

1514
[project.optional-dependencies]
1615
devel = [
@@ -33,7 +32,3 @@ include-package-data = true
3332

3433
[tool.setuptools.package-data]
3534
my_component = ["frontend/build/**/*", "pyproject.toml"]
36-
37-
[[tool.streamlit.component.components]]
38-
name = "my_component"
39-
asset_dir = "my_component/frontend/build"

0 commit comments

Comments
 (0)