-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e19d11
commit fb2dbcf
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Publishing | ||
|
||
Follow these instructions for releasing a new version of Mesop publicly via PyPI (e.g. `pip install mesop`). | ||
|
||
## Bump the version | ||
|
||
Update `mesop/pip_package/setup.py` version field to the next version. | ||
|
||
## Install locally | ||
|
||
```sh | ||
rm -rf /tmp/mesoprelease-test && \ | ||
bazel clean --expunge && \ | ||
virtualenv --python python3 /tmp/mesoprelease-test/venv-test && \ | ||
source /tmp/mesoprelease-test/venv-test/bin/activate && \ | ||
pip install --upgrade pip && \ | ||
pip install -r mesop/pip_package/requirements.txt --no-binary pydantic && \ | ||
pip uninstall -y mesop && \ | ||
bazel run //mesop/pip_package:build_pip_package -- /tmp/mesoprelease-test/mesop.tar.gz && \ | ||
cd /tmp/mesoprelease-test/ && \ | ||
tar -xzf mesop.tar.gz && \ | ||
pip install --upgrade /tmp/mesoprelease-test/mesop*.whl | ||
``` | ||
|
||
## Testing locally | ||
|
||
Create a simple hello world Mesop app to make sure it works: | ||
|
||
```py | ||
import mesop as me | ||
|
||
|
||
@me.page() | ||
def app(): | ||
me.text("Hello world") | ||
|
||
|
||
if __name__ == "__main__": | ||
me.run() | ||
``` | ||
|
||
> Note: you want to make sure that | ||
## Upload to PyPI | ||
|
||
```sh | ||
rm -rf /tmp/mesoprelease-test/venv-twine \ | ||
&& virtualenv --python python3 /tmp/mesoprelease-test/venv-twine \ | ||
&& source /tmp/mesoprelease-test/venv-twine/bin/activate \ | ||
&& pip install --upgrade pip \ | ||
&& pip install twine \ | ||
&& twine upload mesop*.whl | ||
``` | ||
|
||
Visit [https://pypi.org/project/mesop/](https://pypi.org/project/mesop/) to see that the new version has been published. | ||
|
||
## First-time upload setup | ||
|
||
Create a file `~/.pypirc`: | ||
|
||
```yaml | ||
[pypi] | ||
username = __token__ | ||
password = {{password}} | ||
``` | ||
|
||
You will need to get a PyPI token generated by one of the project maintainers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters