Skip to content

Commit a0f1f87

Browse files
committed
[packaging] Forbid publishing releases with python2
Because it generates broken wheels.
1 parent cff271e commit a0f1f87

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
print("To install, run 'python setup.py install'\n")
1414

1515
if sys.argv[-1] == 'publish':
16+
if sys.version_info.major < 3:
17+
print('Error: do not publish release with python2!')
18+
sys.exit(1)
1619
os.system('find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf')
1720
os.system("python setup.py sdist bdist_wheel")
1821
os.system("twine upload -s dist/*")

0 commit comments

Comments
 (0)