Skip to content

Conversation

@intelfx
Copy link

@intelfx intelfx commented Dec 14, 2025

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

  • Port to hishel 1.0.0
  • Drop custom serializers and related tests
  • Throw together a very dirty thread-safe wrapper around SyncSqliteStorage

Fixes: #3657

@intelfx intelfx marked this pull request as draft December 14, 2025 12:11
@intelfx intelfx force-pushed the work/hishel-1.0 branch 3 times, most recently from fd84e98 to 4bea968 Compare December 14, 2025 18:33
@intelfx intelfx marked this pull request as ready for review December 14, 2025 18:34
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Copy link
Collaborator

@frostming frostming left a comment

Choose a reason for hiding this comment

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

This change is generally good, with some minor tweaks

storage = hishel.FileStorage(serializer=MsgPackSerializer(), base_path=cache_dir, ttl=CACHES_TTL)
controller = hishel.Controller()
# clean up old (pre-hishel 1.0) cache
cache_db = cache_dir / "pdm.db"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like the file to be named http-cache.sqlite

if self.connection is None:
# Create cache directory and resolve full path on first connection
parent = self.database_path.parent if self.database_path.parent != Path(".") else None
full_path = hishel._utils.ensure_cache_dict(parent) / self.database_path.name
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not worth a import from hishel._utils, just use path.mkdir() instead.

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.

hishel 1.0.0 breaks PDM usage

2 participants