We're updating the issue view to help you get more done. 

isort not properly working in course discovery

Description

isort does not properly work in the course discovery container, but does work on travis. To illustrate what I mean:

After only running `make discovery-shell` in the devstack repository:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 root@discovery:/edx/app/discovery/discovery# make quality isort --check-only --diff --recursive acceptance_tests/ course_discovery/ ERROR: /edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/analytics_api.py Imports are incorrectly sorted. --- /edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/analytics_api.py:before 2019-03-25 20:48:14 +++ /edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/analytics_api.py:after 2019-06-12 13:20:10.334559 @@ -2,10 +2,9 @@ import logging import pytz - +from analyticsclient.client import Client from django.utils.functional import cached_property -from analyticsclient.client import Client from course_discovery.apps.course_metadata.data_loaders import AbstractDataLoader from course_discovery.apps.course_metadata.models import CourseRun Makefile:52: recipe for target 'quality' failed make: *** [quality] Error 1

Then I tried the exact command being run in Travis:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 root@discovery:/edx/app/discovery/discovery# source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make quality isort --check-only --diff --recursive acceptance_tests/ course_discovery/ ERROR: /edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/analytics_api.py Imports are incorrectly sorted. --- /edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/analytics_api.py:before 2019-03-25 20:48:14 +++ /edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/analytics_api.py:after 2019-06-12 13:20:10.334559 @@ -2,10 +2,9 @@ import logging import pytz - +from analyticsclient.client import Client from django.utils.functional import cached_property -from analyticsclient.client import Client from course_discovery.apps.course_metadata.data_loaders import AbstractDataLoader from course_discovery.apps.course_metadata.models import CourseRun Makefile:52: recipe for target 'quality' failed make: *** [quality] Error 1

However, if I'm outside of the container and run

1 2 3 4 ➜ course-discovery git:(ddumesnil/discovery-seats) docker exec -t edx.devstack.discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make quality' isort --check-only --diff --recursive acceptance_tests/ course_discovery/ Skipped 66 files pep8 --config=.pep8 acceptance_tests course_discovery *.py

it will correctly run the quality command.

It would be great to be able to run the make quality command inside of the shell again so all testing and quality checks can be done in the same place.

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Status

Assignee

Unassigned

Reporter

Dillon Dumesnil

Labels

None

Reach

None

Impact

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Stakeholders

None

Story Points

1

Priority

Unset