Essentially replace setup.py with pyproject.toml.
See https://peps.python.org/pep-0517/ and https://peps.python.org/pep-0518/ for details.
I would also suggest using tooling such as https://pypi.org/project/setuptools-scm/, and move onto a model where github releases are sources of truth.