#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup package for package life-cycle tasks: install, sdist, ...

SEE ALSO:

* https://packaging.python.org

REQUIRES:

* setuptools are installed

RELATED:
  * http://pypi.python.org/pypi/setuptools
"""

import sys
import os.path
from setuptools import setup, find_packages


# -----------------------------------------------------------------------------
# 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()[3:])


# -----------------------------------------------------------------------------
# UTILITY:
# -----------------------------------------------------------------------------
def find_packages_by_root_package(where):
    """
    Better than excluding everything that is not needed,
    collect only what is needed.
    """
    root_package = os.path.basename(where)
    packages = [ "%s.%s" % (root_package, sub_package)
                 for sub_package in find_packages(where)]
    packages.insert(0, root_package)
    return packages


# -----------------------------------------------------------------------------
# SETUP:
# -----------------------------------------------------------------------------
setup(
    name = "cucumber-tag-expressions",
    version = "5.0.6",
    author = "Jens Engel",
    author_email = "jenisys@noreply.github.com",
    url = "https://github.com/cucumber/tag-expressions",
    download_url= "https://pypi.org/project/cucumber-tag-expressions",
    description = "Provides a tag-expression parser and evaluation logic for cucumber/behave",
    long_description = long_description,
    keywords= "BDD, testing, cucumber, tag-expressions, behave",
    license = "MIT",
    packages = find_packages_by_root_package("cucumber_tag_expressions"),
    include_package_data = True,

    # -- REQUIREMENTS:
    python_requires=">=2.7",
    install_requires=[
        "enum34; python_version < '3.4'"
    ],
    tests_require=[
        "pytest <7.5; python_version <  '3.0'",
        "pytest >= 5.0; python_version >= '3.0'",
        "pytest-html >=3.2,<3.3; python_version <  '3.0'",
        "pytest-html >= 2.0;         python_version >= '3.0'",
        "PyYAML >= 5.4.1",
        "pathlib; python_version <= '3.4'",
    ],
    extras_require={
        # PREPARED: 'docs': ["sphinx>=1.5"],
        "develop": [
            "coverage",
            "pytest <7.5; python_version <  '3.0'",
            "pytest >= 5.0; python_version >= '3.0'",
            "pytest-html >=3.2,<3.3; python_version <  '3.0'",
            "pytest-html >= 2.0;         python_version >= '3.0'",
            "tox >=4.8,<4.9",
            "pylint",
            "ruff",
            # -- INVOKE SUPPORT:
            "invoke >= 1.7.3",
            "six >= 1.16.0",
            "path >= 13.1.0;    python_version >= '3.5'",
            "path.py >= 11.5.0; python_version <  '3.5'",
            # PYTHON2 BACKPORTS:
            "pathlib;    python_version <= '3.4'",
            "backports.shutil_which; python_version <= '3.3'",
            # CLEANUP SUPPORT: py.cleanup is provided by: pycmd
            "pycmd",
        ],
    },

    test_suite = "tests",
    zip_safe = True,

    classifiers = [
        "Development Status :: 4 - Beta",
        "Environment :: Console",
        "Intended Audience :: Developers",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Topic :: Software Development :: Testing",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "License :: OSI Approved :: BSD License",
    ],
    platforms = ['any'],
)
