Skip to content

Commit a6abea3

Browse files
authored
Merge pull request #250 from thinkingmachines/chore/automate-release-pypi
Chore: Update instructions for releasing new versions of geowrangler
2 parents cacb59e + 1c70dc4 commit a6abea3

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Geowrangler
22

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

65
<img src="https://raw.githubusercontent.com/thinkingmachines/geowrangler/master/images/Geowrangler.svg" alt="Geowrangler logo" style="max-width: 245px;" />

RELEASE.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,37 @@
22

33
## Bumping the version
44

5-
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
5+
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
66

77
```
8-
poetry version minor
8+
nbdev_bump_version --part <part>
99
```
1010

11-
Change the version in `settings.ini` and `geowrangler/__init__.py`
12-
1311
## Publishing
1412

15-
Get an api token for pypi and run
13+
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.
1614

15+
Set your `~/.pypirc` file as follows.
1716
```
18-
poetry config pypi-token.pypi PYPI_TOKEN
17+
[distutils]
18+
index-servers =
19+
pypi
20+
testpypi
21+
22+
[pypi]
23+
username = __token__
24+
password = <PyPI token>
25+
26+
[testpypi]
27+
username = __token__
28+
password = <TestPyPI token>
1929
```
20-
21-
Run the following
22-
30+
Run the following to publish to PyPi (or TestPypi).
31+
The `<REPOSITORY>` value is either `pypi` or `testpypi`.
2332
```
24-
rm -r dist/
25-
poetry publish --build
33+
./scripts/publish2pypi.sh <REPOSITORY>
2634
```
2735

2836
## Submitting
2937

30-
Create a PR and tag it as 0.1.0
38+
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.

scripts/publish2pypi.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
sed -i 's/readme_nb = readme.ipynb/readme_nb = index.ipynb/' settings.ini
3+
nbdev_readme
4+
nbdev_pypi --repository $1
5+
sed -i 's/readme_nb = index.ipynb/readme_nb = readme.ipynb/' settings.ini
6+
nbdev_readme

settings.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ language = English
2828
status = 3
2929
user = thinkingmachines
3030
requirements = fastcore pandas numpy geopandas>=1.0 fastprogress h3 morecantile loguru rasterstats scikit-learn requests pyarrow exactextract polars
31-
dev_requirements = nbdev jupyterlab matplotlib nbdime ipytest branca folium mapclassify pytest pytest-mock pytest-cov pytest-xdist black[jupyter]
31+
dev_requirements = nbdev jupyterlab matplotlib nbdime ipytest branca folium mapclassify pytest pytest-mock pytest-cov pytest-xdist black[jupyter] twine
3232
readme_nb = readme.ipynb
3333
allowed_metadata_keys =
3434
allowed_cell_metadata_keys =
3535
jupyter_hooks = True
3636
clean_ids = True
3737
clear_all = False
38+
cell_number = True
3839

0 commit comments

Comments
 (0)