|
1 | 1 | # Create docs |
2 | 2 |
|
3 | | -Install `jupyter-book` and `ghp-import`. From the main directory run |
| 3 | +The documentation site is built with [Jupyter Book](https://jupyterbook.org/). |
4 | 4 |
|
5 | | -```bask |
6 | | -make build-jupyterbook |
7 | | -# Check doc in local looks good |
| 5 | +Build it locally from the repository root: |
8 | 6 |
|
9 | | -# Upload the doc to GitHub |
10 | | -ghp-import -n -p -f jupyterbook/_build/html |
| 7 | +```bash |
| 8 | +make build-jupyterbook |
11 | 9 | ``` |
12 | | -The commit should appear in branch `gh-pages` and the page will be live at [spaceml-org.github.io/ml4floods](https://spaceml-org.github.io/ml4floods) |
13 | 10 |
|
14 | | -# Publish package in pip |
| 11 | +Then open `jupyterbook/_build/html/index.html` to review it. |
15 | 12 |
|
16 | | -Install `twine`. |
| 13 | +Deployment is automatic: on every merge to `main`, the `deploy` GitHub Actions |
| 14 | +workflow builds the book and publishes it to GitHub Pages at |
| 15 | +[spaceml-org.github.io/ml4floods](https://spaceml-org.github.io/ml4floods). |
17 | 16 |
|
18 | | -First update the version number in `ml4floods/__init__.py` |
| 17 | +# Publish package to PyPI |
19 | 18 |
|
20 | | -``` |
21 | | -rm -rf build/ |
22 | | -rm -rf dist/ |
23 | | -python setup.py sdist bdist_wheel |
| 19 | +First bump the version number in `ml4floods/__init__.py`, then from the |
| 20 | +repository root: |
24 | 21 |
|
25 | | -# upload to testpypi |
26 | | -python -m twine upload --repository testpypi dist/* |
27 | | -
|
28 | | -# Upload to real pypi |
29 | | -python -m twine upload dist/* |
| 22 | +```bash |
| 23 | +make build # build sdist + wheel (uv build) |
| 24 | +make publish # upload to PyPI (uv publish) |
30 | 25 | ``` |
31 | | -The package in PyPi will be shown at [pypi.org/project/ml4floods/](https://pypi.org/project/ml4floods/). The test version can be checked at [test.pypi.org/project/ml4floods/](https://test.pypi.org/project/ml4floods/) |
32 | | - |
33 | 26 |
|
34 | | -Follow [this tutorial](https://towardsdatascience.com/how-to-publish-a-python-package-to-pypi-7be9dd5d6dcd) to understand how pip works |
| 27 | +The package is listed at [pypi.org/project/ml4floods](https://pypi.org/project/ml4floods/). |
0 commit comments