nephila / djangocms-installer

Console wizard to bootstrap django CMS projects

Home Page:https://djangocms-installer.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Silently downgrades django

matthijskooijman opened this issue · comments

With the default options, the installer tries to install the lts version of django, currently 1.8. It does this by using a less-than version requirement. However, is django is already installed, this causes pip to downgrade django, causing all sorts of breakage for existing projects.

I would say that, if django is already installed and no django version is explicitely specified, using the installed version is probably what the user wants. At least it should ask before silently downgrading packages? I'm not exactly sure how to achieve this, though.

As djangocms-installer goal is to bootstrap new projects (in presumely new virtualenvs), the version managment logic is already quite complex (as it takes into account version dependencies between Django, django CMS and django CMS dependencies) and the django version can be provided (both in the command line version as well as in the wizard) I'd like to minimize the extra logic added here
Maybe trying to import django and doing a version check.
Feel free to contribute a solution and I'll happily review it

@matthijskooijman I think that #339 fixed the issue
We can't prevent downgrades, but we can detect them and alert of any unexpected django version which has been installed

closing this as fixed by #339