Skip to content

πŸ“ docs(descriptor): clarify native lock protocol compatibility - #905

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
boyfeiyu:fix/BOYF-359-descriptor-protocol-docs
Nov 3, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
boyfeiyu:fix/BOYF-359-descriptor-protocol-docs

Conversation

@boyfeiyu

@boyfeiyu boyfeiyu commented Nov 3, 2026

Copy link
Copy Markdown

The descriptor-lock guide currently describes both native backends as one-byte locks and recommends the API for conda-style byte-offset protocols. The implementation uses a whole-file flock on Unix and a one-byte LockFileEx range at offset 0 on Windows; seeking the descriptor does not select a different range.

Clarify that contract in the guide and API docstring, and replace the interoperability recommendation with the requirement to match the existing protocol's primitive and range. Conda's offset-21 protocol illustrates why the API is not a portable replacement. The Unix explanation accounts for operating-system and filesystem differences in flock/lockf interaction. Add a documentation changelog fragment.

Validation on macOS 27.2 arm64, Python 3.15.2:

  • tox -e docs (Sphinx -W), with generated how-to, API and Unreleased content checked.
  • Changed-file pre-commit checks and release-creator validate-news --base main.
  • python -m pytest tests/test_filelock.py -k descriptor: 23 passed, 500 deselected.
  • AST comparison confirms that executable code is unchanged; a cross-process probe checked local descriptor contention and byte-range controls.

Windows behavior was checked against the source and documented API contract, not executed. The local probe is not a conda integration test or a cross-platform test suite.

@gaborbernat
gaborbernat enabled auto-merge (squash) November 3, 2026 15:53
@gaborbernat
gaborbernat disabled auto-merge November 3, 2026 16:28
@gaborbernat
gaborbernat merged commit 2ac1e92 into tox-dev:main Nov 3, 2026
50 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