• 大小: 867KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-17
  • 语言: Python
  • 标签:

资源简介

aiohttp 一个用于asyncio和Python的异步HTTP客户端/服务器

资源截图

代码片段和文件信息

import codecs
import pathlib
import re
import sys
from distutils.command.build_ext import build_ext
from distutils.errors import (CCompilerError DistutilsExecError
                              DistutilsPlatformError)

from setuptools import Extension setup


if sys.version_info < (3 5 3):
    raise RuntimeError(“aiohttp 3.x requires Python 3.5.3+“)

here = pathlib.Path(__file__).parent

try:
    from Cython.Build import cythonize
    USE_CYTHON = True
except ImportError:
    USE_CYTHON = False

if (here / ‘.git‘).exists() and not USE_CYTHON:
    print(“Install cython when building from git clone“ file=sys.stderr)
    print(“Hint:“ file=sys.stderr)
    print(“  pip install cython“ file=sys.stderr)
    sys.exit(1)


if (here / ‘.git‘).exists() and not (here / ‘vendor/http-parser/README.md‘):
    print(“Install submodules when building from git clone“ file=sys.stderr)
    print(“Hint:“ file=sys.stderr)
    print(“  git submodule update --init“ file=sys.stderr)
    sys.exit(2)


ext = ‘.pyx‘ if USE_CYTHON else ‘.c‘


extensions = [Extension(‘aiohttp._websocket‘ [‘aiohttp/_websocket‘ + ext])
              Extension(‘aiohttp._http_parser‘
                        [‘aiohttp/_http_parser‘ + ext
                         ‘vendor/http-parser/http_parser.c‘
                         ‘aiohttp/_find_header.c‘]
                        define_macros=[(‘HTTP_PARSER_STRICT‘ 0)]
                        )
              Extension(‘aiohttp._frozenlist‘
                        [‘aiohttp/_frozenlist‘ + ext])
              Extension(‘aiohttp._helpers‘
                        [‘aiohttp/_helpers‘ + ext])
              Extension(‘aiohttp._http_writer‘
                        [‘aiohttp/_http_writer‘ + ext])]


if USE_CYTHON:
    extensions = cythonize(extensions)


class BuildFailed(Exception):
    pass


class ve_build_ext(build_ext):
    # This class allows C extension building to fail.

    def run(self):
        try:
            build_ext.run(self)
        except (DistutilsPlatformError FileNotFoundError):
            raise BuildFailed()

    def build_extension(self ext):
        try:
            build_ext.build_extension(self ext)
        except (CCompilerError DistutilsExecError
                DistutilsPlatformError ValueError):
            raise BuildFailed()



txt = (here / ‘aiohttp‘ / ‘__init__.py‘).read_text(‘utf-8‘)
try:
    version = re.findall(r“^__version__ = ‘([^‘]+)‘\r?$“
                         txt re.M)[0]
except IndexError:
    raise RuntimeError(‘Unable to determine version.‘)

install_requires = [
    ‘attrs>=17.3.0‘
    ‘chardet>=2.0<4.0‘
    ‘multidict>=4.0<5.0‘
    ‘async_timeout>=3.0<4.0‘
    ‘yarl>=1.0<2.0‘
    ‘idna-ssl>=1.0; python_version<“3.7“‘
    ‘typing_extensions>=3.6.5; python_version<“3.7“‘
]


def read(f):
    return (here / f).read_text(‘utf-8‘).strip()


NEEDS_PYTEST = {‘pytest‘ ‘test‘}.intersection(sys.argv)
pytest_runner = [‘pytest-runner‘] if NEEDS_PYTEST else []

tests_require = [
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\
     文件        1323  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.appveyor.yml
     文件         113  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.cherry_picker.toml
     文件         346  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.editorconfig
     文件          69  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.gitattributes
     目录           0  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.github\
     文件         572  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.github\CODEOWNERS
     文件         755  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.github\ISSUE_TEMPLATE.md
     文件        1336  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.github\PULL_REQUEST_TEMPLATE.md
     文件         651  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.gitignore
     文件         125  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.gitmodules
     文件          82  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.pyup.yml
     文件          67  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.readthedocs.yml
     文件        8876  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\.travis.yml
     文件       10001  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\CHANGES.rst
     目录           0  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\CHANGES\
     文件         826  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\CHANGES\.TEMPLATE.rst
     文件          12  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\CHANGES\.gitignore
     文件        3221  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\CODE_OF_CONDUCT.md
     文件         897  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\CONTRIBUTING.rst
     文件        3770  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\CONTRIBUTORS.txt
     文件      113378  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\HISTORY.rst
     文件       11332  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\LICENSE.txt
     文件         394  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\MANIFEST.in
     文件        2935  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\Makefile
     文件        4859  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\README.rst
     目录           0  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\aiohttp\
     文件        4948  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\aiohttp\__init__.py
     文件        3959  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\aiohttp\_cparser.pxd
     文件      189932  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\aiohttp\_find_header.c
     文件         170  2019-01-12 09:39  aio-libs-aiohttp-ac10dfd\aiohttp\_find_header.h
............此处省略227个文件信息

评论

共有 条评论