Closed deniz195 closed 3 years ago
Not sure I understand the problem @deniz195 . Django is an absolute dependency for the project - it can't be used without Django, so naturally it is listed in the dependencies in setup.py. That's just the way things work.
Maybe you can tell us why you want to be able to install todo without its prerequisites?
Hi @shacker , of course django-todo
lists django
as (runtime) requirement in setup.py - there is no problem here.
The problem occurs if you try the following:
1) Create an empty virtual environement (e.g. virtualenv env
)
2) In the (empty) virtual environment install via pip install django-todo
Result: An error in the setup.py is raised, since the execution environment of setup.py has django not yet available during installation! Problem: This error does not allow to use django-todo in an automated pipeline such as heroku.
I will make a suggestion for a pull request, which might clarify the situation!
PS: (Tried with pip 21.0.1 from ...\env\lib\site-packages\pip (python 3.8)
)
PPS: On my windows machine, the package will install correctly, despite the error being shown! On heroku not though.
I have not used Heroku before. It sounds like you are not saying that you want to use todo without Django, but only that in the Heroku environment, Django is provided in the path through other means, and does not need to be part of your requirements.txt or other manifest?
I agree, no point using todo without django.
On heroku django is as usual installed via requirements.txt.
I found the bug using heroku, but you can easily reproduce it (without heroku) on your local machine in a clean virtual environment (see above).
I suspect that bug might have become visible with newer python and pip versions. (Possibly older versions have been more forgiving).
Did you check the pull request? #120
@deniz195 I understand the problem now, and your PR makes perfect sense. Thanks a bunch for the contribution!
Merged.
When trying to use django-todo on heroku I find that it cannot be deployed automatically. Why? When installing via
pip -r requirements.txt
on a clean installation thesetup.py
ofdjango-todo
fails, because it tries to import django.I have made a demo repo here:
https://github.com/deniz195/django-todo-fail
I think that setup.py should not make any assumptions on the packages which are installed at install time!