# Path: poet/_compat.py
# PY2 = sys.version_info[0] == 2
# PY3K = sys.version_info[0] >= 3
# def decode(string, encodings=None):
# def encode(string, encodings=None):
# 
# Path: poet/utils/helpers.py
# def template(name):
#     """
#     Returns a template given a name.
#     
#     :param name: The name of the template.
#     :type name: str
#     
#     :rtype: jinja2.Template 
#     """
#     if not name.endswith('.jinja2'):
#         name += '.jinja2'
# 
#     return TEMPLATE_ENV.get_template(name)


import os
import re
import warnings
from setuptools.dist import Distribution
from setuptools.extension import Extension
from pip.commands.wheel import WheelCommand
from pip.status_codes import SUCCESS
from semantic_version import Spec, Version
from .._compat import Path, PY2, encode
from ..utils.helpers import template
        setup_kwargs['install_requires'] = self._install_requires(poet)
        setup_kwargs['tests_require'] = self._tests_require(poet)
        setup_kwargs['extras_require'] = self._extras_require(poet)

        setup_kwargs.update(self._packages(poet))

        # Extensions
        setup_kwargs.update(self._ext_modules(poet))

        return setup_kwargs

    def _author(self, poet):
        """
        Build the author information from a Poet instance.
        
        Transforms a author in the form "name <email>" into
        a proper dictionary.
        
        :param poet: The Poet instance for which to build.
        :type poet: poet.poet.Poet
        
        :rtype: dict
        """
        m = self.AUTHOR_REGEX.match(poet.authors[0])

        name = m.group('name')
        email = m.group('email')

        if PY2:
            name = encode(name)

# Path: poet/_compat.py
# PY2 = sys.version_info[0] == 2
# PY3K = sys.version_info[0] >= 3
# def decode(string, encodings=None):
# def encode(string, encodings=None):
# 
# Path: poet/utils/helpers.py
# def template(name):
#     """
#     Returns a template given a name.
#     
#     :param name: The name of the template.
#     :type name: str
#     
#     :rtype: jinja2.Template 
#     """
#     if not name.endswith('.jinja2'):
#         name += '.jinja2'
# 
#     return TEMPLATE_ENV.get_template(name)


# Path: poet/build/builder.py
import os
import re
import warnings
from setuptools.dist import Distribution
from setuptools.extension import Extension
from pip.commands.wheel import WheelCommand
from pip.status_codes import SUCCESS
from semantic_version import Spec, Version
from .._compat import Path, PY2, encode
from ..utils.helpers import template

        setup_kwargs['install_requires'] = self._install_requires(poet)
        setup_kwargs['tests_require'] = self._tests_require(poet)
        setup_kwargs['extras_require'] = self._extras_require(poet)

        setup_kwargs.update(self._packages(poet))

        # Extensions
        setup_kwargs.update(self._ext_modules(poet))

        return setup_kwargs

    def _author(self, poet):
        """
        Build the author information from a Poet instance.
        
        Transforms a author in the form "name <email>" into
        a proper dictionary.
        
        :param poet: The Poet instance for which to build.
        :type poet: poet.poet.Poet
        
        :rtype: dict
        """
        m = self.AUTHOR_REGEX.match(poet.authors[0])

        name = m.group('name')
        email = m.group('email')

        if PY2:
            name = encode(name)

            email = encode(email)