Welcome to Streamlit component template! We appreciate your interest in contributing to our project.
Run command:
$ curl https://pyenv.run | bash
$ pyenv install <python_version>
- python_version - version of python. To check all available versions (recommended 3.11.4) use:
$ pyenv install --list
$ pyenv virtualenv <python_version> <environment_name>
- python_version - version of python
- environment_name - your custom name of pyenv environment
$ pyenv activate <environment_name>
- environment_name - your previously chosen pyenv environment name
To configure your Python SDK in your project, follow these steps:
- Open "File" menu.
- Navigate to "Project Structure".
- Under "Project," locate "Edit (SDK)".
- Click on "Add Python SDK" (using the plus button).
- Select "Virtualenv Environment".
- Choose "Existing environment".
- Specify the path to your Python environment using <your_pyenv_location>.
$ ./dev.py all-npm-install
$ ./dev.py all-npm-build
$ ./dev.py all-python-build-package
For development we need to set _RELEASE flag. Open init.py file for any example or template and set _RELEASE flag to true. Remember to set this flag back to false if you want to create PR.
Go to directory of example or template and run pip install -e .
.
Example:
$ cd examples/CustomDataframe
$ pip install -e .
Example for CustomDataframe
Run python script:
$ streamlit run examples/CustomDataframe/custom_dataframe/example.py
Run frontend:
$ cd examples/CustomDataframe/custom_dataframe/frontend
$ npm run start
Please check "Run Locally example" section.
Example for CustomDataframe:
$ pytest examples/CustomDataframe/e2e
Run following commands:
$ ./dev.py e2e-build-images
$ ./dev.py e2e-run-tests
Template and template-reactless share the same component name. We can only have one component installed. To switch between them, we need to uninstall one and install another. To do that:
Run:
$ pip freeze
and find installed package. Copy egg name of this component.
$ pip uninstall <egg_name>
- egg_name - name of package name, by default it is:
streamlit_custom_component
Run:
$ pip install -e .
inside template directory.