Skip to content

Commit d8e76e5

Browse files
authored
Merge pull request #511 from leancloud/environment-mark
fix: conditional dependencies for Python 2
2 parents 3e9e48a + e6d6ffc commit d8e76e5

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919

2020
jobs:
2121
lint:
22-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-20.04
2323
steps:
2424
- uses: actions/checkout@v2
2525
- name: Set up Python
@@ -39,7 +39,7 @@ jobs:
3939
flake8 . --count --exit-zero --statistics
4040
4141
test:
42-
runs-on: ubuntu-latest
42+
runs-on: ubuntu-20.04
4343
strategy:
4444
max-parallel: 1
4545
matrix:

.github/workflows/pythonpublish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
deploy:
1212

13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-20.04
1414

1515
steps:
1616
- uses: actions/checkout@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Maybe you need the `sudo` prefix depends on your OS environment.
2020

2121
## Supported Python Versions
2222

23-
Python 2.7 and Python 3.6+.
23+
Python 2.7.18 and Python 3.6+.
2424

2525
## Generate API document
2626

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ requests>=2.25.1
77
Werkzeug>=0.16.0,<=2.0.0
88
secure-cookie>=0.1.0,<1.0.0
99
gevent>=21.1.0,<22.0.0
10+
typing; python_version < '3.5'

setup.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,18 @@
66
here = path.abspath(path.dirname(__file__))
77

88
install_requires = [
9+
"arrow>=0.17.0,<1.0.0; python_version < '3.6'",
10+
"arrow>=1.0.0,<2.0.0; python_version >= '3.6'",
911
'iso8601>=0.1.14',
1012
'six>=1.11.0',
1113
'qiniu>=7.1.4,<7.2.4',
1214
'requests>=2.25.1',
1315
'Werkzeug>=0.16.0,<=2.0.0',
1416
'secure-cookie>=0.1.0,<1.0.0',
15-
'gevent>=21.1.0,<22.0.0'
17+
'gevent>=21.1.0,<22.0.0',
18+
"typing; python_version < '3.5'"
1619
]
1720

18-
if sys.version_info < (3, 6, 0):
19-
install_requires.append('arrow>=0.17.0,<1.0.0')
20-
else:
21-
install_requires.append('arrow>=1.0.0,<2.0.0')
22-
23-
if sys.version_info < (3, 5, 0):
24-
install_requires.append('typing')
25-
26-
if sys.version_info < (2, 7, 9):
27-
install_requires.append('pyOpenSSL')
28-
install_requires.append('idna')
29-
3021
setup(
3122
name='leancloud',
3223
version='2.9.1',

0 commit comments

Comments
 (0)