-
大小: 867KB文件類型: .zip金幣: 2下載: 1 次發(fā)布日期: 2021-06-17
- 語(yǔ)言: Python
- 標(biāo)簽:
資源簡(jiǎn)介
aiohttp 一個(gè)用于asyncio和Python的異步HTTP客戶端/服務(wù)器

代碼片段和文件信息
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(‘a(chǎn)iohttp._websocket‘?[‘a(chǎn)iohttp/_websocket‘?+?ext])
??????????????Extension(‘a(chǎn)iohttp._http_parser‘
????????????????????????[‘a(chǎn)iohttp/_http_parser‘?+?ext
?????????????????????????‘vendor/http-parser/http_parser.c‘
?????????????????????????‘a(chǎn)iohttp/_find_header.c‘]
????????????????????????define_macros=[(‘HTTP_PARSER_STRICT‘?0)]
????????????????????????)
??????????????Extension(‘a(chǎn)iohttp._frozenlist‘
????????????????????????[‘a(chǎn)iohttp/_frozenlist‘?+?ext])
??????????????Extension(‘a(chǎn)iohttp._helpers‘
????????????????????????[‘a(chǎn)iohttp/_helpers‘?+?ext])
??????????????Extension(‘a(chǎn)iohttp._http_writer‘
????????????????????????[‘a(chǎn)iohttp/_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?/?‘a(chǎn)iohttp‘?/?‘__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?=?[
????‘a(chǎn)ttrs>=17.3.0‘
????‘chardet>=2.0<4.0‘
????‘multidict>=4.0<5.0‘
????‘a(chǎn)sync_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?=?[
????
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????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個(gè)文件信息
評(píng)論
共有 條評(píng)論