Skip to content

Commit da58cd2

Browse files
authored
Drop support for Python 3.5 (#777)
1 parent d08a9b8 commit da58cd2

File tree

10 files changed

+12
-69
lines changed

10 files changed

+12
-69
lines changed

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,10 @@ jobs:
7272
runs-on: ${{matrix.os }}
7373
strategy:
7474
matrix:
75-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
75+
python-version: [3.6, 3.7, 3.8, 3.9]
7676
os: [ubuntu-20.04, macos-latest, windows-latest]
7777
arch: [x86_64]
7878
exclude:
79-
# Python 3.5 is unable to properly
80-
# find the recent VS tooling
81-
# https://bugs.python.org/issue30389
82-
- os: windows-latest
83-
python-version: 3.5
8479
- os: windows-latest
8580
arch: aarch64
8681
- os: macos-latest

‎.github/workflows/tests.yml‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ jobs:
1717
# job.
1818
strategy:
1919
matrix:
20-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
21-
os: [ubuntu-latest, macos-latest, windows-latest]
22-
exclude:
23-
# Python 3.5 is unable to properly
24-
# find the recent VS tooling
25-
# https://bugs.python.org/issue30389
26-
- os: windows-latest
27-
python-version: 3.5
20+
python-version: [3.6, 3.7, 3.8, 3.9]
21+
os: [ubuntu-latest, macos-latest, windows-latest]
2822

2923
runs-on: ${{matrix.os }}
3024

‎README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ of PostgreSQL server binary protocol for use with Python's ``asyncio``
1313
framework. You can read more about asyncpg in an introductory
1414
`blog post <http://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python/>`_.
1515

16-
asyncpg requires Python 3.5 or later and is supported for PostgreSQL
16+
asyncpg requires Python 3.6 or later and is supported for PostgreSQL
1717
versions 9.5 to 13. Older PostgreSQL versions or other databases implementing
1818
the PostgreSQL protocol *may* work, but are not being actively tested.
1919

‎asyncpg/compat.py‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,15 @@
66

77

88
importasyncio
9-
importfunctools
10-
importos
119
importpathlib
1210
importplatform
1311
importsys
1412

1513

16-
PY_36=sys.version_info>= (3, 6)
1714
PY_37=sys.version_info>= (3, 7)
1815
SYSTEM=platform.uname().system
1916

2017

21-
ifsys.version_info< (3, 5, 2):
22-
defaiter_compat(func):
23-
@functools.wraps(func)
24-
asyncdefwrapper(self):
25-
returnfunc(self)
26-
returnwrapper
27-
else:
28-
defaiter_compat(func):
29-
returnfunc
30-
31-
32-
ifPY_36:
33-
fspath=os.fspath
34-
else:
35-
deffspath(path):
36-
fsp=getattr(path, '__fspath__', None)
37-
iffspisnotNoneandcallable(fsp):
38-
path=fsp()
39-
ifnotisinstance(path, (str, bytes)):
40-
raiseTypeError(
41-
'expected{}() to return str or bytes, not{}'.format(
42-
fsp.__qualname__, type(path).__name__
43-
))
44-
returnpath
45-
elifisinstance(path, (str, bytes)):
46-
returnpath
47-
else:
48-
raiseTypeError(
49-
'expected str, bytes or path-like object, not{}'.format(
50-
type(path).__name__
51-
)
52-
)
53-
54-
5518
ifSYSTEM=='Windows':
5619
importctypes.wintypes
5720

‎asyncpg/connection.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
importcollections.abc
1212
importfunctools
1313
importitertools
14+
importos
1415
importsys
1516
importtime
1617
importtraceback
@@ -957,7 +958,7 @@ def _format_copy_opts(self, *, format=None, oids=None, freeze=None,
957958

958959
asyncdef_copy_out(self, copy_stmt, output, timeout):
959960
try:
960-
path=compat.fspath(output)
961+
path=os.fspath(output)
961962
exceptTypeError:
962963
# output is not a path-like object
963964
path=None
@@ -996,7 +997,7 @@ async def _writer(data):
996997

997998
asyncdef_copy_in(self, copy_stmt, source, timeout):
998999
try:
999-
path=compat.fspath(source)
1000+
path=os.fspath(source)
10001001
exceptTypeError:
10011002
# source is not a path-like object
10021003
path=None
@@ -1027,7 +1028,6 @@ async def _copy_in(self, copy_stmt, source, timeout):
10271028
iffisnotNone:
10281029
# Copying from a file-like object.
10291030
class_Reader:
1030-
@compat.aiter_compat
10311031
def__aiter__(self):
10321032
returnself
10331033

‎asyncpg/cursor.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
importcollections
99

10-
from . importcompat
1110
from . importconnresource
1211
from . importexceptions
1312

@@ -48,7 +47,6 @@ def __init__(
4847
ifstateisnotNone:
4948
state.attach()
5049

51-
@compat.aiter_compat
5250
@connresource.guarded
5351
def__aiter__(self):
5452
prefetch=50ifself._prefetchisNoneelseself._prefetch
@@ -206,7 +204,6 @@ def __init__(
206204
self._prefetch=prefetch
207205
self._timeout=timeout
208206

209-
@compat.aiter_compat
210207
@connresource.guarded
211208
def__aiter__(self):
212209
returnself

‎docs/index.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation
1414
of PostgreSQL server binary protocol for use with Python's ``asyncio``
1515
framework.
1616

17-
**asyncpg** requires Python 3.5 or later and is supported for PostgreSQL
17+
**asyncpg** requires Python 3.6 or later and is supported for PostgreSQL
1818
versions 9.5 to 13.
1919

2020
Contents

‎setup.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
importsys
99

10-
ifsys.version_info< (3, 5):
11-
raiseRuntimeError('asyncpg requires Python 3.5 or greater')
10+
ifsys.version_info< (3, 6):
11+
raiseRuntimeError('asyncpg requires Python 3.6 or greater')
1212

1313
importos
1414
importos.path
@@ -259,7 +259,6 @@ def finalize_options(self):
259259
'Operating System :: MacOS :: MacOS X',
260260
'Operating System :: Microsoft :: Windows',
261261
'Programming Language :: Python :: 3 :: Only',
262-
'Programming Language :: Python :: 3.5',
263262
'Programming Language :: Python :: 3.6',
264263
'Programming Language :: Python :: 3.7',
265264
'Programming Language :: Python :: 3.8',
@@ -268,7 +267,7 @@ def finalize_options(self):
268267
'Topic :: Database :: Front-Ends',
269268
],
270269
platforms=['macOS', 'POSIX', 'Windows'],
271-
python_requires='>=3.5.0',
270+
python_requires='>=3.6.0',
272271
zip_safe=False,
273272
author='MagicStack Inc',
274273
author_email='[email protected]',

‎tests/test_copy.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
importasyncpg
1515
fromasyncpgimport_testbaseastb
16-
fromasyncpgimportcompat
1716

1817

1918
classTestCopyFrom(tb.ConnectedTestCase):
@@ -467,7 +466,6 @@ class _Source:
467466
def__init__(self):
468467
self.rowcount=0
469468

470-
@compat.aiter_compat
471469
def__aiter__(self):
472470
returnself
473471

@@ -507,7 +505,6 @@ class _Source:
507505
def__init__(self):
508506
self.rowcount=0
509507

510-
@compat.aiter_compat
511508
def__aiter__(self):
512509
returnself
513510

@@ -533,7 +530,6 @@ class _Source:
533530
def__init__(self):
534531
self.rowcount=0
535532

536-
@compat.aiter_compat
537533
def__aiter__(self):
538534
returnself
539535

@@ -564,7 +560,6 @@ def __init__(self, loop):
564560
self.rowcount=0
565561
self.loop=loop
566562

567-
@compat.aiter_compat
568563
def__aiter__(self):
569564
returnself
570565

0 commit comments

Comments
(0)