Skip to content

Commit

Permalink
FIXED #17: Remove use of "use_2to3"
Browse files Browse the repository at this point in the history
* Perform some cleanups
  • Loading branch information
jenisys committed Jan 18, 2022
1 parent ce0656b commit 84cdab2
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,15 @@
# PREPARE SETUP:
# -----------------------------------------------------------------------------
HERE = os.path.dirname(__file__)
python_version = float('%s.%s' % sys.version_info[:2])

README = os.path.join(HERE, "README.rst")
long_description = ''.join(open(README).readlines()[4:])
extra = dict(
tests_require=[
"pytest < 5.0; python_version < '3.0'", # >= 4.2
"pytest >= 5.0; python_version >= '3.0'",
"pytest-html >= 1.19.0",
# -- PYTHON 2.6 SUPPORT:
"unittest2; python_version < '2.7'",
],
)

if python_version >= 3.0:
extra["use_2to3"] = True

# -- NICE-TO-HAVE:
# # FILE: setup.cfg -- Use pytest-runner (ptr) as test runner.
# [aliases]
# test = ptr
# USE_PYTEST_RUNNER = os.environ.get("PYSETUP_TEST", "pytest") == "pytest"
USE_PYTEST_RUNNER = os.environ.get("PYSETUP_TEST", "no") == "pytest"
if USE_PYTEST_RUNNER:
extra["tests_require"].append("pytest-runner")

# -----------------------------------------------------------------------------
# UTILITY:
# -----------------------------------------------------------------------------
def find_packages_by_root_package(where):
"""
Better than excluding everything that is not needed,
"""Better than excluding everything that is not needed,
collect only what is needed.
"""
root_package = os.path.basename(where)
Expand Down Expand Up @@ -99,6 +76,13 @@ def find_packages_by_root_package(where):
"six >= 1.11",
"ordereddict; python_version < '2.7'",
],
tests_require=[
"pytest < 5.0; python_version < '3.0'", # >= 4.2
"pytest >= 5.0; python_version >= '3.0'",
"pytest-html >= 1.19.0",
# -- PYTHON 2.6 SUPPORT:
"unittest2; python_version < '2.7'",
],
extras_require={
'docs': ["sphinx>=1.2"],
'develop': [
Expand Down Expand Up @@ -136,5 +120,4 @@ def find_packages_by_root_package(where):
"License :: OSI Approved :: BSD License",
],
platforms = ['any'],
**extra
)

0 comments on commit 84cdab2

Please sign in to comment.