-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
mashumaro explodes when used as a vendor'd install #60
Comments
Hi @alinsavix It could be replaced with something like this: DataClassDictMixinPath = f"{__name__.rsplit('.', 2)[:-2][0]}.serializer.base.dict.DataClassDictMixin" I could make this change next week. |
Verified, this does indeed solve the problem (and seems to do so across several different usage scenarios). Excellent. Will definitely look forward to seeing this fix rolled in, when you have the opportunity to do so. Thanks for the quick response! |
Fixed in develop branch |
Fixed in 2.9.1. |
1 task
<3 |
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a project where I am installing mashumaro in a "vendor" subdirectory (via pdistx) for use by my code; because of the environment the code is running in, installing mashumaro globally is not an option, neither is updating PYTHON_PATH or similar. This means that my import line in my code ends up needing to look like:
from vendor.mashumaro import DataClassJSONMixin
Setting up the vendor directory (see reproduction steps below) and running the following script:
...results in the following stack trace:
This appears to happen because of the following hardcoded class name in
meta/helpers.py
:...which is no longer correct when the code is run in this way (the correct path would be
vendor.mashumaro.serializer.base.dict.DataClassDictMixin
).I'm not sure what the best way to fix this is, but in the extremely short term I'm able to patch the class name for my specific use case. It would be great if I was able to vendor an install without having to edit it afterwards!
Reproduction steps:
pdistx vendor -r requirements.txt vendor
. This will create a 'vendor' subdirectory with mashumaro and its dependenciesThanks for the excellent tool!
The text was updated successfully, but these errors were encountered: