Skip to content

Release to pypi procedure

Jay Zhang edited this page Sep 21, 2022 · 12 revisions

We follow release naming convention similar to tensorflow:

  • Install Twine, a utility tool to interact with PyPI. Do - pip install twine

  • Releases come from release branches named rx.y, for example r0.4. Multiple release maybe come from the same release branch. When we release to pypi we tag the commit the release is on with vx.y.z, for example v0.4.1.

The steps to release to pypi with a new version:

  1. Take a branch, for example git checkout -b r0.4
  2. Edit/commit the file VERSION to include the full version number (x.y.z), for example 0.4.1
  3. Push the branch to github, wait for CI to bless the build.
  4. Build the wheel python setup.py bdist_wheel
    • Test wheel package with dist/tf2onnx-*.whl
  5. Call twine upload dist/tf2onnx-*.whl
    • Please check the version in the tf2onnx-*.whl name again.
    • NOTE: Once the packages are uploaded to PyPI, you cannot overwrite it on the same PyPI instance. Please make sure everything is good on TestPyPI before uploading to PyPI.
  6. Go to GitHub Releases to draft a new release.
  7. Change Target to the proper branch.
  8. Tag the release commit with vx.y.z, for example v0.4.1. Then click Generate release notes to generate note automatically.
    • After this step, you can also add the changelog to make a release
  9. Click Publish release. (We publish the installation file to PyPi, so no binaries were uploaded here.)

If you want another release from the same release branch (ie. you release a patch), merge your changes and go to step 2.

If you started a new branch you want to increment the version in master's VERSION.

Preferred, the release happens on a linux box to avoid CRLF in the released files.

Clone this wiki locally