Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Upgrade from deprecated library to its replacement #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlanCoding
Copy link
Member

https://pypi.org/project/msgpack-python/

This package is deprecated. Install msgpack instead.

The problem I had is that I was getting unexpected import warnings. Replace locally with this project folder:

$ python -W error -c "from asgi_amqp import core"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/alancoding/Documents/repos/asgi_amqp/asgi_amqp/__init__.py", line 5, in <module>
    from .core import AMQPChannelLayer # noqa
  File "/Users/alancoding/Documents/repos/asgi_amqp/asgi_amqp/core.py", line 9, in <module>
    import msgpack
  File "/Users/alancoding/.virtualenvs/asgi_amqp_py3/lib/python3.6/site-packages/msgpack/__init__.py", line 25, in <module>
    from msgpack._packer import Packer
  File "msgpack/_packer.pyx", line 8, in init msgpack._packer
ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__

I would write a test for this, but unfortunately this is a warning that pytest itself filters out, and I can't find a way to un-suppress that warning.

After upgrading the dependency and re-installing, I do find that python -W error -c "from asgi_amqp import core" runs and exists without error.

@AlanCoding
Copy link
Member Author

The reason I think this is a good idea is because kombu itself has moved to the new library:

https://github.com/celery/kombu/blob/master/setup.py#L122

The commit where this switch was made:

celery/kombu@9883a30

Kombu will still take an existing install of the old library as dependency resolution is done, but I want to upgrade to resolve the warning.

@wwitzel3
Copy link
Contributor

👍

@wwitzel3
Copy link
Contributor

wwitzel3 commented Feb 4, 2020

msgpack-python is officially deprecated. Please review and merge this PR when there is time.

@@ -36,7 +36,7 @@
install_requires=[
'six',
'kombu>=3.0.35',
'msgpack-python>=0.4.7',
'msgpack>=0.6.1',
Copy link
Member Author

Choose a reason for hiding this comment

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

now on 0.6.2

@wwitzel3
Copy link
Contributor

wwitzel3 commented Feb 4, 2020

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants