Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
fix pep8 and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam committed Dec 8, 2017
1 parent 3ef8458 commit d53042b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion collectfast/etag.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def get_file_hash(storage, path):
file_hash = cache.get(cache_key, False)
if file_hash is False:
buffer = BytesIO()
zf = gzip.GzipFile(mode='wb', compresslevel=6, fileobj=buffer, mtime=0.0)
zf = gzip.GzipFile(
mode='wb', compresslevel=6, fileobj=buffer, mtime=0.0)
zf.write(force_bytes(contents))
zf.close()
file_hash = hashlib.md5(buffer.getvalue()).hexdigest()
Expand Down
3 changes: 2 additions & 1 deletion collectfast/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def override_storage_attr(name, value):
def decorator(fn):
@functools.wraps(fn)
def wrapper(*args, **kwargs):
storage = import_string(getattr(django_settings, 'STATICFILES_STORAGE'))
storage = import_string(
getattr(django_settings, 'STATICFILES_STORAGE'))
original = getattr(storage, name)
setattr(storage, name, value)
ret = fn(*args, **kwargs)
Expand Down
7 changes: 5 additions & 2 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@

def main():
parser = OptionParser()
parser.add_option("--DATABASE_ENGINE", dest="DATABASE_ENGINE", default="sqlite3")
parser.add_option(
"--DATABASE_ENGINE", dest="DATABASE_ENGINE", default="sqlite3")
parser.add_option("--DATABASE_NAME", dest="DATABASE_NAME", default="")
parser.add_option("--DATABASE_USER", dest="DATABASE_USER", default="")
parser.add_option("--DATABASE_PASSWORD", dest="DATABASE_PASSWORD", default="")
parser.add_option(
"--DATABASE_PASSWORD", dest="DATABASE_PASSWORD", default="")
parser.add_option("--TEST", dest="TEST_SUITE", default=None)

options, args = parser.parse_args()
Expand Down Expand Up @@ -88,5 +90,6 @@ def main():
shutil.rmtree(staticfiles_dir)
shutil.rmtree(staticroot_dir)


if __name__ == "__main__":
main()
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
setup(
name='Collectfast',
description='A Faster Collectstatic',
version='0.5.2',
version='0.6.0',
long_description=open('README.rst').read(),
author='Anton Agestam',
author_email='msn@antonagestam.se',
Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 --ignore=E722 collectfast
commands = flake8 collectfast runtests.py setup.py
[flake8]
max-line-length = 80
ignore = F403,E265,E722
exclude = .git
max-complexity = 8

0 comments on commit d53042b

Please sign in to comment.