简体   繁体   中英

Why can't I run dev dependencies after `pipenv install --dev`?

My project has django-heroku in its Pipfile as a package .

django-heroku has gunicorn in its Pipfile as a dev-package . See: https://github.com/heroku/django-heroku/blob/master/Pipfile

I would expect that after running pipenv install --dev in my project, I could then run pipenv run gunicorn .

But it throws the following error:

Error: the command gunicorn could not be found within PATH or Pipfile's [scripts].

If dev dependencies aren't available, what's the point of install --dev ?

One answer is that the "dev dependencies" of package X are the packages someone would need if they were developing (as opposed to using) package X.

I would expect that after running pipenv install --dev in my project, ...

If you use pipenv install --dev in your project , pipenv should install all the packages that are required to develop your project.

If it recursively installed all dev dependencies all the way down, it might pull in Python profiling packages, test runners, etc., that other packages need for development. Those wouldn't necessarily be appropriate for someone developing your project.

As an example, if my project listed pytest as a dev dependency , I would be unhappy in pipenv installed nose , which could be listed as an dev depenedency in some other, out-of-date package.

If developers of your package need gunicorn , you should list it explicitly as a dev dependency of your project.

I believe the Pipfile you've linked to is only relevant to the development of this package.

However when the package is installed , it usually relies on setup.py :

REQUIRED = [
    'dj-database-url>=0.5.0', 'whitenoise', 'psycopg2', 'django'
]

As you can see, gunicorn is missing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM