From a4014313a07850728445a092ffd9aa3bc1b8bbd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Mon, 26 Jan 2026 12:51:21 +0545 Subject: [PATCH] build: migrate to pyproject.toml and update dependencies - Migrate project metadata from setup.cfg to pyproject.toml (PEP 621) - Remove setup.cfg and setup.py - Update GitHub Actions: checkout v6, setup-python v6, codecov v5 - Update pre-commit hooks: black 26.1.0, isort 5.10.1, mdformat 1.0.0, codespell 2.4.1 - Use mock-ssh-server from PyPI instead of git - Use mdformat_gfm instead of mdformat_tables * Drop support for Python 3.8 --- .github/workflows/pre-commit.yml | 6 ++-- .github/workflows/publish.yml | 6 ++-- .github/workflows/test.yml | 10 +++--- .pre-commit-config.yaml | 10 +++--- pyproject.toml | 59 ++++++++++++++++++++++++++++---- requirements-dev.txt | 2 +- setup.cfg | 36 ------------------- setup.py | 3 -- sshfs/pools/base.py | 3 +- 9 files changed, 70 insertions(+), 65 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 12043bb..63f4c9e 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,8 +9,8 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: - python-version: '3.11' + python-version: '3.14' - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27cba0e..1471307 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v6 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v6 with: - python-version: '3.8' + python-version: '3.14' - name: Install pypa/build run: python -m pip install build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e67ed2..77ba28f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,12 +19,12 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] - pyv: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + pyv: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.pyv }} @@ -38,7 +38,7 @@ jobs: run: python -m pytest --cov-report=xml --cov=. - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1.0.13 + uses: codecov/codecov-action@v5 with: - file: ./coverage.xml + files: ./coverage.xml fail_ci_if_error: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 67fba12..29456ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,23 +2,23 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 26.1.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-isort - rev: v5.5.0 + rev: v5.10.1 hooks: - id: isort additional_dependencies: [toml] - repo: https://github.com/executablebooks/mdformat/ - rev: 0.7.5 + rev: 1.0.0 hooks: - id: mdformat additional_dependencies: - mdformat-black - - mdformat_tables + - mdformat_gfm - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.1 hooks: - id: codespell additional_dependencies: diff --git a/pyproject.toml b/pyproject.toml index 0291543..425bac0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,61 @@ [build-system] -requires = ["setuptools>=48", "setuptools_scm[toml]>=6.3.1"] +requires = ["setuptools>=77", "setuptools_scm[toml]>=8"] build-backend = "setuptools.build_meta" +[project] +name = "sshfs" +description = "SSH Filesystem -- Async SSH/SFTP backend for fsspec" +readme = "README.md" +license = "Apache-2.0" +license-files = ["LICENSE"] +requires-python = ">=3.9" +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", + "Programming Language :: Python :: 3.14", +] +dynamic = ["version"] + +dependencies = [ + "fsspec>=2021.8.1", + "asyncssh>=2.11.0,<3", +] + +[project.optional-dependencies] +bcrypt = ["asyncssh[bcrypt]"] +fido2 = ["asyncssh[fido2]"] +gssapi = ["asyncssh[gssapi]"] +libnacl = ["asyncssh[libnacl]"] +pkcs11 = ["asyncssh[python-pkcs11]"] +pyopenssl = ["asyncssh[pyOpenSSL]"] +pywin32 = ["asyncssh[pywin32]"] + +[project.urls] +Issues = "https://github.com/fsspec/sshfs/issues" +Source = "https://github.com/fsspec/sshfs" + +[project.entry-points."fsspec.specs"] +ssh = "sshfs.spec:SSHFileSystem" +sftp = "sshfs.spec:SSHFileSystem" + +[tool.setuptools.packages.find] +exclude = ["tests", "tests.*"] +namespaces = false + [tool.setuptools_scm] [tool.black] line-length = 79 -target-version = ['py38'] +target-version = ['py39'] [tool.isort] -atomic=true -force_grid_wrap=0 -include_trailing_comma=true -multi_line_output=3 -use_parentheses=true +atomic = true +force_grid_wrap = 0 +include_trailing_comma = true +multi_line_output = 3 +use_parentheses = true diff --git a/requirements-dev.txt b/requirements-dev.txt index 844661d..1b4add2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ pytest pytest-asyncio pytest-cov -mock-ssh-server @ git+https://github.com/skshetry/mock-ssh-server.git@command-queue-race +mock-ssh-server importlib-metadata >= 6.0.0 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1aeb9a7..0000000 --- a/setup.cfg +++ /dev/null @@ -1,36 +0,0 @@ -[metadata] -name = sshfs -description = SSH Filesystem -- Async SSH/SFTP backend for fsspec -license = Apache License 2.0 -long_description = file: README.md -long_description_content_type = text/markdown -classifiers = - Development Status :: 4 - Beta - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - 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 - Programming Language :: Python :: 3.14 - -[options] -install_requires = - fsspec>=2021.8.1 - asyncssh>=2.11.0,<3 -packages = find: - -[options.extras_require] -bcrypt = asyncssh[bcrypt] -fido2 = asyncssh[fido2] -gssapi = asyncssh[gssapi] -libnacl = asyncssh[libnacl] -pkcs11 = asyncssh[python-pkcs11] -pyopenssl = asyncssh[pyOpenSSL] -pywin32 = asyncssh[pywin32] - -[options.entry_points] -fsspec.specs = - ssh = sshfs.spec:SSHFileSystem - sftp = sshfs.spec:SSHFileSystem diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff --git a/sshfs/pools/base.py b/sshfs/pools/base.py index 698f2e7..9363800 100644 --- a/sshfs/pools/base.py +++ b/sshfs/pools/base.py @@ -58,8 +58,7 @@ async def _maybe_new_channel(self): async def get(self): raise NotImplementedError - async def _cleanup(self): - ... + async def _cleanup(self): ... async def close(self): if self.active_channels and not self.unsafe_terminate: