Skip to content

Commit

Permalink
Dropped python 3.5 and below.
Browse files Browse the repository at this point in the history
  • Loading branch information
akornatskyy committed Nov 24, 2020
1 parent 13a0a92 commit d1b5787
Show file tree
Hide file tree
Showing 25 changed files with 63 additions and 264 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ language: python

matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 3.6
env: TOXENV=py36
- python: 3.7
env: TOXENV=py37
- python: 3.8
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Resources:
## Install

[wheezy.http](https://pypi.org/project/wheezy.http/) requires
[python](https://www.python.org) version 2.4 to 2.7 or 3.2+. It is
independent of operating system. You can install it from
[pypi](https://pypi.org/project/wheezy.http/) site:
[python](https://www.python.org) version 3.6+. It is independent of operating
system. You can install it from [pypi](https://pypi.org/project/wheezy.http/)
site:

```sh
pip install -U wheezy.http
Expand Down
5 changes: 2 additions & 3 deletions demos/ajax/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"""

import unittest

from wheezy.core.comp import json_dumps
from io import BytesIO
from json import dumps as json_dumps

from wheezy.http.functional import WSGIClient

Expand Down Expand Up @@ -37,7 +37,6 @@ def test_content(self):

def test_stream(self):
if has_json:
from wheezy.http.comp import BytesIO

assert 200 == self.client.ajax_post(
"/",
Expand Down
5 changes: 2 additions & 3 deletions demos/guestbook/guestbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
redirect,
)
from wheezy.http.cache import etag_md5crc32, response_cache
from wheezy.http.comp import ntou
from wheezy.http.middleware import http_cache_middleware_factory
from wheezy.http.transforms import gzip_transform, response_transforms

Expand Down Expand Up @@ -85,8 +84,8 @@ def add_record(request):
else:
form = last_item_adapter(request.query)
greeting = Greeting()
greeting.author = ntou(form["author"].strip(), request.encoding)
m = ntou(form["message"].replace("\r", "").strip(), request.encoding)
greeting.author = form["author"].strip()
m = form["message"].replace("\r", "").strip()
greeting.message = m
greetings.insert(0, greeting)
cache_dependency.delete("greetings")
Expand Down
5 changes: 1 addition & 4 deletions demos/wsgi_adapter/wsgi_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from wheezy.http import CacheProfile, WSGIApplication, bootstrap_http_defaults
from wheezy.http.cache import etag_md5crc32, wsgi_cache
from wheezy.http.comp import b
from wheezy.http.middleware import (
environ_cache_adapter_middleware_factory,
http_cache_middleware_factory,
Expand All @@ -30,9 +29,7 @@
@wsgi_cache(profile=cache_profile)
def welcome(environ, start_response):
start_response("200 OK", [("Content-Type", "text/plain")])
return [
b("Hello World!!!\nThe time is %s" % datetime.now().isoformat(" "))
]
return [b"Hello World!!!\nThe time is %s" % datetime.now().isoformat(" ")]


options = {"wsgi_app": welcome, "http_cache": cache}
Expand Down
4 changes: 2 additions & 2 deletions doc/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Getting Started
Install
-------

:ref:`wheezy.http` requires `python`_ version 2.4 to 2.7 or 3.2+.
It is operating system independent. You can install it from `pypi`_::
:ref:`wheezy.http` requires `python`_ version 3.6+. It is operating system
independent. You can install it from `pypi`_::

$ easy_install wheezy.http

Expand Down
36 changes: 0 additions & 36 deletions requirements/dev-py2.txt

This file was deleted.

8 changes: 4 additions & 4 deletions requirements/dev-py3.txt → requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=requirements/dev-py3.txt requirements/dev.in
# pip-compile --output-file=requirements/dev.txt requirements/dev.in
#
atomicwrites==1.4.0 # via pytest
attrs==20.3.0 # via pytest
Expand All @@ -13,16 +13,16 @@ iniconfig==1.1.1 # via pytest
lxml==4.6.1; implementation_name != 'pypy' # via -r requirements/dev.in
mock==4.0.2 # via -r requirements/dev.in
packaging==20.4 # via pytest
pip-tools==5.3.1 # via -r requirements/dev.in
pip-tools==5.4.0 # via -r requirements/dev.in
pluggy==0.13.1 # via pytest
py==1.9.0 # via pytest
pyparsing==2.4.7 # via packaging
pytest-cov==2.10.1 # via -r requirements/dev.in
pytest==6.1.2 # via -r requirements/dev.in, pytest-cov
six==1.15.0 # via packaging, pip-tools
toml==0.10.2 # via pytest
wheezy.caching==2.0.0 # via -r requirements/dev.in
wheezy.core==2.0.0 # via -r requirements/dev.in
wheezy.caching==3.0.0 # via -r requirements/dev.in
wheezy.core==3.0.0 # via -r requirements/dev.in

# The following packages are considered to be unsafe in a requirements file:
# pip
12 changes: 6 additions & 6 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# pip-compile --output-file=requirements/docs.txt requirements/docs.in
#
alabaster==0.7.12 # via sphinx
babel==2.8.0 # via sphinx
certifi==2020.6.20 # via requests
babel==2.9.0 # via sphinx
certifi==2020.11.8 # via requests
chardet==3.0.4 # via requests
colorama==0.4.4 # via sphinx
docutils==0.16 # via sphinx
Expand All @@ -18,19 +18,19 @@ packaging==20.4 # via sphinx
pygments==2.7.2 # via sphinx
pyparsing==2.4.7 # via packaging
pytz==2020.4 # via babel
requests==2.24.0 # via sphinx
requests==2.25.0 # via sphinx
six==1.15.0 # via packaging
snowballstemmer==2.0.0 # via sphinx
sphinx-rtd-theme==0.5.0 # via -r requirements/docs.in
sphinx==3.3.0 # via sphinx-rtd-theme
sphinx==3.3.1 # via sphinx-rtd-theme
sphinxcontrib-applehelp==1.0.2 # via sphinx
sphinxcontrib-devhelp==1.0.2 # via sphinx
sphinxcontrib-htmlhelp==1.0.3 # via sphinx
sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.3 # via sphinx
sphinxcontrib-serializinghtml==1.1.4 # via sphinx
urllib3==1.25.11 # via requests
wheezy.core==2.0.0 # via -r requirements/docs.in
urllib3==1.26.2 # via requests
wheezy.core==3.0.0 # via -r requirements/docs.in

# The following packages are considered to be unsafe in a requirements file:
# setuptools
12 changes: 2 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
[os.path.join(p, "*.py")],
exclude=os.path.join(p, "__init__.py"),
nthreads=2,
compiler_directives={"language_level": 3},
quiet=True,
)
except ImportError:
Expand All @@ -32,6 +33,7 @@
setup(
name="wheezy.http",
version=VERSION,
python_requires=">=3.6",
description="A lightweight http request-response library",
long_description=README,
long_description_content_type="text/markdown",
Expand All @@ -46,16 +48,6 @@
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.4",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down
3 changes: 2 additions & 1 deletion src/wheezy/http/application.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
""" ``application`` module.
"""

from wheezy.http.comp import reduce
from functools import reduce

from wheezy.http.request import HTTPRequest
from wheezy.http.response import not_found

Expand Down
4 changes: 2 additions & 2 deletions src/wheezy/http/cache.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
""" ``cache`` module
"""

from hashlib import md5
from zlib import crc32

from wheezy.http.cacheprofile import none_cache_profile
from wheezy.http.comp import b, md5


def response_cache(profile=None):
Expand Down Expand Up @@ -93,7 +93,7 @@ def etag(buf):
h = hasher()
for chunk in buf:
h.update(chunk)
return '"%08x"' % (crc32(b(h.hexdigest())) & 0xFFFFFFFF)
return '"%08x"' % (crc32(h.hexdigest().encode("latin1")) & 0xFFFFFFFF)

return etag

Expand Down
130 changes: 0 additions & 130 deletions src/wheezy/http/comp.py

This file was deleted.

0 comments on commit d1b5787

Please sign in to comment.