diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index ef05251..a573847 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -58,3 +58,18 @@ jobs: pip install Cython==0.28.6 - run: buildozer --help - run: buildozer init + + Python2: + runs-on: ubuntu-latest + steps: + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: 2.7 + - uses: actions/checkout@v2 + - name: Try Python 2 install + run: | + # we don't want to build to fail with the exit 1 so we catch with "||" + python2 -m pip install -e . 2> error.log || echo Failing as expected + cat error.log + grep "Unsupported Python version" error.log diff --git a/setup.py b/setup.py index 38d7675..71e23e1 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ Buildozer ''' +import sys from setuptools import setup from os.path import dirname, join import codecs @@ -11,6 +12,21 @@ import io here = os.path.abspath(os.path.dirname(__file__)) +CURRENT_PYTHON = sys.version_info[:2] +REQUIRED_PYTHON = (3, 6) + +# This check and everything above must remain compatible with Python 2.7. +if CURRENT_PYTHON < REQUIRED_PYTHON: + sys.stderr.write(""" +========================== +Unsupported Python version +========================== +This version of buildozer requires Python {}.{}, but you're trying to +install it on Python {}.{}. +""".format(*(REQUIRED_PYTHON + CURRENT_PYTHON))) + sys.exit(1) + + def find_version(*file_paths): # Open in Latin-1 so that we avoid encoding errors. @@ -52,14 +68,10 @@ setup( classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.1', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5' + 'Programming Language :: Python :: 3.6' + 'Programming Language :: Python :: 3.7' + 'Programming Language :: Python :: 3.8' ], entry_points={ 'console_scripts': [ diff --git a/tox.ini b/tox.ini index a63f874..b035c17 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pep8,py27,py3 +envlist = pep8,py3 [testenv] deps =