Skip to content

Commit

Permalink
Bring repo in line with edX standards
Browse files Browse the repository at this point in the history
- Removed unused PEP 257 dependency
- Replaced Pylint with edx-lint
- Updated PEP 8 config file
- Using Make targets to run commands instead of shell script
- Using django-admin instead of copying manage.py file
- Removed unnecessary settings
- Removed unused mocks directory

ECOM-6862
  • Loading branch information
Clinton Blackburn committed Jan 18, 2017
1 parent aec2047 commit 35355a7
Show file tree
Hide file tree
Showing 23 changed files with 260 additions and 357 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
branch = True
source = organizations
omit =
**/__init__.py
**/migrations/*
3 changes: 1 addition & 2 deletions .pep8
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[pep8]
ignore=E501
max_line_length=119
exclude=settings
exclude=migrations
exclude=settings,migrations
260 changes: 0 additions & 260 deletions .pylintrc

This file was deleted.

7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ before_install:
sudo: false

install:
- "pip install -r requirements.txt"
- make requirements
- "pip install coveralls"

script:
- DJANGO_SETTINGS_MODULE=settings coverage run ./manage.py test organizations
- pep8 --config=.pep8 organizations
- pylint --rcfile=.pylintrc organizations --reports=no
- make test
- make quality

after_success: coveralls

Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
clean:
coverage erase
find . -name '*.pyc' -delete

quality:
pep8 --config=.pep8 organizations
pylint --rcfile=pylintrc organizations

requirements:
pip install -e . # Install this package and its dependencies
pip install -r test-requirements.txt

test:
django-admin.py test organizations --settings=test_settings --with-coverage --cover-package=organizations
coverage report

.PHONY: clean, quality, requirements, test
8 changes: 5 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ Usage
Organizations is designed to centralize metadata about course publishers, such as their title, logo URL,
and information included in certificates.

Standalone Testing
------------------
Local Development
-----------------

.. code-block:: bash
$ ./run_tests
$ make requirements
$ make test
$ make quality
Open edX Platform Integration
-----------------------------
Expand Down
10 changes: 0 additions & 10 deletions manage.py

This file was deleted.

4 changes: 2 additions & 2 deletions organizations/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _inactivate_organization(organization):
in internal.Organization.objects.filter(id=organization.id, active=True)]


def _activate_organization_course_relationship(relationship):
def _activate_organization_course_relationship(relationship): # pylint: disable=invalid-name
"""
Activates an inactive organization-course relationship
"""
Expand All @@ -84,7 +84,7 @@ def _activate_organization_course_relationship(relationship):
_activate_record(relationship)


def _inactivate_organization_course_relationship(relationship):
def _inactivate_organization_course_relationship(relationship): # pylint: disable=invalid-name
"""
Inactivates an active organization-course relationship
"""
Expand Down
5 changes: 1 addition & 4 deletions organizations/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# pylint: disable=no-init
# pylint: disable=old-style-class
# pylint: disable=too-few-public-methods
"""
Database ORM models managed by this Django app
Please do not integrate directly with these models!!! This app currently
Expand Down Expand Up @@ -43,7 +40,7 @@ class OrganizationCourse(TimeStampedModel):
organization = models.ForeignKey(Organization, db_index=True)
active = models.BooleanField(default=True)

class Meta:
class Meta(object):
""" Meta class for this Django model """
unique_together = (("course_id", "organization"),)
verbose_name = _('Link Course')
Expand Down
1 change: 0 additions & 1 deletion organizations/tests/mocks/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions organizations/tests/mocks/resources.py

This file was deleted.

0 comments on commit 35355a7

Please sign in to comment.