Skip to content

Commit

Permalink
Merge pull request #216 from zhy1985555/master
Browse files Browse the repository at this point in the history
解决requests和certifi组件不兼容python老版本问题
  • Loading branch information
zhy1985555 authored Jun 13, 2022
2 parents b121579 + 8c5d500 commit 1a4eb8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion qcloud_cos/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '5.1.9.18'
__version__ = '5.1.9.19'
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
certifi<=2021.10.8;python_version<'3.0' # certifi新版本不支持python2,这里需要使用低版本
requests>=2.8
dicttoxml
six
crcmod
Expand Down
21 changes: 19 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
from platform import python_version_tuple
import io
import sys


def requirements():
with open('requirements.txt', 'r') as fileobj:
requirements = [line.strip() for line in fileobj]
requirements = []

# certifi2021.10.8之后的版本不再支持python2和python3.6之前的版本
if sys.version_info.major < 3 or \
(sys.version_info.major == 3 and sys.version_info.minor < 6):
requirements.append('certifi<=2021.10.8')

# requests2.27.1之后的版本不再支持python2和python3.7之前的版本
if sys.version_info.major < 3 or \
(sys.version_info.major == 3 and sys.version_info.minor < 7):
requirements.append('requests>=2.8,<=2.27.1')
else:
requirements.append('requests>=2.8')

requirements.extend([line.strip() for line in fileobj])
return requirements


Expand All @@ -16,7 +33,7 @@ def long_description():

setup(
name='cos-python-sdk-v5',
version='1.9.18',
version='1.9.19',
url='https://www.qcloud.com/',
license='MIT',
author='tiedu, lewzylu, channingliu',
Expand Down

0 comments on commit 1a4eb8c

Please sign in to comment.