See imgviz as an example.
git clone https://github.com/wkentaro/imgviz
cd imgviz
git submodule add https://github.com/wkentaro/github2pypi.git
import github2pypi
...
with open('README.md') as f:
# e.g.,  ->
# 
long_description = github2pypi.replace_url(
slug='wkentaro/imgviz', content=f.read()
)
setup(
...
long_description=long_description,
long_description_content_type='text/markdown',
)