toasted-marshmallow icon indicating copy to clipboard operation
toasted-marshmallow copied to clipboard

Conflict with marshmallow install

Open samuelcolvin opened this issue 6 years ago • 5 comments

Currently toasted-marshmallow is messing with the marshmallow install and causing errors. I'm pretty sure that modifying other named packages in site-packages/ is pretty bad form.

It should either use the system version of marshmallow (perhaps with constraints on which version) or install a custom version of marshmallow somewhere else.

Current behaviour:

Try uninstalling toasted-marshmallow and you get:

pip uninstall toastedmarshmallow
Uninstalling toastedmarshmallow-0.2.6:
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__init__.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/__init__.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/base.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/class_registry.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/compat.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/decorators.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/exceptions.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/fields.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/marshalling.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/orderedset.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/schema.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/utils.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/__pycache__/validate.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/base.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/class_registry.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/compat.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/decorators.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/exceptions.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/fields.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/marshalling.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/orderedset.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/schema.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/utils.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/marshmallow/validate.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow-0.2.6.dist-info/DESCRIPTION.rst
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow-0.2.6.dist-info/INSTALLER
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow-0.2.6.dist-info/METADATA
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow-0.2.6.dist-info/RECORD
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow-0.2.6.dist-info/WHEEL
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow-0.2.6.dist-info/metadata.json
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow-0.2.6.dist-info/top_level.txt
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/__init__.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/__pycache__/__init__.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/__pycache__/compat.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/__pycache__/jit.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/__pycache__/utils.cpython-36.pyc
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/compat.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/jit.py
  /home/samuel/code/pydantic/env/lib/python3.6/site-packages/toastedmarshmallow/utils.py

In other works toasted-marshmallow is installing it's own version of marshmallow to site-packages/marshmallow, then I'm getting an error if I install the real marshmallow:

from marshmallow import SchemaJit

(I want both marshmallow and toastedmarshmallow installed for my benchmarks of other frameworks)

samuelcolvin avatar Nov 06 '17 15:11 samuelcolvin

+1 on this. Big hinderance when trying to use marshmallow-sqlalchemy in conjunction with toasted marshmallow.

gazure avatar Jan 26 '18 23:01 gazure

+1. Current implementation leads to unpredictable builds and makes it frustrating to use toasted marshmallow.

rrranthony avatar Jan 29 '18 16:01 rrranthony

+1 also running into this bug.

aosyborg avatar Jan 29 '18 17:01 aosyborg

This really is bad practice. You guys should fork marshmallow, not overwrite it. This is not a drop-in replacement for marshmallow - it broke my project (as mentioned above - sqlalchemy-marshmallow). Even when I disabled toasted marshmallow's version of jit, my project was still broken, and I had to force reinstall marshmallow to get it working again. Had I not seen this issue, it may have taken a long time to figure out what happened and how to fix. People's projects may rely on a specific version of marshmallow - how would they know that this project overwrote their marshmallow with it's own specific version?

bitfinity avatar May 04 '18 14:05 bitfinity

Kind of mad this ever happened and madder still that it hasn't been fixed and no one has responded.

Use pydantic instead. It's faster than toasted-marshmallow and more elegant IMHO.

samuelcolvin avatar May 04 '18 16:05 samuelcolvin