Update the preflight checks for publishing to PyPI

This commit is contained in:
Michael Mintz 2023-06-22 14:12:42 -04:00
parent e3c178833c
commit 39e9b64633
1 changed files with 7 additions and 5 deletions

View File

@ -30,14 +30,14 @@ if sys.argv[-1] == "publish":
confirm_text = ">>> Confirm release PUBLISH to PyPI? (yes/no): "
reply = str(input_method(confirm_text)).lower().strip()
if reply == "yes":
if sys.version_info < (3, 9):
print("\nERROR! Publishing to PyPI requires Python>=3.9")
sys.exit()
print("\n*** Checking code health with flake8:\n")
if sys.version_info >= (3, 9):
os.system("python -m pip install 'flake8==6.0.0'")
else:
os.system("python -m pip install 'flake8==5.0.4'")
os.system("python -m pip install 'flake8==6.0.0'")
flake8_status = os.system("flake8 --exclude=recordings,temp")
if flake8_status != 0:
print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
print("\nERROR! Fix flake8 issues before publishing to PyPI!\n")
sys.exit()
else:
print("*** No flake8 issues detected. Continuing...")
@ -48,6 +48,8 @@ if sys.argv[-1] == "publish":
os.system("python -m pip install --upgrade 'build>=0.10.0'")
print("\n*** Installing pkginfo: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'pkginfo>=1.9.6'")
print("\n*** Installing readme-renderer: *** (For PyPI uploads)\n")
os.system("python -m pip install --upgrade 'readme-renderer>=40.0'")
print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'twine>=4.0.2'")
print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")