Changeset 1763:9439a6ed3795


Ignore:
Timestamp:
Jan 30, 2019, 7:52:22 PM (3 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Add check to prevent Python < 3.5 install

Prevent installation with a helpful message before an incompatible
pip/setuptools may encounter the `python_requires` keyword argument.

See https://python3statement.org/practicalities .
File:
1 edited

Legend:

Unmodified
Added
Removed
  • setup.py

    r1762 r1763  
    77"""
    88
     9import inspect
    910import os
    1011import sys
    1112
    1213from distutils import core
     14
     15
     16if sys.version_info < (3, 5):
     17    message = """
     18      This version of ftputil supports Python 3.5 and up.
     19
     20      To use ftputil with earlier Python versions, please install
     21      ftputil 3.4 with
     22
     23        pip install ftputil==3.4
     24    """
     25    message = inspect.cleandoc(message)
     26    # This works with Python 2 and 3.
     27    print(message)
     28    sys.exit(1)
    1329
    1430
Note: See TracChangeset for help on using the changeset viewer.