Skip to content

Commit bd97fb1

Browse files
authored
Merge pull request #145 from jafingerhut/add-docs-on-publishing-new-python-package
Add a new README file on publishing a new version of the Python package
2 parents 03d7a51 + 2291b46 commit bd97fb1

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

README-publish-python-package.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Notes on publishing new version of Python package for p4runtime-shell
2+
3+
Prerequisites: You must have a Github user account that has privileges
4+
to push new tags to this repository. This might only be Github
5+
accounts with administration privileges on the repository.
6+
7+
Run these commands:
8+
```
9+
git clone [email protected]:p4lang/p4runtime-shell
10+
cd p4runtime-shell
11+
git tag -a v<version-string> -m "Version <version-string> - <version description>"
12+
git push origin v<version-string>
13+
```
14+
15+
Example for releasing version 0.0.5 with comment "Version 0.0.5 - Add
16+
eburst":
17+
```
18+
git clone [email protected]:p4lang/p4runtime-shell
19+
cd p4runtime-shell
20+
git tag -a v0.0.5 -m "Version 0.0.5 - Add eburst"
21+
git push origin v0.0.5
22+
```
23+
24+
To verify whether this successfully triggers creating a new release on
25+
PyPI:
26+
27+
+ Go to https://github.com/p4lang/p4runtime-shell
28+
+ Click the "Actions" link near the top of the page.
29+
+ Verify that the most recent workflow was started near the time you
30+
did the `git push` command above, that it has the
31+
`v<version-string>` in the column to the left of the start time, and
32+
to the left of that is a reasonable-looking commit description for
33+
the commit with that version.
34+
+ After a few minutes, check the pypi.org page for the p4runtime-shell
35+
package and verify that the new version is the most recent one
36+
mentioned: https://pypi.org/project/p4runtime-shell/
37+
38+
If you further wish to test installing this package on a development
39+
system that has the Python3 `venv` virtual environment package
40+
installed:
41+
42+
```bash
43+
python3 -m venv $HOME/venv-test-p4runtime-shell-install
44+
source $HOME/venv-test-p4runtime-shell-install/bin/activate
45+
pip list
46+
pip install p4runtime-shell
47+
pip list
48+
```
49+
50+
The `p4runtime-shell` with the new latest version should have been
51+
installed, along with many packages it depends upon.
52+
53+
Note: The reason that pushing a tag to this repository causes a new
54+
release to be published to pypi.org is because of the Github action
55+
defined in the file
56+
[`.github/workflows/pypi.yml`](.github/workflows/pypi.yml) of this
57+
repository.

0 commit comments

Comments
 (0)