Skip to content

build(deps): bump portalocker from 4.1.0 to 4.3.0 - #84

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/portalocker-4.3.0
Open

build(deps): bump portalocker from 4.1.0 to 4.3.0#84
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/portalocker-4.3.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Aug 31, 2026

Copy link
Copy Markdown
Contributor

Bumps portalocker from 4.1.0 to 4.3.0.

Release notes

Sourced from portalocker's releases.

v4.3.0

4.3.0:

  • The filehandle returned by Lock and RLock is now typed by the open mode (#97): a literal text mode yields IO[str], a literal binary mode IO[bytes], so fh.read() type-checks as str or bytes instead of Any. Both classes are generic over the filehandle (Lock[IO[bytes]]), with a PEP 696 default that keeps a bare Lock annotation valid and equal to Lock[IO[str]], matching the default mode of 'a'. A mode that is not a literal at the call site (a Mode-typed variable, a conditional) falls back to the honest IO[Any] of 4.2.0 through a catch-all overload. TemporaryFileLock and its PidFileLock subclass are pinned to IO[str]. No runtime dependency was added: the type variable default comes from a typing_extensions import that only type checkers see.

  • New portalocker.types.TextMode and portalocker.types.BinaryMode aliases drive the overloads above. portalocker.types.Mode stays a single flat Literal, so typing.get_args(Mode) still returns the mode strings themselves and the mode in typing.get_args(Mode) validation idiom keeps working.

  • Migration notes for the stricter typing, in decreasing order of likelihood that they hit you:

    • A function annotated -> Lock that returns a binary-mode lock now errors on every checker (Lock is invariant and bare Lock means Lock[IO[str]]). Annotate it -> Lock[typing.IO[bytes]].
    • A bare subclass (class MyLock(Lock)) is a text lock. Using it with a binary mode silently yields IO[str] on both mypy and pyright while the runtime hands out bytes, so pin it (class MyLock(Lock[IO[bytes]])) or keep it generic (class MyLock(Lock[IOT])).
    • Strict mypy older than 1.9 (March 2024) does not understand the type variable default and reports "Missing type parameters" on every bare Lock annotation. Strict-mode checking of code using bare Lock needs mypy 1.9 or newer; pyright has understood defaults since early 2023, and non-strict mypy is unaffected.
    • Overrides of the _get_fh, _get_lock and _prepare_fh hooks that copied the 4.2.0 signatures (types.IO) now fail override checks, because the hooks are typed by the class's type variable. Re-type them with the subclass's filehandle type, typing.IO[str] for a bare subclass.
    • A generic subclass cannot call super().__init__(): no overload binds an unsolved type variable. Run the parent initialization through Lock._init, the plain method RLock itself uses.
    • Two runtime-visible side effects, for code that introspects: Lock and RLock accept subscription (Lock[typing.IO[bytes]] raised TypeError on 4.2.0), and RLock.__init__ now initializes through Lock._init instead

... (truncated)

Changelog

Sourced from portalocker's changelog.

4.3.0:

  • The filehandle returned by Lock and RLock is now typed by the open mode (#97): a literal text mode yields IO[str], a literal binary mode IO[bytes], so fh.read() type-checks as str or bytes instead of Any. Both classes are generic over the filehandle (Lock[IO[bytes]]), with a PEP 696 default that keeps a bare Lock annotation valid and equal to Lock[IO[str]], matching the default mode of 'a'. A mode that is not a literal at the call site (a Mode-typed variable, a conditional) falls back to the honest IO[Any] of 4.2.0 through a catch-all overload. TemporaryFileLock and its PidFileLock subclass are pinned to IO[str]. No runtime dependency was added: the type variable default comes from a typing_extensions import that only type checkers see.

  • New portalocker.types.TextMode and portalocker.types.BinaryMode aliases drive the overloads above. portalocker.types.Mode stays a single flat Literal, so typing.get_args(Mode) still returns the mode strings themselves and the mode in typing.get_args(Mode) validation idiom keeps working.

  • Migration notes for the stricter typing, in decreasing order of likelihood that they hit you:

    • A function annotated -> Lock that returns a binary-mode lock now errors on every checker (Lock is invariant and bare Lock means Lock[IO[str]]). Annotate it -> Lock[typing.IO[bytes]].
    • A bare subclass (class MyLock(Lock)) is a text lock. Using it with a binary mode silently yields IO[str] on both mypy and pyright while the runtime hands out bytes, so pin it (class MyLock(Lock[IO[bytes]])) or keep it generic (class MyLock(Lock[IOT])).
    • Strict mypy older than 1.9 (March 2024) does not understand the type variable default and reports "Missing type parameters" on every bare Lock annotation. Strict-mode checking of code using bare Lock needs mypy 1.9 or newer; pyright has understood defaults since early 2023, and non-strict mypy is unaffected.
    • Overrides of the _get_fh, _get_lock and _prepare_fh hooks that copied the 4.2.0 signatures (types.IO) now fail override checks, because the hooks are typed by the class's type variable. Re-type them with the subclass's filehandle type, typing.IO[str] for a bare subclass.
    • A generic subclass cannot call super().__init__(): no overload binds an unsolved type variable. Run the parent initialization through Lock._init, the plain method RLock itself uses.
    • Two runtime-visible side effects, for code that introspects: Lock and RLock accept subscription (Lock[typing.IO[bytes]] raised TypeError on 4.2.0), and RLock.__init__ now initializes through Lock._init instead of calling Lock.__init__, which monkeypatched constructors

... (truncated)

Commits
  • c86f80c reworded the bare-subclass migration note and documented the PAT preflight's ...
  • f3a6dec restored honest typing for dynamic modes, flat get_args(Mode) and a truthful ...
  • 5d8490d removed the temporary sync-master test workflow now that the job is verified
  • 693d94e switched the sync-master push to the SYNC_MASTER_TOKEN fine-grained PAT
  • c30ff15 made the publish workflow fast-forward master to the release tag after publis...
  • ff039b3 typed the Lock filehandle by open mode: text modes yield IO[str], binary mode...
  • a348b7f bumped the version to 4.2.0 and folded the unreleased 4.1.1 section into it
  • d4d66f8 gave the healthy self-check test a CI-proof interval and satisfied codespell
  • eaaef19 added the opt-in self-check heartbeat and fencing tokens (#146)
  • 7170738 honoured the confirm probe verifier's documentation notes (#145)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [portalocker](https://github.com/wolph/portalocker) from 4.1.0 to 4.3.0.
- [Release notes](https://github.com/wolph/portalocker/releases)
- [Changelog](https://github.com/wolph/portalocker/blob/develop/CHANGELOG.rst)
- [Commits](wolph/portalocker@v4.1.0...v4.3.0)

---
updated-dependencies:
- dependency-name: portalocker
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants