Skip to content
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

Rename installed package directory #2

Closed
jayvdb opened this issue Apr 18, 2019 · 7 comments
Closed

Rename installed package directory #2

jayvdb opened this issue Apr 18, 2019 · 7 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Apr 18, 2019

This installs into directory 'nine', which conflicts with the PyPI package 'nine'.

I've packaged this up as https://build.opensuse.org/package/show/home:jayvdb:django/python-django-nine

where I needed to note that it conflicts with the more commonly used python-nine package.

@barseghyanartur
Copy link
Owner

@jayvdb:

I think this package is currently used more than nine. I made my opinion on the number of downloads per day/week.

But I agree. I can rename the namespace from nine to django_nine.

@jayvdb
Copy link
Contributor Author

jayvdb commented Apr 18, 2019

I agree regarding the usefulness/used-ness, but I guess 'nine' has been around longer, and would have more users except that it was competing with six and the like.

Anyways convention is that package directories should be named close to the PyPI name where possible. Principle of least surprise. Django apps often dont prefix their directories with django_ but they are rarely aiming at high degrees of compatibility - they expect to be installed into a python venv with only django and a few other apps.

This internal rename will need documentation, as callers will need to adjust their import to

try:
    import django_nine
except ImportError:
    import nine as django_nine
    # verify it is the correct one by referencing a name only present in django_nine
    django_nine.foo

@jayvdb
Copy link
Contributor Author

jayvdb commented Apr 18, 2019

Another approach is to also install a compatibility shim in nine , which transparently uses django_nine. OS packagers could then drop that bit. This would give the users a bit of time to adjust to the rename, and then the shim dropped at a later time.

@jayvdb
Copy link
Contributor Author

jayvdb commented Apr 18, 2019

btw https://github.com/spapas/django-package-compatibility-matrix is quite useful , and could be added to the readme here.

Im currently also looking at a bunch of similar packages to see if they hold anything useful. Are you aware of any other similar packages?

@barseghyanartur
Copy link
Owner

barseghyanartur commented Apr 19, 2019

@jayvdb:

A start has been made in v0.2 branch. I'll finish it soon.

Summary/roadmap:

  • Main namespace has been renamed from nine to django_nine. Old namespace is left for compatibility issues, but I'll be displaying a deprecation warning on import attempts. The version 0.2 will still be compatible with 0.1.x.
  • In the 0.3 version (to be released in about a month or two from now) backwards compatibility will be removed.

@barseghyanartur
Copy link
Owner

@jayvdb:

Done in version 0.2. As of 0.2 nine is still present for backwards compatibility. The active namespace is changed from nine to django_nine. In version 0.3 nine will be removed.

@jayvdb
Copy link
Contributor Author

jayvdb commented May 17, 2019

Thanks. https://build.opensuse.org/request/show/703710 submitted to upgrade openSUSE's version.

btw, https://github.com/pakal/django-compat-patcher is now updated to working with Django 2 - a very useful tool.

arteria/django-compat#66 and django-xxx/django-six#1 are still not ready for use.

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

No branches or pull requests

2 participants