diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index 335576b0..4e001265 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/.ruff.toml b/.ruff.toml index bc12246b..f641f2b3 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 c2939bc5..3fef1368 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 @@ -448,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() @@ -464,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() @@ -734,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 @@ -955,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 dc15f56d..4a455bf9 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 diff --git a/pyproject.toml b/pyproject.toml index e58c3443..a3553a17 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 = [