django-rest-framework icon indicating copy to clipboard operation
django-rest-framework copied to clipboard

Update documentation on dependency installation

Open cite-reader opened this issue 3 years ago • 1 comments

We depend on pytz, but until late last year we got it implicitly through depending on Django. Since their release 4.0, however, they no longer depend on pytz; commit 250479dc3 added the dependency directly to our metadata in setup.py, but the documentation about dependencies (most importantly, the instructions for new contributors) was left untouched.

This commit updates the new contributor instructions to suggest an "editable installation" of the project at the step that previously had users manually install Django. In this mode, pip fetches and installs the project dependencies automatically (so in the unlikely event we grow another dependency, that doc doesn't need to be changed again) and makes the project available to the virtualenv's python as a normal package, but doesn't require reinstallation for mundane edits.

cite-reader avatar Jul 18 '22 06:07 cite-reader

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 00:09 stale[bot]

I got this error today:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/_pytest/main.py", line 265, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/_pytest/config/__init__.py", line 982, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/tests/conftest.py", line 104, in pytest_configure
INTERNALERROR>     django.setup()
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
INTERNALERROR>     apps.populate(settings.INSTALLED_APPS)
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
INTERNALERROR>     app_config = AppConfig.create(entry)
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/venv/lib/python3.8/site-packages/django/apps/config.py", line 193, in create
INTERNALERROR>     import_module(entry)
INTERNALERROR>   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
INTERNALERROR>     return _bootstrap._gcd_import(name[level:], package, level)
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
INTERNALERROR>   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/tests/importable/__init__.py", line 6, in <module>
INTERNALERROR>     from rest_framework import compat, serializers  # noqa
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/rest_framework/serializers.py", line 29, in <module>
INTERNALERROR>     from rest_framework.fields import get_error_detail, set_value
INTERNALERROR>   File "/home/alfmorais/projetos/django-rest-framework/rest_framework/fields.py", line 30, in <module>
INTERNALERROR>     from pytz.exceptions import InvalidTimeError
INTERNALERROR> ModuleNotFoundError: No module named 'pytz'

running our command pip install -e . works for me.

alfmorais avatar Sep 26 '22 20:09 alfmorais

No objections to this. Thanks.

lovelydinosaur avatar Sep 27 '22 12:09 lovelydinosaur