Conversation
|
How can we achieve this when code-annotations does actually depend on Django? https://github.com/edx/code-annotations/blob/master/code_annotations/find_django.py#L10 |
@regisb thanks for pointing it out. I didn't look in detail as I thought tests would fail but it turns out I was wrong. @jmbowman since |
|
My preference would be to make those imports (and the code using them) fail gracefully when Django is not installed, since there shouldn't be any Django models in a package or service that doesn't depend on Django. Then Django would be an optional dependency of code-annotations rather than a required one. The goal here is to avoid introducing Django as a dependency to all our Python repositories that don't already use it (via the dependency of edx-lint on this package). |
d71b78b to
dfaecfa
Compare
Instead of completely removing the |
|
Can I suggest instead adding an extra requirement to setup.py? https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html?highlight=extras_require#optional-dependencies This allows us to write |
dfaecfa to
7a68dbd
Compare
Added |
regisb
left a comment
There was a problem hiding this comment.
Sorry for the late review!
jmbowman
left a comment
There was a problem hiding this comment.
One optional suggestion for further improvement, otherwise looks good!
| }, | ||
| include_package_data=True, | ||
| install_requires=load_requirements('requirements/base.in'), | ||
| extras_require={"django": ["Django>=2.2,<2.3"]}, |
There was a problem hiding this comment.
Slightly cleaner would be to use something like extras_require={"django": load_requirements('requirements/django.in')}, here, update Makefile to create django.txt from the new input file, and include -r django.txt in requirements/test.in. requirements/django.in would just contain an explanatory comment and the Django>=2.2,<2.3 constraint you have here. This would remove keep Django out of base.in, base.txt, and the core package dependencies while keeping the rest of the requirements files for testing and local development largely unchanged.
There was a problem hiding this comment.
Updated the requirement files as per suggestion.
7a68dbd to
179e164
Compare
179e164 to
302dcfe
Compare
302dcfe to
0103924
Compare
JIRA Issue: BOM-2418
Details:
Moving the
Djangorequirement frombase.intodjango.inbecause:Djangorequirement inbase.incauses thedjangoversion in testeng-ci repo to upgrade todjango==3.1.6which causes failures in different jobs.djangoversions.