From be0ea57c38acec0640625aa5e9144b9f42c75ecd Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Wed, 28 Sep 2016 18:31:46 -0400 Subject: v1.5.3 --- mimeparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mimeparse.py b/mimeparse.py index 897b2df..d8de40c 100644 --- a/mimeparse.py +++ b/mimeparse.py @@ -1,6 +1,6 @@ import cgi -__version__ = '1.5.2' +__version__ = '1.5.3' __author__ = 'Joe Gregorio' __email__ = 'joe@bitworking.org' __license__ = 'MIT License' -- cgit v1.2.1 From e756ef12ebad95a7a3ebe72bbca51c24c6509418 Mon Sep 17 00:00:00 2001 From: Adam Chainz Date: Mon, 10 Oct 2016 14:35:03 +0100 Subject: Remove __init__.py (#29) --- __init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 __init__.py diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29..0000000 -- cgit v1.2.1 From 0fe5cefcfa7c7a6ecfb47d6a22142533961727ab Mon Sep 17 00:00:00 2001 From: Adam Chainz Date: Mon, 10 Oct 2016 14:58:46 +0100 Subject: Release as a universal wheel (#28) --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..2a9acf1 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 -- cgit v1.2.1 From 7465c20a1575611cd5ed7aff776ba4d6ab450524 Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Mon, 10 Oct 2016 10:00:09 -0400 Subject: v1.5.4 --- mimeparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mimeparse.py b/mimeparse.py index d8de40c..919b19b 100644 --- a/mimeparse.py +++ b/mimeparse.py @@ -1,6 +1,6 @@ import cgi -__version__ = '1.5.3' +__version__ = '1.5.4' __author__ = 'Joe Gregorio' __email__ = 'joe@bitworking.org' __license__ = 'MIT License' -- cgit v1.2.1 From ef975bccae1e659e8036e5f64a44fded3c188935 Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Mon, 10 Oct 2016 10:04:27 -0400 Subject: v1.5.5 --- mimeparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mimeparse.py b/mimeparse.py index 919b19b..7794341 100644 --- a/mimeparse.py +++ b/mimeparse.py @@ -1,6 +1,6 @@ import cgi -__version__ = '1.5.4' +__version__ = '1.5.5' __author__ = 'Joe Gregorio' __email__ = 'joe@bitworking.org' __license__ = 'MIT License' -- cgit v1.2.1 From 17556a53b5657ac7d2eb4991509e89880b31ec1f Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Mon, 10 Oct 2016 11:20:25 -0400 Subject: ignore build/ and venv/ dirs --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ab08119..357fe14 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .tox *.egg-info dist/ +build/ +venv/ -- cgit v1.2.1 From 3a28e27ba16a2dedd9617ac2836352dd8b5683ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 10 Oct 2016 18:21:03 +0300 Subject: flake8 tweaks (#27) --- .travis.yml | 2 +- mimeparse_test.py | 13 +++++++++---- setup.py | 2 +- tox.ini | 13 +++++-------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20935de..f458847 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ env: - TOXENV=py34 - TOXENV=pypy - TOXENV=pypy3 - - TOXENV=pep8,pyflakes + - TOXENV=flake8 # https://github.com/travis-ci/travis-ci/issues/4794 matrix: diff --git a/mimeparse_test.py b/mimeparse_test.py index 6d00238..da39312 100755 --- a/mimeparse_test.py +++ b/mimeparse_test.py @@ -6,9 +6,10 @@ This module loads a json file and converts the tests specified therein to a set of PyUnitTestCases. Then it uses PyUnit to run them and report their status. """ import json -import mimeparse import unittest +import mimeparse + __version__ = "0.1" __author__ = 'Ade Oshineye' @@ -36,15 +37,19 @@ class MimeParseTestCase(unittest.TestCase): def _test_best_match(self, args, expected, description): if expected is None: - self.assertRaises(mimeparse.MimeTypeParseException, mimeparse.best_match, args[0], args[1]) + self.assertRaises(mimeparse.MimeTypeParseException, + mimeparse.best_match, args[0], args[1]) else: result = mimeparse.best_match(args[0], args[1]) - message = "Expected: '%s' but got %s. Description for this test: %s" % (expected, result, description) + message = \ + "Expected: '%s' but got %s. Description for this test: %s" % \ + (expected, result, description) self.assertEqual(expected, result, message) def _test_parse_mime_type(self, args, expected): if expected is None: - self.assertRaises(mimeparse.MimeTypeParseException, mimeparse.parse_mime_type, args) + self.assertRaises(mimeparse.MimeTypeParseException, + mimeparse.parse_mime_type, args) else: expected = tuple(expected) result = mimeparse.parse_mime_type(args) diff --git a/setup.py b/setup.py index e0ba146..cc081a0 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -import os import codecs +import os import re from setuptools import setup diff --git a/tox.ini b/tox.ini index 62c1338..7977fbe 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35,py34,py32,py27,pypy,pypy3,pep8,pyflakes +envlist = py35,py34,py32,py27,pypy,pypy3,flake8 [testenv] commands = ./mimeparse_test.py @@ -22,10 +22,7 @@ basepython = pypy [testenv:pypy3] basepython = pypy3 -[testenv:pep8] -deps = pep8 -commands = pep8 --statistics --show-source --ignore=E501 --exclude=.venv,.tox,*egg . - -[testenv:pyflakes] -deps = pyflakes -commands = pyflakes mimeparse.py mimeparse_test.py setup.py +[testenv:flake8] +deps = flake8 + flake8-import-order +commands = flake8 --statistics --show-source --ignore=E501 --exclude=.venv,.tox,*egg . -- cgit v1.2.1 From 566632cb3591e2fe3371bd446b46f28ea961caf3 Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Tue, 11 Oct 2016 14:53:01 -0400 Subject: ignore .venv instead of venv --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 357fe14..eee4038 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ *.egg-info dist/ build/ -venv/ +.venv/ -- cgit v1.2.1 From dec410e29d35d7e3da4df6892e463de77027fd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 11 Oct 2016 21:56:04 +0300 Subject: Ignore more dirs in flake8 tests (#31) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7977fbe..2a88dd3 100644 --- a/tox.ini +++ b/tox.ini @@ -25,4 +25,4 @@ basepython = pypy3 [testenv:flake8] deps = flake8 flake8-import-order -commands = flake8 --statistics --show-source --ignore=E501 --exclude=.venv,.tox,*egg . +commands = flake8 --statistics --show-source --ignore=E501 --exclude=.venv,.tox,*egg,*.egg-info,build,dist . -- cgit v1.2.1 From cc268be21c2deb3fb327cdbd06349d735cef245f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 11 Oct 2016 23:23:15 +0300 Subject: Run PyPy tests with pypy-5.4 on Travis (#30) --- .travis.yml | 3 ++- tox.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f458847..cda7cc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,14 @@ python: env: - TOXENV=py27 - TOXENV=py34 - - TOXENV=pypy - TOXENV=pypy3 - TOXENV=flake8 # https://github.com/travis-ci/travis-ci/issues/4794 matrix: include: + - python: pypy-5.4 + env: TOXENV=pypy - python: 3.5 env: TOXENV=py35 diff --git a/tox.ini b/tox.ini index 2a88dd3..efdf5ff 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,8 @@ envlist = py35,py34,py32,py27,pypy,pypy3,flake8 [testenv] -commands = ./mimeparse_test.py +commands = python --version + ./mimeparse_test.py [testenv:py35] basepython = python3.5 -- cgit v1.2.1 From d87c40f7116c2f3ba0538d5eee465c2eec63c3f6 Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Sun, 16 Oct 2016 18:24:32 -0400 Subject: more readable formatting of test data --- testdata.json | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/testdata.json b/testdata.json index cd655c8..64785c4 100644 --- a/testdata.json +++ b/testdata.json @@ -15,31 +15,52 @@ "quality": [ [ - ["text/html;level=1", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], + [ + "text/html;level=1", + "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" + ], 1 ], [ - ["text/html", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], + [ + "text/html", + "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" + ], 0.7 ], [ - ["text/plain", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], + [ + "text/plain", + "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" + ], 0.3 ], [ - ["image/jpeg", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], + [ + "image/jpeg", + "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" + ], 0.5 ], [ - ["text/html;level=2", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], + [ + "text/html;level=2", + "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" + ], 0.4 ], [ - ["text/html;level=3", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], + [ + "text/html;level=3", + "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" + ], 0.7 ], [ - ["text/plain", "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"], + [ + "text/plain", + "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + ], 0.2 ] ], -- cgit v1.2.1