'How can we set python package version in setup.py programmatically in Azure Pipeline?

I am trying to automate the build/deploy aspect of our python library, but am unable to figure out how to programmatically set the version number so that the version number updates with every build. I even tried to find some pip commands that might help in doing this but no luck. Any idea on how to do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source