Packaging and deploying python code is very easy.
I found this tutorial quite thorough and easy to follow.
The thing missing in this tutorial is that one feature of setuptools, e.g. entrypoint, which adds a runnable binary to the system path, is not mentioned.
Then refer to a more detailed document