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 e999281 commit c7c35e0
Show file tree
Hide file tree
Showing 26 changed files with 69 additions and 196 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
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE README.rst
include LICENSE README.md
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
high concurrency [WSGI](http://www.python.org/dev/peps/pep-3333) web
framework with the key features to *build modern, efficient web*:

- Requires Python 2.4-2.7 or 3.2+.
- Requires Python 3.6+.
- MVC architectural pattern
([push](http://en.wikipedia.org/wiki/Web_application_framework#Push-based_vs._pull-based)-based).
- Functionality includes
Expand Down Expand Up @@ -44,9 +44,9 @@ Resources:
## Install

[wheezy.web](https://pypi.org/project/wheezy.web/) 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.web/) 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.web/)
site:

```sh
pip install -U wheezy.web
Expand Down
7 changes: 3 additions & 4 deletions demos/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from wheezy.caching import MemoryCache
from wheezy.caching.patterns import Cached
from wheezy.core.collections import attrdict
from wheezy.core.comp import ntob, u
from wheezy.core.db import NullSession
from wheezy.core.descriptors import attribute
from wheezy.http import CacheProfile, WSGIApplication, response_cache
Expand Down Expand Up @@ -66,7 +65,7 @@ def factory(self, session_name):
def status_response(self):
assert not self.errors
response = HTTPResponse("application/json; charset=UTF-8", "UTF-8")
response.write_bytes(ntob('{"status":"OK"}', "UTF-8"))
response.write_bytes(b'{"status":"OK"}')
return response

def error_response(self, status_code=200):
Expand Down Expand Up @@ -103,8 +102,8 @@ def wraps(self):
# region: models


def Task(other={}): # noqa: N802
return attrdict({"task_id": None, "title": u(""), "status": 1}, **other)
def Task(other={}): # noqa: N802,B006
return attrdict({"task_id": None, "title": "", "status": 1}, **other)


Task.keys = frozenset(Task().keys())
Expand Down
2 changes: 1 addition & 1 deletion demos/api/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"""

import unittest
from json import dumps as json_dumps

from app import main
from wheezy.core.comp import json_dumps
from wheezy.http.functional import WSGIClient

# region: foundation
Expand Down
6 changes: 1 addition & 5 deletions demos/guestbook/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@

from datetime import datetime

from wheezy.core.comp import u


class Greeting(object):
def __init__(
self, id=0, created_on=None, author=u(""), message=u("") # noqa: B008
):
def __init__(self, id=0, created_on=None, author="", message=""):
self.id = id
self.created_on = created_on or datetime.now()
self.author = author
Expand Down
32 changes: 6 additions & 26 deletions demos/quickstart-empty/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import os
import sys

from setuptools import setup

Expand All @@ -19,46 +18,27 @@
"wheezy.web>=0.1.450",
]

install_optional = [
# 'PIL>=1.1.7',
"pycrypto>=2.6.1"
]

if sys.version_info[0] == 2:
install_optional.append("pylibmc<1.3")

install_requires += install_optional

try:
import uuid # noqa
except ImportError:
install_requires.append("uuid")

dependency_links = [
# pylibmc
"https://bitbucket.org/akorn/wheezy.caching/downloads",
# PIL
# 'https://bitbucket.org/akorn/wheezy.captcha/downloads',
# pycrypto
"https://bitbucket.org/akorn/wheezy.security/downloads",
]
dependency_links = []

setup(
name="mysite",
version="0.1",
python_requires=">=3.6",
description="MySite Project",
long_description=README,
url="https://scm.dev.local/svn/mysite/trunk",
author="MySite Team",
author_email="mysite at dev.local",
license="COMMERCIAL",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
Expand Down
32 changes: 6 additions & 26 deletions demos/quickstart-i18n/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import os
import sys

from setuptools import setup

Expand All @@ -19,46 +18,27 @@
"wheezy.web>=0.1.450",
]

install_optional = [
# 'PIL>=1.1.7',
"pycrypto>=2.6.1"
]

if sys.version_info[0] == 2:
install_optional.append("pylibmc<1.3")

install_requires += install_optional

try:
import uuid # noqa
except ImportError:
install_requires.append("uuid")

dependency_links = [
# pylibmc
"https://bitbucket.org/akorn/wheezy.caching/downloads",
# PIL
# 'https://bitbucket.org/akorn/wheezy.captcha/downloads',
# pycrypto
"https://bitbucket.org/akorn/wheezy.security/downloads",
]
dependency_links = []

setup(
name="mysite",
version="0.1",
python_requires=">=3.6",
description="MySite Project",
long_description=README,
url="https://scm.dev.local/svn/mysite/trunk",
author="MySite Team",
author_email="mysite at dev.local",
license="COMMERCIAL",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
Expand Down
6 changes: 5 additions & 1 deletion demos/reusable/hello/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
setup(
name="hello",
version="0.1",
python_requires=">=3.6",
description="Hello Project",
long_description=README,
url="https://scm.dev.local/svn/mysite/trunk",
Expand All @@ -23,7 +24,10 @@
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
Expand Down
6 changes: 5 additions & 1 deletion demos/reusable/world/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
setup(
name="helloworld",
version="0.1",
python_requires=">=3.6",
description="Hello World Project",
long_description=README,
url="https://scm.dev.local/svn/mysite/trunk",
Expand All @@ -22,7 +23,10 @@
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
Expand Down
31 changes: 6 additions & 25 deletions demos/template/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import os
import sys

from setuptools import setup

Expand All @@ -18,33 +17,12 @@
"wheezy.web>=0.1.450",
]

install_optional = [
# 'PIL>=1.1.7',
"pycrypto>=2.6.1"
]

if sys.version_info[0] == 2:
install_optional.append("pylibmc<1.3")

install_requires += install_optional

try:
import uuid # noqa
except ImportError:
install_requires.append("uuid")

dependency_links = [
# pylibmc
"https://bitbucket.org/akorn/wheezy.caching/downloads",
# PIL
# 'https://bitbucket.org/akorn/wheezy.captcha/downloads',
# pycrypto
"https://bitbucket.org/akorn/wheezy.security/downloads",
]
dependency_links = []

setup(
name="mysite",
version="0.1",
python_requires=">=3.6",
description="MySite Project",
long_description=README,
url="https://scm.dev.local/svn/mysite/trunk",
Expand All @@ -56,7 +34,10 @@
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
Expand Down
12 changes: 5 additions & 7 deletions demos/template/src/membership/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

from datetime import date

from wheezy.core.comp import u


def _(s):
return s
Expand All @@ -14,19 +12,19 @@ def _(s):


class Credential(object):
username = u("")
password = u("")
username = ""
password = ""


class Account(object):
email = u("")
display_name = u("")
email = ""
display_name = ""
account_type = "user"


class Registration(object):
question_id = "0"
answer = u("")
answer = ""
date_of_birth = date.min

def __init__(self):
Expand Down
3 changes: 1 addition & 2 deletions demos/template/src/membership/repository/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from config import translations
from membership.repository.contract import IMembershipRepository
from membership.repository.samples import db
from wheezy.core.i18n import ref_gettext
from wheezy.core.introspection import looks

translations = translations.domains["membership"]
Expand All @@ -16,7 +15,7 @@ def __init__(self, session):
session.cursor()

def list_password_questions(self, locale):
gettext = ref_gettext(translations[locale])
gettext = translations[locale].gettext
return tuple((k, gettext(v)) for k, v in db["password_question"])

def authenticate(self, credential):
Expand Down
3 changes: 1 addition & 2 deletions demos/template/src/membership/repository/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from datetime import date

from membership.models import Account, Credential, Registration
from wheezy.core.comp import u


def _(s):
Expand Down Expand Up @@ -49,7 +48,7 @@ def next_registration(question_id="1"):


db = {
"user": {"demo": u("P@ssw0rd"), "biz": u("P@ssw0rd")},
"user": {"demo": "P@ssw0rd", "biz": "P@ssw0rd"},
"user_role": {"demo": ["user"], "biz": ["business"]},
"password_question": (
("1", _("Favorite number")),
Expand Down
3 changes: 1 addition & 2 deletions demos/template/src/membership/service/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from config import translations
from membership.models import Credential, Registration, account_types
from wheezy.core.descriptors import attribute
from wheezy.core.i18n import ref_gettext
from wheezy.validation.mixin import ErrorsMixin

account_types = tuple(dict(account_types).keys())
Expand All @@ -19,7 +18,7 @@ def __init__(self, factory, errors, locale):

@attribute
def gettext(self):
return ref_gettext(translations[self.locale])
return translations[self.locale].gettext

@attribute
def password_questions(self):
Expand Down
Loading

0 comments on commit c7c35e0

Please sign in to comment.