Creating an app token might not be the simplest task, use this utility and forget about all the issues.
pip install github_token
import github_token
user = input("Username: ")
password = getpass.getpass()
app_name = input("App Name to create: ")
token_factory = github_token.TokenFactory(user, password, app_name,
github_token.Scopes.all)
print(token_factory(
tfa_token_callback=lambda: input("TFA Token: ")
))
When working locally in the project
python3 -m venv venv3
. venv3/bin/activate
python3 -m pip install -r dev-requirements.txt
python3 -m pytest tests.py
rm -rf dist/*
python3 -m pip install twine
python3 setup.py sdist bdist_wheel
twine upload dist/*