Skip to content

feat: move 'msgpack' to optional dependencies #3526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

waketzheng
Copy link
Contributor

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.

Fixes #3485
It is better to make 'msgpack' as optional dependency.

return base64.b64decode(val)
return obj

class msgpack: # type:ignore[no-redef]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This class is clever, does this ensure both forward and backward compatibility? json loads msgpack content and msgpack loads json content

Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 54.28571% with 16 lines in your changes missing coverage. Please review.

Project coverage is 85.09%. Comparing base (c0fb96d) to head (0562e10).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/pdm/models/serializers.py 54.28% 13 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3526      +/-   ##
==========================================
- Coverage   85.20%   85.09%   -0.12%     
==========================================
  Files         115      115              
  Lines       11768    11800      +32     
  Branches     2591     1935     -656     
==========================================
+ Hits        10027    10041      +14     
- Misses       1190     1205      +15     
- Partials      551      554       +3     
Flag Coverage Δ
unittests 84.96% <54.28%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# For compatibility: loaded by json, while data was dumped by MsgPack
raise PdmException(
"You are trying to load cache that was previous dumped by MsgPack."
'Install it by `pip install "pdm[msgpack]"` then try again, or remove '
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Install it by `pip install "pdm[msgpack]"` then try again, or remove '
'Install it by `pdm self add msgpack` then try again, or remove '

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.

Install error on Windows 11 Chinese Version
2 participants