"Fossies" - the Fresh Open Source Software Archive

Member "http-prompt-2.1.0/setup.py" (5 Mar 2021, 2477 Bytes) of package /linux/www/http-prompt-2.1.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "setup.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.0.0_vs_2.1.0.

    1 try:
    2     from setuptools import setup
    3 except ImportError:
    4     from distutils.core import setup
    5 
    6 import codecs
    7 import os
    8 import re
    9 
   10 
   11 here = os.path.abspath(os.path.dirname(__file__))
   12 
   13 
   14 # Read the version number from a source file.
   15 # Why read it, and not import?
   16 # see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion
   17 def find_version(*file_paths):
   18     # Open in Latin-1 so that we avoid encoding errors.
   19     # Use codecs.open for Python 2 compatibility
   20     with codecs.open(os.path.join(here, *file_paths), 'r', 'latin1') as f:
   21         version_file = f.read()
   22 
   23     # The version line must have the form
   24     # __version__ = 'ver'
   25     version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
   26                               version_file, re.M)
   27     if version_match:
   28         return version_match.group(1)
   29     raise RuntimeError('Unable to find version string')
   30 
   31 
   32 def read_description(filename):
   33     with codecs.open(filename, encoding='utf-8') as f:
   34         return f.read()
   35 
   36 
   37 def read_requirements(filename):
   38     try:
   39         with open(filename) as f:
   40             return [line.rstrip() for line in f]
   41     except IOError:
   42         raise IOError(os.getcwd())
   43 
   44 
   45 setup(
   46     name='http-prompt',
   47     version=find_version('http_prompt', '__init__.py'),
   48     url='https://github.com/httpie/http-prompt',
   49     description='An interactive HTTP command-line client',
   50     long_description=read_description('README.rst'),
   51     author='Chang-Hung Liang',
   52     author_email='eliang.cs@gmail.com',
   53     license='MIT',
   54     packages=['http_prompt', 'http_prompt.context'],
   55     entry_points="""
   56         [console_scripts]
   57         http-prompt=http_prompt.cli:cli
   58     """,
   59     install_requires=read_requirements('requirements.txt'),
   60     classifiers=[
   61         'Development Status :: 3 - Alpha',
   62         'Environment :: Console',
   63         'Intended Audience :: Developers',
   64         'Intended Audience :: System Administrators',
   65         'License :: OSI Approved :: MIT License',
   66         'Topic :: Internet :: WWW/HTTP',
   67         'Topic :: Software Development',
   68         'Topic :: System :: Networking',
   69         'Topic :: Terminals',
   70         'Topic :: Text Processing',
   71         'Topic :: Utilities',
   72         'Operating System :: OS Independent',
   73         'Programming Language :: Python',
   74         'Programming Language :: Python :: 3.6',
   75         'Programming Language :: Python :: 3.7',
   76         'Programming Language :: Python :: 3.8',
   77         'Programming Language :: Python :: 3.9',
   78     ]
   79 )