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

package naming is confusing #45

Closed
stefanfoulis opened this Issue Sep 26, 2013 · 20 comments

Comments

Projects
None yet
8 participants
@stefanfoulis

stefanfoulis commented Sep 26, 2013

pypi name is django-redis
python package is redis_cache

there is another pypi package called django-redis-cache

@niwinz

This comment has been minimized.

Owner

niwinz commented Sep 26, 2013

django-redis in the past was fork of django-redis-cache but currently the codebase differs a lot.

redis_cache module name was for module compatibility with django-redis-cache. But you are right, it is still confusing. It would be good idea to change module name and put deprecation waring for the old?

@stefanfoulis

This comment has been minimized.

stefanfoulis commented Sep 26, 2013

yep, that sounds good.

I just had a nightmare debugging an installation where both packages (django-redis and django-redis-cache) where installed. pip uninstalling django-redis-cache still left redis_cache as importable package (the wrong one). It was pretty confusing to find out what was going on.

@niwinz

This comment has been minimized.

Owner

niwinz commented Sep 26, 2013

Thanks! I like the idea, djredis or django_redis are good module name for you? Any suggestions?

@stefanfoulis

This comment has been minimized.

stefanfoulis commented Sep 26, 2013

Are you going planning to add functionality other than cache related stuff?
Because django-redis is a pretty general name if the package only handles caching.

@niwinz

This comment has been minimized.

Owner

niwinz commented Sep 26, 2013

django redis works well as cache, session and raw access to redis connection pool. Seems, cache is not a single purpose for django-redis

@stefanfoulis

This comment has been minimized.

stefanfoulis commented Sep 26, 2013

ok. So I guess django-redis is a fitting name then.
I personally prefer django_redis because it matches the package name.

@niwinz

This comment has been minimized.

Owner

niwinz commented Sep 26, 2013

Thanks!

@BertrandBordage

This comment has been minimized.

Contributor

BertrandBordage commented Nov 26, 2013

👍 for django_redis.

@dencold

This comment has been minimized.

dencold commented Jan 8, 2014

👍 agreed, the namespace should match the PyPI package name. Any plans for this @niwibe?

@niwinz

This comment has been minimized.

Owner

niwinz commented Jan 8, 2014

Yes, I have plans for it, but I don't know the best way to do a transition, mataining some versions (two) a backward compatibility.

@duly

This comment has been minimized.

Contributor

duly commented Mar 28, 2014

One library to use in the transition is Six.
https://pythonhosted.org/six/

@niwinz

This comment has been minimized.

Owner

niwinz commented Mar 28, 2014

Yes, is for python2->python3 transition, but django-redis is already works with python2/3 very well.

This issue talks about package name change of django-redis from "redis_cache" to "django_redis" and is slighty complicated mantaining all backward compatibility on the public module interface ;)

@jorgecarleitao

This comment has been minimized.

Contributor

jorgecarleitao commented Nov 3, 2014

One solution is to have two packages, a redis_cache and a django_redis such that, during deprecation, from redis_cache import ... and from django_redis import ... do the same. (i.e. __init__.py in redis_cache does from django_redis import * and sub-packages.

When installed from pip, both packages are installed.

This allows the deprecation timeline for the redis_cache, potentially with some deprecation warnings in the middle if redis_cache is imported.

@BertrandBordage

This comment has been minimized.

Contributor

BertrandBordage commented Nov 3, 2014

@jorgecarleitao Yes, that’s the best solution. I suggest we write something in setup.py that’ll just make a cp django_redis redis_cache and automatically append to every file:

import warnings
warnings.warn('redis_cache was renamed to django_redis', DeprecationWarning)
@miohtama

This comment has been minimized.

Contributor

miohtama commented Nov 3, 2014

When you are it, the usage of underscore is discouraged in Python PyPi package names (though ok in module names for readability):

http://legacy.python.org/dev/peps/pep-0008/#package-and-module-names

Though the usefulness of this convention is highly debatable and not many packages follow it.

@BertrandBordage

This comment has been minimized.

Contributor

BertrandBordage commented Nov 3, 2014

@miohtama But redis-py – a dependency of django-redis – already uses redis as a package name.

@YAmikep

This comment has been minimized.

YAmikep commented Nov 8, 2014

@niwibe Is the purpose of this package django in general or only caches in django?

@niwinz

This comment has been minimized.

Owner

niwinz commented Nov 9, 2014

@YAmikep the purpose is mainly for cache, sessions and general usage of raw redis connection in django. Django session does not requires new backend implementation because it can use the cache backend for it. In some cases django apps requires a raw redis client access, django redis has facilities for reuse the same connection pool of cache for different purposes.

Thanks to all different ideas. I'll try fix it in one week, I'm currently with very limmited connectivity.

@YAmikep

This comment has been minimized.

YAmikep commented Nov 9, 2014

@niwibe Ok thanks. If the purpose is for general usage of redis with django, something like django_redis Vs. redis_cache would be more appropriated then.

@niwinz

This comment has been minimized.

Owner

niwinz commented Nov 22, 2014

Now commited in master ;) thanks to all!

@niwinz niwinz closed this Nov 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment