Skip to content

Commit 39e9b64

Browse files
committed
Update the preflight checks for publishing to PyPI
1 parent e3c1788 commit 39e9b64

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

setup.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
confirm_text = ">>> Confirm release PUBLISH to PyPI? (yes/no): "
3131
reply = str(input_method(confirm_text)).lower().strip()
3232
if reply == "yes":
33+
if sys.version_info < (3, 9):
34+
print("\nERROR! Publishing to PyPI requires Python>=3.9")
35+
sys.exit()
3336
print("\n*** Checking code health with flake8:\n")
34-
if sys.version_info >= (3, 9):
35-
os.system("python -m pip install 'flake8==6.0.0'")
36-
else:
37-
os.system("python -m pip install 'flake8==5.0.4'")
37+
os.system("python -m pip install 'flake8==6.0.0'")
3838
flake8_status = os.system("flake8 --exclude=recordings,temp")
3939
if flake8_status != 0:
40-
print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
40+
print("\nERROR! Fix flake8 issues before publishing to PyPI!\n")
4141
sys.exit()
4242
else:
4343
print("*** No flake8 issues detected. Continuing...")
@@ -48,6 +48,8 @@
4848
os.system("python -m pip install --upgrade 'build>=0.10.0'")
4949
print("\n*** Installing pkginfo: *** (Required for PyPI uploads)\n")
5050
os.system("python -m pip install --upgrade 'pkginfo>=1.9.6'")
51+
print("\n*** Installing readme-renderer: *** (For PyPI uploads)\n")
52+
os.system("python -m pip install --upgrade 'readme-renderer>=40.0'")
5153
print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
5254
os.system("python -m pip install --upgrade 'twine>=4.0.2'")
5355
print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")

0 commit comments

Comments
 (0)