nephila / djangocms-installer

Console wizard to bootstrap django CMS projects
https://djangocms-installer.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
177 stars 78 forks source link

add pipenv support #341

Open oshanz opened 5 years ago

oshanz commented 5 years ago

djangocms-installer can be installed using pipenv. also, the project can create successfully. however, if you look into the Pipfile there is nothing new, but requirements.txt file includes all the necessary dependencies. from #328

yakky commented 5 years ago

probably we can add a option which will trigger pipenv functions to convert requirements.txt file to Pipfile but I can't find any better approach than pipenv lock && pipenv --rm which is a bit silly I'm open to suggestions

oshanz commented 5 years ago

how about if pipenv exists, then just skip putting requirements.txt file and install requirements through pipenv. which will eventually define those in Pipfile

pipenv install --dev 'packageA<=2.*', 'packageB==1.2'

yakky commented 5 years ago

the requirements management is the most complex part of the installer and I'm worried that having a completely different way to manage would make it very brittle, but I will give your suggestion a try

yakky commented 5 years ago

@oshanz the proposed way seems workable Could you give it a test to the linked PR?

oshanz commented 5 years ago

great!! everything is working fine. however, I notice that pipenv dependency installation is somewhat slow. maybe that's how it is.

$ pipenv --python 3.6
$ pipenv install -e git+https://github.com/nephila/djangocms-installer.git@feature/pipenv#egg=djangocms-installer
$ time pipenv run djangocms app1
## this creates a funtional project using requirements.txt
real    1m4.662s
user    0m26.224s
sys 0m0.773s
$ time pipenv run djangocms app2 --pipenv $(which pipenv)
## Pipfile is there, everyting is functional
real    3m31.270s
user    2m13.679s
sys 0m9.966s

@yakky Good job! hope to see this in the next release. :clinking_glasses:

yakky commented 5 years ago

I haven't really used pipenv in more complex setups, by I think the higher time to install is expected, as pipenv needs to build the dependencies graph and resolve eventual conflicts, and we provide a lot of dependencies for it to build its list Providing the generated requirements file to both pip and pipenv should result in a similar time skew As far as installation process is involved, installer just invokes the installation executable with the list of package to install

oshanz commented 5 years ago

yes, that's true. let's close this ticket. Thanks :)