Skip to content

Commit 2a5e0c5

Browse files
update package publish instructions
1 parent 5bcae9e commit 2a5e0c5

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

CONTRIBUTING.md

+38-5
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,43 @@ You can review test coverage by opening `htmlcov/index.html` in a browser.
3838

3939
# Uploading package to PyPI (For FarmBot employees)
4040

41-
Follow [this tutorial](https://packaging.python.org/en/latest/tutorials/packaging-projects/).
41+
Update the version number in `farmbot/main.py`.
42+
```python
43+
VERSION = "2.0.0"
44+
```
45+
46+
Verify that tests pass and coverage is still at 100%.
47+
```bash
48+
coverage run -m unittest discover
49+
coverage html
50+
```
51+
52+
Commit and push the version bump (and any other changes already committed).
53+
```bash
54+
git add farmbot/main.py
55+
git commit -m "v2.0.0"
56+
git push origin main
57+
```
58+
Review GitHub Actions, verifying that the `test` workflow has passed,
59+
and approve the "Publish to TestPyPI" workflow.
60+
This will upload the package to TestPyPI.
61+
62+
Once the package has been published to TestPyPI,
63+
install it in a new virtual environment to verify that it works as expected.
64+
```bash
65+
python -m venv test_venv
66+
source test_venv/bin/activate
67+
python -m pip install requests paho-mqtt
68+
69+
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps --upgrade farmbot
70+
```
71+
72+
If it does, create and upload a tag.
4273
```bash
43-
python -m pip install --upgrade pip build twine
44-
rm dist/*
45-
python -m build
46-
python -m twine upload dist/*
74+
git tag v2.0.0
75+
git push origin v2.0.0
4776
```
77+
78+
Approve the "Publish to PyPI" workflow in GitHub Actions. This will upload the package to PyPI and create a GitHub release.
79+
80+
Review the GitHub release, and add a change log to the release notes.

0 commit comments

Comments
 (0)