Ensure Python3 before reading README with encoding arg

If you accidently try to install using Python 2 you get the error

    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/nokome/nokome/repo2docker/setup.py", line 5, in <module>
        with open('README.md', encoding="utf8") as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

Ideally the user would be aked to use Python 3 as `python_requires` tells us,
but which isn't reached yet.
This implements that behaviour.
pull/472/head
Nokome Bentley 2018-11-16 11:37:30 +13:00
rodzic ccce3fe9fc
commit 6d496eee91
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -1,6 +1,10 @@
from setuptools import setup, find_packages
import versioneer
import sys
if sys.version_info[0] < 3:
sys.stderr.write('jupyter-repo2docker requires Python 3 but the running Python is %s.%s.%s' % sys.version_info[:3])
sys.exit(1)
with open('README.md', encoding="utf8") as f:
readme = f.read()