Skip to content

Commit

Permalink
Move to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary committed Sep 27, 2024
1 parent 05685f7 commit 29892fc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 43 deletions.
44 changes: 44 additions & 0 deletions CONTRIBUTING.md
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
44 changes: 1 addition & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,4 @@ Currently, there are two functions defined:

## Contributing

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
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.

0 comments on commit 29892fc

Please sign in to comment.