Skip to content

Release Process

Laurent Mazuel edited this page Feb 17, 2017 · 38 revisions

This article suppose you already have your code commited in the master branch of the repository, with tests updated.

Package update (version, change log, ...)

Generic files (applicable to all packages)

For all packages, you need to update the versions in:

/README.rst
/doc/installation.rst

Also check if your package contains an HISTORY.txt file. If not, it's may be the good opportunity to do it! The ChangeLog.txt at the root of the repo is deprecated and should not be updated.

Autorest generated package

Let's assume for the article that we are publishing azure-mgmt-compute.

You need to check the versions in:

/swagger_to_sdk_config.json
/azure-mgmt-compute/azure/mgmt/compute/version.py

Make a diff of your setup.py against the reference and update yours if necessary. Dependencies are critical.

Manual package (azure, azure-servicebus, etc.)

Update the version in the following files. Note that there may be multiple instances of the version in each of the files.

The README.rst for the bundle packages have the exact version of the packages they are bundling. Change the text AND the links.

/azure/README.rst
/azure-mgmt/README.rst

These setup.py have to be changed manually if necessary:

/azure/setup.py
/azure-common/setup.py
/azure-mgmt/setup.py
/azure-mgmt-common/setup.py
/azure-mgmt-nspkg/setup.py
/azure-nspkg/setup.py
/azure-servicebus/setup.py
/azure-servicemanagement-legacy/setup.py

Do NOT forget the install_requires list.

Several packages (non-bundle and non-nspkg) expose a __version__ attribute.

/azure-common/azure/common/__init__.py
/azure-mgmt-common/azure/mgmt/common/__init__.py
/azure-servicebus/azure/servicebus/constants.py
/azure-servicemanagement-legacy/azure/servicemanagement/constants.py

The documentation configuration has two strings for version and release (azure package only)

/doc/conf.py

Tests

The test recordings include the version number in the User-Agent header of each request, but this header is not required for the tests to pass. You may want to find/replace those, or you may have to create new recordings.

In any case, make sure that the tests succeed in playback mode after you've incremented the version.

Build

To build a package to check in your setup.py is correct:

python .\build_package.py azure-mgmt-compute

This requires wheel to work.

Python Package Index

Once you've uploaded to PyPI, there's no way to overwrite the package. In case of problems, you'll need to increment the version number. To make sure everything works fine, upload and then test installing from the test server first. Make sure you install the dependencies manually, as they won't be present on the test server.

Test server

  • Create an account for the test server
  • Update .pypirc:
[test]
repository = https://testpypi.python.org/pypi
username = <yourusername>
password = <yourpassword>

To upload to the test server:

twine upload -r test azure-mgmt-compute\dist\*.zip
twine upload -r test azure-mgmt-compute\dist\*.whl

Make sure you already have the non-azure dependencies installed, otherwise they may not be found on the test server. Don't install using --no-deps. Use the requirements.txt to install everything needed

pip install -r requirements.txt

To install from the test server:

pip install azure -i https://testpypi.python.org/pypi

Production - Deploy with Travis

Travis is now looking at tags on Github to release for you. For instance, once azure-mgmt-compute 0.45.0 is ready to be release, just tag the corresponding commit this way:

azure-mgmt-compute_0.45.0

The syntax HAS to be respected. Travis will build the package, check if the version in the tag is the version built and then upload to PyPI. This process is done by the "Python 3.6" job only (yes it's a waste of resources https://github.com/travis-ci/travis-ci/issues/7149)

Production - Deploy manually

  • Update .pypirc:
[pypi]
repository = https://pypi.python.org/pypi
username = <yourusername>
password = <yourpassword>

To upload to production:

twine upload dist\*.zip
twine upload dist\*.whl

To install from production:

pip install azure

Releases (azure only)

https://github.com/Azure/azure-sdk-for-python/releases

  • Create a new release, set the contents to the change log entry for the new version.
  • As the release button send a notification to our customers, push it only when the new packages are in Pypi.

Docs

ReadTheDocs

  • Regenerate the technical documentation. Go to the doc folder and launch the make.bat html.

  • Trigger rebuild of readthedocs.org. This should happen as part of a push, but if not you can post using the below:

curl -X POST http://azure-sdk-for-python.readthedocs.org

PTVS Documentation

Check if the following page needs an update: https://github.com/Microsoft/PTVS/wiki/AzureSDK

Azure Documentation

http://azure.microsoft.com/en-us/develop/python/

Web Platform Installer (deprecated, keep for history)

Get access to http://webpi.codeplex.com/ (ask Chris Sfanos) and fork the repo.

Update :

  • In Src/Python/WebProductList_Python.xml, find the entry elements with productId PythonAzure27 and PythonAzure34

    • Update version element
    • Update published element
    • Update updated element
    • Update version in discoveryHint section
    • Update version in installer section
  • In Src/azuresdk/AzureSDK_Partners/WebProductList_AzureSDK_Partners.xml, find the entry elements with productId AzurePython27SDK and AzurePython34SDK:

    • Update version element
    • Update published element
    • Update updated element

To build:

  • Run Tools/build.cmd

To test:

  • Copy bin/WebProductList.xml to test machine
  • Change WebPI primary feed to the full path to that file
  • Install Microsoft Azure SDK for Python 2.7 and Microsoft Azure SDK for Python 3.4

To reset:

If you get stuck with an error when WebPI start because the custom feed can't be loaded, you can reset everything with this command.

Run from admin command prompt, from %programfiles%\microsoft\web platform installer.

webplatforminstaller.exe /reset

Publicity