diff --git a/.github/actions/build_component_wheels/action.yaml b/.github/actions/build_component_wheels/action.yaml index 0c235c27..3ce3b7b0 100644 --- a/.github/actions/build_component_wheels/action.yaml +++ b/.github/actions/build_component_wheels/action.yaml @@ -16,6 +16,11 @@ outputs: runs: using: 'composite' steps: + - name: Install build backend for PEP 517 + working-directory: ${{ github.action_path }}/../../../ + shell: bash + run: pip install build + - name: Link develop version of streamlit-component-lib if: inputs.custom_streamlit_component_lib_file != '' working-directory: ${{ github.action_path }}/../../../ @@ -23,10 +28,9 @@ runs: env: STREAMLIT_COMPONENT_LIB_FILE: ${{ inputs.custom_streamlit_component_lib_file }} run: | - find examples template template-reactless -name frontend -maxdepth 3 | while IFS= read -r line; do + find examples templates -maxdepth 5 -type d -name frontend -print0 | while IFS= read -r -d '' line; do ( - cd "${line}"; - npm install "${STREAMLIT_COMPONENT_LIB_FILE}" + cd "${line}" && npm install "${STREAMLIT_COMPONENT_LIB_FILE}" ) done @@ -44,8 +48,7 @@ runs: working-directory: ${{ github.action_path }}/../../../ shell: bash run: | - find examples template template-reactless -maxdepth 3 -name '__init__.py' |\ - xargs -n 1 sed -i 's/_RELEASE = False/_RELEASE = True/'; + grep -Rl "_RELEASE = False" examples templates | xargs -r sed -i 's/_RELEASE = False/_RELEASE = True/'; ./dev.py all-python-build-package - name: Set outputs diff --git a/.github/replay-files/template-reactless.json b/.github/replay-files/v1/template-reactless.json similarity index 100% rename from .github/replay-files/template-reactless.json rename to .github/replay-files/v1/template-reactless.json diff --git a/.github/replay-files/template.json b/.github/replay-files/v1/template.json similarity index 100% rename from .github/replay-files/template.json rename to .github/replay-files/v1/template.json diff --git a/.github/replay-files/v2/template.json b/.github/replay-files/v2/template.json new file mode 100644 index 00000000..b51faa9a --- /dev/null +++ b/.github/replay-files/v2/template.json @@ -0,0 +1,12 @@ +{ + "cookiecutter": { + "author_name": "John Smith", + "author_email": "john@example.com", + "project_name": "Streamlit Component X", + "package_name": "streamlit-custom-component", + "import_name": "my_component", + "description": "Streamlit component that allows you to do X", + "open_source_license": "MIT license", + "framework": "React + Typescript" + } +} diff --git a/dev.py b/dev.py index 66938978..f61410aa 100755 --- a/dev.py +++ b/dev.py @@ -339,7 +339,11 @@ class CookiecutterVariant(typing.NamedTuple): COOKIECUTTER_VARIANTS = [ CookiecutterVariant( - replay_file=THIS_DIRECTORY / ".github" / "replay-files" / "template.json", + replay_file=THIS_DIRECTORY + / ".github" + / "replay-files" + / "v1" + / "template.json", repo_directory=THIS_DIRECTORY / "templates" / "v1" / "template", cookiecutter_dir=THIS_DIRECTORY / "cookiecutter" / "v1", ), @@ -347,6 +351,7 @@ class CookiecutterVariant(typing.NamedTuple): replay_file=THIS_DIRECTORY / ".github" / "replay-files" + / "v1" / "template-reactless.json", repo_directory=THIS_DIRECTORY / "templates" / "v1" / "template-reactless", cookiecutter_dir=THIS_DIRECTORY / "cookiecutter" / "v1",