-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Release Process
All releases must come from a feature branch and be merged only when the content of the branch is the exact content to publish to PyPI.
For Autorest generated packages, each service is supposed to have an automatic feature branch called "Service PR" (label on Github). Example: https://github.com/Azure/azure-sdk-for-python/pull/3097
Look for the service PR of your service before anything else. Let's assume that your package is "azure-mgmt-myservice".
Checkout the branch of the service PR, load the dev_setup, and verify if the file "azure-mgmt-myservice/sdk_packaging.toml" exists.
Then, execute this command:
python -m packaging_tools --build-conf azure-mgmt-web
If the file sdk_packaging.toml didn't exist, now one is created with default values. Update this file and update the default values to the one from this service. Once it's done, restart the same script.
Your packaging info are up-to-date
For all packages, you need to update the HISTORY.rst
file
/azure-mgmt-myservice/HISTORY.rst
There is a preview tool to compute the HISTORY change (requires dev_setup loaded):
python -m packaging_tools.code_report azure-mgmt-trafficmanager # Do this on master
python -m packaging_tools.code_report -o report2.json azure-mgmt-trafficmanager # Do this on feature branch
python -m packaging_tools.change_log report.json --package-print report2.json
This will show a candidate changelog.
You need to check the version in:
/azure-mgmt-myservice/azure/mgmt/myservice/version.py
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 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.
To build a package to check in your setup.py
is correct:
python .\build_package.py azure-mgmt-myservice
This requires wheel
to work.
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.
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-webapp_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)
- 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