Skip to content

Seek return and pyright - #3

Merged
thatch merged 3 commits into
thatch:mainfrom
zsimic:seek-return-and-pyright
Apr 25, 2026
Merged

thatch merged 3 commits into
thatch:mainfrom
zsimic:seek-return-and-pyright

Conversation

@zsimic

@zsimic zsimic commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Two small quality-of-life changes, bundled since they came up together:

SeekableHttpFile.seek returns the new position

Matches io.IOBase.seek semantics and makes SeekableHttpFile structurally
compatible with zipfile._ZipReadable, so callers can pass it to ZipFile
without a type: ignore.

Add a pyright tox env

New tox -e typecheck runs pyright in standard mode (configured via
pyproject.toml). Narrowed keke Optional access in the two keke tests
with an assert under the existing @skipIf guard — no behavior change.

Comment thread pyproject.toml Outdated
[tool.pyright]
typeCheckingMode = "standard"
useLibraryCodeForTypes = true
reportMissingTypeStubs = false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next step would be to turn on strict mode, and there would be a few more to fix with:

[tool.pyright]
include = ["seekablehttpfile"]
typeCheckingMode = "strict"
useLibraryCodeForTypes = true
reportMissingTypeStubs = "warning"

The include I could change it now actually - it just avoids the warning on setup.py referencing setuptools

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strict mode is also trivial to fix, we can do it in another PR, or I can do this one

@thatch

thatch commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Can you rebase on main and make the strict changes here?

Zoran Simic and others added 3 commits April 22, 2026 09:53
Configured via pyproject.toml [tool.pyright] in standard mode; runs
under new tox -e typecheck. Narrowed keke Optional access in the two
keke tests with an assert under the existing @skipIf guard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Matches io.IOBase.seek semantics and makes SeekableHttpFile
structurally compatible with zipfile._ZipReadable, so callers can
pass it to ZipFile without a type: ignore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zsimic
zsimic force-pushed the seek-return-and-pyright branch from e9ea102 to 1749619 Compare April 22, 2026 17:02
@thatch
thatch merged commit f64e5ad into thatch:main Apr 25, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants