use conditional requirements to ensure "chardet" listed as requirement on Python 3 (fixes #213)

Previously "chardet" was added only added when setup.py was run with Python 3.
However wheels contain a static list of requirements and a wheel-based
install will never execute setup.py at installation time.

pdfminer.six uses universal wheels for Python 2 and Python 3 so the
requirements will always be wrong on one version (see #213).

The solution is to use conditional requirements as specified in PEP 496
which are evaluated at installation time.
pull/219/head
Felix Schwarz 2019-01-18 11:24:51 +01:00
parent b6a5848208
commit 5ff84b83fb
1 changed files with 1 additions and 3 deletions

View File

@ -3,9 +3,7 @@ import sys
import pdfminer as package import pdfminer as package
requires = ['six', 'pycryptodome', 'sortedcontainers'] requires = ['six', 'pycryptodome', 'sortedcontainers', 'chardet ; python_version > "3.0"']
if sys.version_info >= (3, 0):
requires.append('chardet')
setup( setup(
name='pdfminer.six', name='pdfminer.six',