-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
All of the necessary commands to get the project running are in the | ||
[Taskfile](https://taskfile.dev/). | ||
|
||
### Linting and formatting | ||
|
||
We use [Ruff](https://github.com/astral-sh/ruff) for linting and formatting. | ||
|
||
To run ruff, you can use the following command: | ||
|
||
```bash | ||
task lint | ||
``` | ||
|
||
### Running tests | ||
|
||
To run the tests, you can use the following command: | ||
|
||
```bash | ||
task test | ||
``` | ||
|
||
### Adding tests | ||
|
||
If you add a new feature, or fix a bug, please add a test to ensure that the feature works as expected. | ||
|
||
The pattern for creating tests is to use the example streamlit app, and use | ||
[playwright](https://playwright.dev/python/docs/intro) to create and | ||
run tests on the app. | ||
|
||
These tests are primarily located in the `tests/frontend.py` file. | ||
|
||
If you are making a change that only affects the python code, you can | ||
run the playwright [codegen](https://playwright.dev/python/docs/codegen) tool to | ||
help generate the tests by running `task generate-tests`. | ||
|
||
If you are making a change that affects the javascript code, you need to set up | ||
folium to use your local frontend code. This can be done by: | ||
|
||
1. Edit `streamlit_folium/__init__.py` to set `_RELEASE = False` | ||
2. Run `task generate-tests-frontend` | ||
3. Add tests as appropriate in `tests/frontend.py` | ||
4. Run `task test-frontend` to run the tests | ||
* Note that `test_release` will fail while `_RELEASE = False` -- this is expected | ||
5. Set `_RELEASE = True` in `streamlit_folium/__init__.py` before opening a PR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters