awesto / cookiecutter-django-shop

Cookiecutter django-SHOP is a blueprint for an e-commerce site based on django-CMS.
127 stars 55 forks source link

Remove old DRF<3.9 requirement in Pipfile #20

Closed greyhare closed 4 years ago

greyhare commented 4 years ago

What happened?

pipenv install --sequential failed with the following message:

ERROR: ERROR: Could not find a version that matches djangorestframework<3.11,<3.9,<4,>=3.1.3,>=3.5,>=3.7,>=3.9

What should've happened instead?

Locking [dev-packages] dependencies…
✔ Success! 
Locking [packages] dependencies…
✔ Success! 
Updated Pipfile.lock (0d19e8)!
Installing dependencies from Pipfile.lock (0d19e8)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 60/60 — 00:00:47
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

Steps to reproduce

MacOS, MacPorts, up-to-date, cookiecutter, autopep8, and pipenv installed with pip install --user.

  1. cookiecutter https://github.com/awesto/cookiecutter-django-shop
  2. cd my-shop
  3. pipenv install --sequential

Recommended fix

Remove line 32 in cookiecutter-django-shop/{{cookiecutter.project_slug}}/Pipfile:

djangorestframework = "<3.9"

This line is unneeded since djangorestframework is a declared dependency of django-shop==1.1.1 as shown by pipenv graph. This fixed the problem on my system.

jrief commented 4 years ago

Ups, happens after upgrading to 1.1.1.

greyhare commented 4 years ago

Why is it (and many others) specified in Pipfile when it'll be pulled in by dependencies?

jrief commented 4 years ago

Why is it (and many others) specified in Pipfile when it'll be pulled in by dependencies?

I don't understand your question.

greyhare commented 4 years ago

The whole point of pipenv is to let you cut requirements down to what you actually need, so you don't have to list every dependency of a dependency in a requirements.txt file like with plain old pip. So it seems like requirements like djangorestframework = "*" are redundant here.

greyhare commented 4 years ago

In other words, it seems like django-shop would be a better authority on what djangorestframework is required than cookiecutter-django-shop.

jrief commented 4 years ago

You're right. I'll change that in the next version.