From 444d990df2e4b9343c413a0f25d6204364eccfb0 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 26 Jan 2026 15:13:31 +0000 Subject: [PATCH 1/3] no return in finally --- parfive/downloader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/parfive/downloader.py b/parfive/downloader.py index c2939bc..63718b5 100644 --- a/parfive/downloader.py +++ b/parfive/downloader.py @@ -317,8 +317,7 @@ async def run_download(self): task.cancel() dl_results = await asyncio.gather(*tasks, return_exceptions=True) - finally: - return self._format_results(dl_results, main_pb) + return self._format_results(dl_results, main_pb) def _format_results(self, retvals, main_pb): # Squash all nested lists into a single flat list From 890ab26674fef4cb270854b8b1e3eb05a96f1d84 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 26 Jan 2026 15:13:56 +0000 Subject: [PATCH 2/3] Ruff --- .ruff.toml | 2 -- parfive/downloader.py | 8 ++++---- parfive/utils.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index bc12246..f641f2b 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -46,8 +46,6 @@ extend-ignore = [ "F403", "F821", "F841", - # pyupgrade (UP) - "UP038", # Use | in isinstance - not compatible with models and is slower # pytest (PT) "PT001", # Always use pytest.fixture() "PT023", # Always use () on pytest decorators diff --git a/parfive/downloader.py b/parfive/downloader.py index 63718b5..3fef136 100644 --- a/parfive/downloader.py +++ b/parfive/downloader.py @@ -447,7 +447,7 @@ async def _run_http_download(self, main_pb): try: # Wait for all the coroutines to finish - done, _ = await asyncio.wait(futures) + _done, _ = await asyncio.wait(futures) except asyncio.CancelledError: for task in futures: task.cancel() @@ -463,7 +463,7 @@ async def _run_ftp_download(self, main_pb): try: # Wait for all the coroutines to finish - done, _ = await asyncio.wait(futures) + _done, _ = await asyncio.wait(futures) except asyncio.CancelledError: for task in futures: task.cancel() @@ -733,7 +733,7 @@ async def _get_http( return url, str(filepath) - except (Exception, asyncio.CancelledError) as e: + except (Exception, asyncio.CancelledError) as e: # noqa: BLE001 for task in tasks: task.cancel() # We have to cancel the writer here before we try and remove the @@ -954,7 +954,7 @@ async def _get_ftp( return url, str(filepath) - except (Exception, asyncio.CancelledError) as e: + except (Exception, asyncio.CancelledError) as e: # noqa: BLE001 if writer is not None: await cancel_task(writer) writer = None diff --git a/parfive/utils.py b/parfive/utils.py index dc15f56..4a455bf 100644 --- a/parfive/utils.py +++ b/parfive/utils.py @@ -67,7 +67,7 @@ def default_name(path: os.PathLike, resp: aiohttp.ClientResponse, url: str) -> o if resp: cdheader = resp.headers.get("Content-Disposition", None) if cdheader: - value, params = parse_header(cdheader) + _value, params = parse_header(cdheader) name = params.get("filename", url_filename) else: name = url_filename From d97847d4cfe8c7de320d1eb0006a1b142a8ee6fe Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 26 Jan 2026 15:17:27 +0000 Subject: [PATCH 3/3] Drop support for python 3.9 as it's now EOL --- .github/workflows/ci_workflows.yml | 12 ++++++------ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index 335576b..4e00126 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -25,12 +25,12 @@ jobs: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: envs: | - - linux: py39 - - macos: py310 - - windows: py311 - - linux: py312 - - linux: py313 - - linux: py313-devdeps + - linux: py310 + - linux: py311 + - macos: py312 + - windows: py313 + - linux: py314 + - linux: py314-devdeps - linux: py312-conda toxdeps: tox-conda - linux: mypy diff --git a/pyproject.toml b/pyproject.toml index e58c344..a3553a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "parfive" description = "A HTTP and FTP parallel file downloader." -requires-python = ">=3.9" +requires-python = ">=3.10" readme = { file = "README.rst", content-type = "text/x-rst" } license = { file = "LICENSE" } authors = [