@@ -61,7 +61,6 @@ Then run the following commands to re-generate the gen-python files:
6161
6262``` bash
6363$ git checkout -b update-gen-python # Assume you're under opencensus-proto/
64- $ rm -rf gen-python
6564$ cd src
6665$ ./mkpygen.sh
6766$ git add -A
@@ -84,10 +83,8 @@ token](https://help.github.com/articles/creating-a-personal-access-token-for-the
8483
8584 ``` bash
8685 $ MAJOR=0 MINOR=4 PATCH=0 # Set appropriately for new release
87- $ VERSION_FILES=(
88- build.gradle
89- pom.xml
90- )
86+ $ JAVA_VERSION_FILES=(build.gradle)
87+ $ PYTHON_VERSION_FILES=(gen-python/version.py)
9188 $ git checkout -b v$MAJOR .$MINOR .x master
9289 $ git push upstream v$MAJOR .$MINOR .x
9390 ```
@@ -117,9 +114,11 @@ token](https://help.github.com/articles/creating-a-personal-access-token-for-the
117114
118115 ```bash
119116 $ git checkout -b bump-version master
120- # Change version to next minor (and keep -SNAPSHOT)
117+ # Change version to next minor (and keep -SNAPSHOT and .dev0 )
121118 $ sed -i ' s/[0-9]\+\. [0-9]\+\. [0-9]\+\( .* CURRENT_OPENCENSUS_PROTO_VERSION\) /' $MAJOR.$((MINOR+1)).0' \1 /' \
122- "${VERSION_FILES[@]}"
119+ "${JAVA_VERSION_FILES[@]}"
120+ $ sed -i ' s/[0-9]\+\. [0-9]\+\( .* CURRENT_OPENCENSUS_PROTO_VERSION\) /' $MAJOR.$((MINOR+1))' \1 /' \
121+ "${PYTHON_VERSION_FILES[@]}"
123122 $ ./gradlew build
124123 $ git commit -a -m "Start $MAJOR.$((MINOR+1)).0 development cycle"
125124 ```
@@ -139,8 +138,9 @@ token](https://help.github.com/articles/creating-a-personal-access-token-for-the
139138
140139 ```bash
141140 $ git checkout -b release v$MAJOR.$MINOR.x
142- # Change version to remove -SNAPSHOT
143- $ sed -i ' s/-SNAPSHOT\( .* CURRENT_OPENCENSUS_PROTO_VERSION\) /\1 /' "${VERSION_FILES[@]}"
141+ # Change version to remove -SNAPSHOT and .dev0
142+ $ sed -i ' s/-SNAPSHOT\( .* CURRENT_OPENCENSUS_PROTO_VERSION\) /\1 /' "${JAVA_VERSION_FILES[@]}"
143+ $ sed -i ' s/dev0\( .* CURRENT_OPENCENSUS_PROTO_VERSION\) /' 0' \1 /' "${PYTHON_VERSION_FILES[@]}"
144144 $ ./gradlew build
145145 $ git commit -a -m "Bump version to $MAJOR.$MINOR.$PATCH"
146146 $ git tag -a v$MAJOR.$MINOR.$PATCH -m "Version $MAJOR.$MINOR.$PATCH"
@@ -150,9 +150,11 @@ token](https://help.github.com/articles/creating-a-personal-access-token-for-the
150150 `0.4.1-SNAPSHOT`). Commit the result:
151151
152152 ```bash
153- # Change version to next patch and add -SNAPSHOT
153+ # Change version to next patch and add -SNAPSHOT and .dev1
154154 $ sed -i ' s/[0-9]\+\. [0-9]\+\. [0-9]\+\( .* CURRENT_OPENCENSUS_PROTO_VERSION\) /' $MAJOR.$MINOR.$((PATCH+1))-SNAPSHOT' \1 /' \
155- "${VERSION_FILES[@]}"
155+ "${JAVA_VERSION_FILES[@]}"
156+ $ sed -i ' s/[0-9]\+\. [0-9]\+\. [0-9]\+\( .* CURRENT_OPENCENSUS_PROTO_VERSION\) /' $MAJOR.$MINOR.dev$((PATCH+1))' \1 /' \
157+ "${PYTHON_VERSION_FILES[@]}"
156158 $ ./gradlew build
157159 $ git commit -a -m "Bump version to $MAJOR.$MINOR.$((PATCH+1))-SNAPSHOT"
158160 ```
@@ -217,6 +219,36 @@ Central (the staging repository will be destroyed in the process). You can see
217219the complete process for releasing to Maven Central on the [OSSRH
218220site](http://central.sonatype.org/pages/releasing-the-deployment.html).
219221
222+ # # Push Python package to PyPI
223+
224+ We follow the same package distribution process outlined at
225+ [Python Packaging User Guide](https://packaging.python.org/tutorials/packaging-projects/).
226+
227+ # ## Prerequisites
228+
229+ If you haven' t already, install the latest versions of setuptools, wheel and twine:
230+ ```bash
231+ $ python3 -m pip install --user --upgrade setuptools wheel twine
232+ ```
233+
234+ ### Branch
235+
236+ Before building/deploying, be sure to switch to the appropriate tag. The tag
237+ must reference a commit that has been pushed to the main repository, i.e., has
238+ gone through code review. For the current release use:
239+
240+ ```bash
241+ $ git checkout -b v$MAJOR.$MINOR.$PATCH tags/v$MAJOR.$MINOR.$PATCH
242+ ```
243+
244+ ### Generate and upload the distribution archives
245+
246+ ```bash
247+ $ cd gen-python
248+ $ python3 setup.py sdist bdist_wheel
249+ $ python3 -m twine upload dist/*
250+ ```
251+
220252## Announcement
221253
222254Once deployment is done, go to Github [release
0 commit comments