Details

    • Type: Story
    • Status: Ungroomed
    • Priority: Unset
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: None
    • Labels:
      None
    • Sprint:

      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:

      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:

      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

      ➜  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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ddumesnil Dillon Dumesnil
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: