question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove django from install_requires in setup.py

See original GitHub issue

Hi. I’d like to propose to remove django package from install_requires in setup.py, because it successfully breaks package updates with pip install -U django-import-export by installing the latest available django version, which is not really desirable in most cases.

Most of mature packages e.g. djangorestframework provide empty install_requires with install_requires=[] to avoid any conflicts.

In my opinion, most users will have django installed before installing django-import-export and I assume that nobody would expect that the django-import-export package would work without django.

References:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
pszpetkowskicommented, Jan 6, 2018

Actually, upgrade can be used without forced recursive upgrade. As http://pip-python3.readthedocs.io/en/latest/user_guide.html#only-if-needed-recursive-upgrade states one can provide --upgrade-strategy with only-if-needed value, which will effectively upgrade a dependency only if it does not satisfy the new parent requirements.

Issue resolved for me.

1reaction
jdufresnecommented, Dec 19, 2017

When I want to upgrade django-import-export, I want to do pip install -U django-import-export, but I don’t expect it to upgrade Django.

TBH, this feels like an issue with how pip works and not an error in the django-import-export list of requirements. I think it would be better to spend effort fixing the issue there instead of suggesting every Django package workaround the issue by not enumerating its requirements correctly. Here is at least one pip related issue, https://github.com/pypa/pip/pull/3194

Do you grab the newest version and pin on requirements manually? This works. But if want to do a pip install -U django-import-export and a pip freeze after, it will not work.

Take a look at pip-tools. It removes the manual pinning process as well as syncs a virtualenv to a strict list of packages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install dependencies from setup.py - Stack Overflow
Just create requirements.txt in your lib folder and add all dependencies like this: gunicorn docutils>=0.3 lxml==0.5a7. Then create a setup.py script and ...
Read more >
A Practical Guide to Using Setup.py - GoDataDriven
The key to setting up your project is the setup.py file. In this blog I'll go into the details of this file. Where...
Read more >
install_requires vs requirements files
install_requires is a setuptools setup.py keyword that should be used to specify what a project minimally needs to run correctly.
Read more >
How to Package Python dependencies with PIP setuptools
Learn step by step how to package a Python project with PIP ... it will install all of the dependencies listed in install_requires....
Read more >
python setup.py uninstall - Intellipaat Community
Instead of using setup.py you should use pip install. You need to remove all the files manually and then undo any changes done...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found