[PR #433] hf3fs_utils: fix ExpireType.get_metavar signature #432

Open
opened 2026-10-26 09:50:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/3FS/pull/433
Author: @sebxt
Created: 10/19/2026
Status: 🔄 Open

Base: main ← Head: fix/hf3fs-cli-expire-metavar


📝 Commits (1)

  • dfb693f hf3fs_utils: fix ExpireType.get_metavar signature

📊 Changes

2 files changed (+17 additions, -2 deletions)

View changed files

📝 hf3fs_utils/cli.py (+2 -2)
➕ tests/hf3fs_utils/test_cli.py (+15 -0)

📄 Description

ExpireType.get_metavar took only param, which breaks hf3fs_cli rmtree in two ways:

  • rmtree --help raises TypeError: ... unexpected keyword argument 'ctx' on click 8.2 and newer, since click now passes ctx as well.
  • An unsupported --expire value (for example 2h) raises TypeError: ... missing 1 required positional argument: 'param' on every click version, because convert calls self.get_metavar() with no arguments. The user gets a traceback instead of the usage error.

This change accepts an optional ctx in get_metavar and passes param and ctx from convert. The signature works with both click 8.1 and 8.2+.

Added tests/hf3fs_utils/test_cli.py with two CliRunner tests (help output, invalid expire value). Both fail before the change and pass after it, on click 8.1.7 (invalid expire case) and click 8.5.0 (both cases). Run with:

python -m pytest tests/hf3fs_utils

Fixes #432


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/3FS/pull/433 **Author:** [@sebxt](https://github.com/sebxt) **Created:** 10/19/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/hf3fs-cli-expire-metavar` --- ### 📝 Commits (1) - [`dfb693f`](https://github.com/deepseek-ai/3FS/commit/dfb693f4e32d8c4cd1e43dcc93c12e2c06ec7956) hf3fs_utils: fix ExpireType.get_metavar signature ### 📊 Changes **2 files changed** (+17 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `hf3fs_utils/cli.py` (+2 -2) ➕ `tests/hf3fs_utils/test_cli.py` (+15 -0) </details> ### 📄 Description `ExpireType.get_metavar` took only `param`, which breaks `hf3fs_cli rmtree` in two ways: * `rmtree --help` raises `TypeError: ... unexpected keyword argument 'ctx'` on click 8.2 and newer, since click now passes `ctx` as well. * An unsupported `--expire` value (for example `2h`) raises `TypeError: ... missing 1 required positional argument: 'param'` on every click version, because `convert` calls `self.get_metavar()` with no arguments. The user gets a traceback instead of the usage error. This change accepts an optional `ctx` in `get_metavar` and passes `param` and `ctx` from `convert`. The signature works with both click 8.1 and 8.2+. Added `tests/hf3fs_utils/test_cli.py` with two `CliRunner` tests (help output, invalid expire value). Both fail before the change and pass after it, on click 8.1.7 (invalid expire case) and click 8.5.0 (both cases). Run with: ``` python -m pytest tests/hf3fs_utils ``` Fixes #432 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/3FS#432
No description provided.