Skip to content

Commit f4bac5c

Browse files
committed
drop python 3.6
3.6 has reached the EOL. fsspec (along with pydata) dropped support for it early 2021, but we brought it back for dvc in #575.
1 parent 00b8123 commit f4bac5c

File tree

9 files changed

+6
-36
lines changed

9 files changed

+6
-36
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
TOXENV: [py36, py37, py38, py39, s3fs, gcsfs]
16+
TOXENV: [py37, py38, py39, s3fs, gcsfs]
1717

1818
env:
1919
TOXENV: ${{ matrix.TOXENV }}

fsspec/asyn.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .callbacks import _DEFAULT_CALLBACK
1313
from .exceptions import FSTimeoutError
1414
from .spec import AbstractFileSystem
15-
from .utils import PY36, is_exception, other_paths
15+
from .utils import is_exception, other_paths
1616

1717
private = re.compile("_[^_]")
1818

@@ -29,12 +29,6 @@ async def _runner(event, coro, result, timeout=None):
2929
event.set()
3030

3131

32-
if PY36:
33-
grl = asyncio.events._get_running_loop
34-
else:
35-
grl = asyncio.events.get_running_loop
36-
37-
3832
def sync(loop, func, *args, timeout=None, **kwargs):
3933
"""
4034
Make loop run coroutine until it returns. Runs in other thread
@@ -45,7 +39,7 @@ def sync(loop, func, *args, timeout=None, **kwargs):
4539
if loop is None or loop.is_closed():
4640
raise RuntimeError("Loop is not running")
4741
try:
48-
loop0 = grl()
42+
loop0 = asyncio.events.get_running_loop()
4943
if loop0 is loop:
5044
raise NotImplementedError("Calling sync() from within a running loop")
5145
except RuntimeError:
@@ -790,9 +784,6 @@ def _dump_running_tasks(
790784
):
791785
import traceback
792786

793-
if PY36:
794-
raise NotImplementedError("Do not call this on Py 3.6")
795-
796787
tasks = [t for t in asyncio.tasks.all_tasks(loop[0]) if not t.done()]
797788
if printout:
798789
[task.print_stack() for task in tasks]

fsspec/implementations/tests/test_http.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,6 @@ def test_async_other_thread(server):
516516
loop.call_soon_threadsafe(loop.stop)
517517

518518

519-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no asyncio.run in py36")
520519
def test_async_this_thread(server):
521520
async def _():
522521
fs = fsspec.filesystem("http", asynchronous=True)
@@ -565,7 +564,6 @@ def test_processes(server, method):
565564

566565

567566
@pytest.mark.parametrize("get_client", [get_aiohttp, get_proxy])
568-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no asyncio.run in <3.7")
569567
def test_close(get_client):
570568
fs = fsspec.filesystem("http", skip_instance_cache=True)
571569
fs.close_session(None, asyncio.run(get_client()))

fsspec/implementations/tests/test_local.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,6 @@ def test_open_files_text_mode(encoding):
182182
@pytest.mark.parametrize("mode", ["rt", "rb"])
183183
@pytest.mark.parametrize("fmt", list(compression.compr))
184184
def test_compressions(fmt, mode, tmpdir):
185-
if fmt == "zip" and sys.version_info < (3, 6):
186-
pytest.xfail("zip compression requires python3.6 or higher")
187-
188185
tmpdir = str(tmpdir)
189186
fn = os.path.join(tmpdir, ".tmp.getsize")
190187
fs = LocalFileSystem()

fsspec/tests/test_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import contextlib
44
import os
55
import pickle
6-
import sys
76
import tempfile
87

98
import pytest
@@ -213,7 +212,6 @@ def test_multilevel_chained_fs():
213212
assert f.read().decode("utf-8") == f.name
214213

215214

216-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no seek in old zipfile")
217215
def test_multilevel_chained_fs_zip_zip_file():
218216
"""This test reproduces fsspec/filesystem_spec#334"""
219217
import zipfile

fsspec/tests/test_async.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
import inspect
33
import os
4-
import sys
54
import time
65

76
import pytest
@@ -18,7 +17,6 @@ def test_sync_methods():
1817
assert not inspect.iscoroutinefunction(inst.info)
1918

2019

21-
@pytest.mark.skipif(fsspec.asyn.PY36, reason="missing asyncio features o py36")
2220
def test_interrupt():
2321
loop = fsspec.asyn.get_loop()
2422

@@ -46,32 +44,27 @@ async def _dummy_async_func(self):
4644
dummy_func = fsspec.asyn.sync_wrapper(_dummy_async_func)
4745

4846

49-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no asyncio.run in <3.7")
5047
def test_sync_wrapper_timeout_on_less_than_expected_wait_time_not_finish_function():
5148
test_obj = _DummyAsyncKlass()
5249
with pytest.raises(fsspec.FSTimeoutError):
5350
test_obj.dummy_func(timeout=0.1)
5451

5552

56-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no asyncio.run in <3.7")
5753
def test_sync_wrapper_timeout_on_more_than_expected_wait_time_will_finish_function():
5854
test_obj = _DummyAsyncKlass()
5955
assert test_obj.dummy_func(timeout=5)
6056

6157

62-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no asyncio.run in <3.7")
6358
def test_sync_wrapper_timeout_none_will_wait_func_finished():
6459
test_obj = _DummyAsyncKlass()
6560
assert test_obj.dummy_func(timeout=None)
6661

6762

68-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no asyncio.run in <3.7")
6963
def test_sync_wrapper_treat_timeout_0_as_none():
7064
test_obj = _DummyAsyncKlass()
7165
assert test_obj.dummy_func(timeout=0)
7266

7367

74-
@pytest.mark.skipif(sys.version_info < (3, 7), reason="no asyncio.run in <3.7")
7568
def test_run_coros_in_chunks(monkeypatch):
7669
total_running = 0
7770

fsspec/tests/test_file.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tests abstract buffered file API, using FTP implementation"""
22
import pickle
3-
import sys
43

54
import pytest
65

@@ -9,10 +8,6 @@
98
data = b"hello" * 10000
109

1110

12-
@pytest.mark.xfail(
13-
sys.version_info < (3, 6),
14-
reason="py35 error, see https://github.com/fsspec/filesystem_spec/issues/147",
15-
)
1611
def test_pickle(ftp_writable):
1712
host, port, user, pw = ftp_writable
1813
ftp = FTPFileSystem(host=host, port=port, username=user, password=pw)

fsspec/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from urllib.parse import urlsplit
1111

1212
DEFAULT_BLOCK_SIZE = 5 * 2 ** 20
13-
PY36 = sys.version_info < (3, 7)
1413

1514

1615
def infer_storage_options(urlpath, inherit_storage_options=None):
@@ -301,8 +300,8 @@ def stringify_path(filepath):
301300
302301
Notes
303302
-----
304-
Objects supporting the fspath protocol (Python 3.6+) are coerced
305-
according to its __fspath__ method.
303+
Objects supporting the fspath protocol are coerced according to its
304+
__fspath__ method.
306305
307306
For backwards compatibility with older Python version, pathlib.Path
308307
objects are specially coerced.

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"Intended Audience :: Developers",
1919
"License :: OSI Approved :: BSD License",
2020
"Operating System :: OS Independent",
21-
"Programming Language :: Python :: 3.6",
2221
"Programming Language :: Python :: 3.7",
2322
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
@@ -32,7 +31,7 @@
3231
license="BSD",
3332
keywords="file",
3433
packages=["fsspec", "fsspec.implementations"],
35-
python_requires=">=3.6",
34+
python_requires=">=3.7",
3635
install_requires=open("requirements.txt").read().strip().split("\n"),
3736
extras_require={
3837
"entrypoints": ["importlib_metadata ; python_version < '3.8' "],

0 commit comments

Comments
 (0)