diff --git a/.travis.yml b/.travis.yml index 7aa0585..533af52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,7 @@ install: - pip install -q Django==$DJANGO_VERSION script: - - pep8 postgres_copy - - pyflakes postgres_copy + - flake8 postgres_copy - coverage run setup.py test after_success: diff --git a/Makefile b/Makefile index 191ceca..362695c 100644 --- a/Makefile +++ b/Makefile @@ -3,5 +3,6 @@ test: clear; + flake8 postgres_copy; coverage run setup.py test; - coverage report -m; + coverage report -m; diff --git a/postgres_copy/__init__.py b/postgres_copy/__init__.py index f7e180b..4c89415 100644 --- a/postgres_copy/__init__.py +++ b/postgres_copy/__init__.py @@ -45,11 +45,14 @@ def __init__( else: self.static_mapping = {} - # Make sure all of the headers in the mapping actually exist in the CSV file + # Make sure all of the headers in the mapping actually exist + # in the CSV file headers = self.get_headers() for map_header in self.mapping.values(): if map_header not in headers: - raise ValueError("Header '%s' in the mapping not found in the CSV file" % map_header) + raise ValueError( + "Header '%s' in mapping not found in CSV file" % map_header + ) # Connect the headers from the CSV with the fields on the model self.field_header_crosswalk = [] @@ -59,8 +62,9 @@ def __init__( try: f_name = inverse_mapping[h] except KeyError: - # If the CSV field is not included on the model map, that's okay, it just means - # the user has decided not to load that column. + # If the CSV field is not included on the model map, + # that's okay, it just means the user has decided not + # to load that column. self.excluded_headers.append(h) pass try: diff --git a/requirements.txt b/requirements.txt index 0edafd4..fa32bd5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ Django coverage -pep8 +flake8 psycopg2 -pyflakes tox python-coveralls sphinx