You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/internal/publishing.md
+18-52Lines changed: 18 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,14 @@
2
2
3
3
Follow these instructions for releasing a new version of Mesop publicly via PyPI (e.g. `pip install mesop`).
4
4
5
-
If you haven't done this before, follow the [first-time setup](#first-time-upload-setup).
6
-
7
5
## Check main branch
8
6
9
7
Before, cutting a release, you'll want to check two things:
10
8
11
9
1. The `main` branch should be healthy (e.g. latest commit is green).
12
10
2. Check the [snyk dashboard](https://app.snyk.io/org/wwwillchen/project/756c376f-d2e7-44f8-9c20-e4062fdf543f) to review security issues:
13
-
- It only runs weekly so you need to click "Retest now". If there's any High security issues for a core Mesop file (e.g. anything in `mesop/*`), then you should address it before publishing a release.
11
+
12
+
- It only runs weekly so you need to click "Retest now". If there's any High security issues for a core Mesop file (e.g. anything in `mesop/*`), then you should address it before publishing a release.
14
13
15
14
## Update version to RC
16
15
@@ -20,53 +19,41 @@ You want to first create an RC (release candidate) to ensure that it works.
20
19
21
20
For example, if the current version is: `0.7.0`, then you should increment the version to `0.8.0rc1` which will create an RC, which is treated as a [pre-release by PyPI](https://packaging.python.org/en/latest/specifications/version-specifiers/#pre-releases).
22
21
23
-
## Install locally
22
+
Merge the PR that bumps the version and then go to the next step to publish a GitHub release which will in turn publish to PyPI.
24
23
25
-
From the workspace root, run the following command:
24
+
## Publish GitHub release
26
25
27
-
```sh
28
-
source ./scripts/pip.sh
29
-
```
26
+
After you've submitted the PR which bumps the version and then [publish a GitHub release](https://github.com/google/mesop/releases/new).
30
27
31
-
This will build the Mesop pip package and install it locally so you can test it.
28
+
1. Click "Choose a tag" and type in the version you just released. This will create a new Git tag.
29
+
1. Click "Generate release notes".
30
+
1.**If this is a an RC:** Click "Set as a pre-release", **otherwise** leave the "Set as the latest release" checked.
31
+
1. If this is a regular (non-RC) release, click "Create a discussion for this release".
32
+
1. Click "Publish release".
32
33
33
34
## Testing locally
34
35
35
-
> TIP: Double check the Mesop version is expected. It's easy to use the wrong version of Mesop by loading `mesop` or `gunicorn` from a different Python path (i.e. not the venv you just created).
36
+
**Pre-requisite:** you will need to [install uv](https://docs.astral.sh/uv/getting-started/installation/) before doing the following steps.
36
37
37
38
### Dev CLI
38
39
39
-
The above shell script will tell you to run the following command:
40
+
Run the following command but replace `0.1.0rc1` with the version that you just published:
40
41
41
42
```sh
42
-
mesopmain.py
43
+
uvx mesop==0.1.0rc1 scripts/smoketest_app/main.py
43
44
```
44
45
45
-
This will start the Mesop dev server and you can test that hot reload works.
46
+
This will start the Mesop dev server and you can test that hot reload works. Double-check that the version shown is the version that you just released.
46
47
47
48
### Gunicorn integration
48
49
49
-
```sh
50
-
gunicorn main:me
51
-
```
52
-
53
-
> Note: `gunicorn` should already be installed by the shell script above.
54
-
55
-
## Upload to PyPI
56
-
57
-
If the testing above looks good, then continue with uploading to PyPI.
50
+
Run the following command but replace `0.1.0rc1` with the version that you just published:
cd scripts/smoketest_app/ && uvx --with mesop==0.1.0rc1 gunicorn@latest main:me
67
54
```
68
55
69
-
Visit [https://pypi.org/project/mesop/](https://pypi.org/project/mesop/) to see that the new version has been published.
56
+
This will launch Mesop under the Gunicorn server so you can make sure it works as expected.
70
57
71
58
## Test on Colab
72
59
@@ -90,25 +77,4 @@ If all the testing looks good, then you can update [`mesop/version.py`](https://
90
77
91
78
`0.8.0rc1` -> `0.8.0`
92
79
93
-
Re-do the steps above to build, test and upload it to PyPI.
94
-
95
-
## Publish GitHub release
96
-
97
-
After you've uploaded a new regular release to PyPI, submit the PR which bumps the version and then [publish a GitHub release](https://github.com/google/mesop/releases/new).
98
-
99
-
1. Click "Choose a tag" and type in the version you just released. This will create a new Git tag.
100
-
1. Click "Genereate release notes".
101
-
1. Click "Create a discussion for this release".
102
-
1. Click "Publish release".
103
-
104
-
## First-time upload setup
105
-
106
-
Create a file `~/.pypirc`:
107
-
108
-
```yaml
109
-
[pypi]
110
-
username = __token__
111
-
password = {{password}}
112
-
```
113
-
114
-
You will need to get a PyPI token generated by one of the project maintainers.
80
+
Re-do the steps above to publish and test the release.
0 commit comments