Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: pre-commit
on:
pull_request:
push:
branches: [master]
branches: [main]

jobs:
pre-commit:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false

matrix:
os: [ubuntu-latest, macos-latest]
pyv: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
pyv: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v6
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ description = "SSH Filesystem -- Async SSH/SFTP backend for fsspec"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.9"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down Expand Up @@ -58,7 +56,7 @@ faulthandler_timeout = 60

[tool.black]
line-length = 79
target-version = ['py39']
target-version = ['py311']

[tool.isort]
atomic = true
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ pytest-asyncio
pytest-cov
pytest-rerunfailures
mock-ssh-server
importlib-metadata >= 6.0.0
7 changes: 3 additions & 4 deletions sshfs/pools/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
from contextlib import AsyncExitStack, suppress
from typing import Optional

from asyncssh.misc import ChannelOpenError

Expand All @@ -16,10 +15,10 @@ def __init__(
self,
client,
*,
max_channels: Optional[int] = None,
timeout: Optional[float] = MAX_TIMEOUT,
max_channels: int | None = None,
timeout: float | None = MAX_TIMEOUT,
unsafe_terminate: bool = True,
sftp_client_kwargs: Optional[dict] = None,
sftp_client_kwargs: dict | None = None,
**kwargs,
):
self.client = client
Expand Down
11 changes: 5 additions & 6 deletions sshfs/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import stat
import weakref
from contextlib import AsyncExitStack, suppress
from datetime import datetime, timezone
from typing import Optional
from datetime import UTC, datetime

import asyncssh
from asyncssh.sftp import SFTPOpUnsupported
Expand Down Expand Up @@ -41,7 +40,7 @@ def __init__(
host,
*,
pool_type=SFTPSoftChannelPool,
sftp_client_kwargs: Optional[dict] = None,
sftp_client_kwargs: dict | None = None,
**kwargs,
):
"""
Expand All @@ -59,7 +58,7 @@ def __init__(
Pool manager to use (when doing concurrent operations together,
pool managers offer the flexibility of prioritizing channels
and deciding which to use).
sftp_client_kwargs: Optional[dict]
sftp_client_kwargs: dict | None
Options passed to `SSHClientConnection.start_sftp_client`
(e.g. env, send_env, path_encoding, path_errors,
sftp_version).
Expand Down Expand Up @@ -181,12 +180,12 @@ def _decode_attributes(self, attributes):
"gid": attributes.gid,
"uid": attributes.uid,
"time": (
datetime.fromtimestamp(attributes.atime, tz=timezone.utc)
datetime.fromtimestamp(attributes.atime, tz=UTC)
if attributes.atime is not None
else None
),
"mtime": (
datetime.fromtimestamp(attributes.mtime, tz=timezone.utc)
datetime.fromtimestamp(attributes.mtime, tz=UTC)
if attributes.mtime is not None
else None
),
Expand Down
6 changes: 3 additions & 3 deletions tests/test_sshfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import tempfile
import warnings
from concurrent import futures
from datetime import datetime, timedelta, timezone
from datetime import UTC, datetime, timedelta
from importlib.metadata import entry_points
from pathlib import Path
from types import SimpleNamespace

import fsspec
import pytest
from asyncssh.sftp import SFTPAttrs, SFTPFailure
from importlib_metadata import entry_points

from sshfs import SSHFileSystem
from sshfs.file import SSHFile
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_info_timestamps_are_tz_aware_utc(fs, remote_dir):
fs.touch(remote_dir + "/a.txt")
details = fs.info(remote_dir + "/a.txt")
for key in ["time", "mtime"]:
assert details[key].tzinfo == timezone.utc
assert details[key].tzinfo == UTC


def test_decode_attributes_missing_timestamps(fs):
Expand Down
Loading