Skip to content
Permalink
Browse files

Upgraded the Python 3 warnings

Since some users have ignored the warnings and tried to use this on Python 3, the warning has been changed to a hard failure when running setup.py on py3. The README now also reflects this.
  • Loading branch information...
agronholm committed Apr 29, 2018
1 parent 5edbc65 commit 1f9c23f82cf760e4d085561cce21c5a52155905b
Showing with 13 additions and 6 deletions.
  1. +3 −2 README.rst
  2. +10 −4 setup.py
@@ -4,8 +4,9 @@

This is a backport of the `concurrent.futures`_ standard library module to Python 2.

It should not be installed on Python 3, although there should be no harm in doing so, as the
standard library takes precedence over third party libraries.
It **does not** work on Python 3 due to Python 2 syntax being used in the codebase.
Python 3 users should not attempt to install it, since the package is already included in the
standard library.

To conditionally require this library only on Python 2, you can do this in your ``setup.py``:

@@ -1,13 +1,19 @@
#!/usr/bin/env python
# coding: utf-8
from warnings import warn
from __future__ import print_function

import os.path
import sys

if sys.version_info[0] > 2:
warn('This backport is meant only for Python 2.\n'
'Python 3 users do not need it, as the concurrent.futures '
'package is available in the standard library.')
print('This backport is meant only for Python 2.\n'
'It does not work on Python 3, and Python 3 users do not need it '
'as the concurrent.futures package is available in the standard library.\n'
'For projects that work on both Python 2 and 3, the dependency needs to be conditional '
'on the Python version, like so:\n'
"extras_require={':python_version == \"2.7\"': ['futures']}",
file=sys.stderr)
sys.exit(1)

extras = {}
try:

0 comments on commit 1f9c23f

Please sign in to comment.
You can’t perform that action at this time.