Skip to content

Commit

Permalink
Merge pull request #250 from thinkingmachines/chore/automate-release-…
Browse files Browse the repository at this point in the history
…pypi

Chore: Update instructions for releasing new versions of geowrangler
  • Loading branch information
butchtm authored Aug 13, 2024
2 parents cacb59e + 1c70dc4 commit a6abea3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Geowrangler


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

<img src="https://raw.githubusercontent.com/thinkingmachines/geowrangler/master/images/Geowrangler.svg" alt="Geowrangler logo" style="max-width: 245px;" />
Expand Down
32 changes: 20 additions & 12 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,37 @@

## Bumping the version

Run the following. Use patch, minor, major, prepatch, preminor, premajor, prerelease depending on the release. See https://python-poetry.org/docs/cli/#version for more details
Run the following. Use `<part>` = 0, 1, 2 for major, minor or patch depending on the release. See https://nbdev.fast.ai/api/release.html#bump-version for more details

```
poetry version minor
nbdev_bump_version --part <part>
```

Change the version in `settings.ini` and `geowrangler/__init__.py`

## Publishing

Get an api token for pypi and run
You will need to have an API token for [PyPi](https://pypi.org/) (or [TestPyPi](https://test.pypi.org/)). Ask the current project owners for access.

Set your `~/.pypirc` file as follows.
```
poetry config pypi-token.pypi PYPI_TOKEN
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = <PyPI token>
[testpypi]
username = __token__
password = <TestPyPI token>
```

Run the following

Run the following to publish to PyPi (or TestPypi).
The `<REPOSITORY>` value is either `pypi` or `testpypi`.
```
rm -r dist/
poetry publish --build
./scripts/publish2pypi.sh <REPOSITORY>
```

## Submitting

Create a PR and tag it as 0.1.0
Create a PR and tag it as the release version. The tag should be in the format `vX.Y.Z` where `X.Y.Z` is the major, minor and patch version numbers.
6 changes: 6 additions & 0 deletions scripts/publish2pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
sed -i 's/readme_nb = readme.ipynb/readme_nb = index.ipynb/' settings.ini
nbdev_readme
nbdev_pypi --repository $1
sed -i 's/readme_nb = index.ipynb/readme_nb = readme.ipynb/' settings.ini
nbdev_readme
3 changes: 2 additions & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ language = English
status = 3
user = thinkingmachines
requirements = fastcore pandas numpy geopandas>=1.0 fastprogress h3 morecantile loguru rasterstats scikit-learn requests pyarrow exactextract polars
dev_requirements = nbdev jupyterlab matplotlib nbdime ipytest branca folium mapclassify pytest pytest-mock pytest-cov pytest-xdist black[jupyter]
dev_requirements = nbdev jupyterlab matplotlib nbdime ipytest branca folium mapclassify pytest pytest-mock pytest-cov pytest-xdist black[jupyter] twine
readme_nb = readme.ipynb
allowed_metadata_keys =
allowed_cell_metadata_keys =
jupyter_hooks = True
clean_ids = True
clear_all = False
cell_number = True

0 comments on commit a6abea3

Please sign in to comment.