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 f13fee3 commit a2588a3
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 104 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Resources:
## Install

[wheezy.captcha](https://pypi.org/project/wheezy.captcha/) requires
[python](http://www.python.org) version 2.4 to 2.7 or 3.2+. It is
independent of operating system. You can install it from
[python](http://www.python.org) version 3.6+. It is independent of operating
system. You can install it from
[pypi](https://pypi.org/project/wheezy.captcha/) site (you need specify
extra requirements per imaging library of your choice):

Expand Down
3 changes: 2 additions & 1 deletion demos/sample.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
"""

from wheezy.captcha.comp import ascii_uppercase
from string import ascii_uppercase

from wheezy.captcha.image import (
background,
captcha,
Expand Down
7 changes: 3 additions & 4 deletions doc/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ Getting Started
Install
-------

:ref:`wheezy.captcha` requires `python`_ version 2.4 to 2.7 or 3.2+.
It is operating system independent. You can install it from the `pypi`_
site (you need to specify an extra requirements per the imaging library
of your choice)::
:ref:`wheezy.captcha` requires `python`_ version 3.6+. It is operating system
independent. You can install it from the `pypi`_ site (you need to specify
an extra requirements per the imaging library of your choice)::

$ pip install wheezy.captcha
$ pip install wheezy.captcha[PIL]
Expand Down
43 changes: 0 additions & 43 deletions requirements/dev-py2.txt

This file was deleted.

20 changes: 10 additions & 10 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 @@ -14,23 +14,23 @@ mock==4.0.2 # via -r requirements/dev.in
packaging==20.4 # via pytest
pillow==8.0.0; platform_system == 'Windows' and implementation_name == 'pypy' # via -r requirements/dev.in
pillow==8.0.1; platform_system != 'Windows' or implementation_name != 'pypy' # via -r requirements/dev.in
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 wheezy.web
wheezy.core==2.0.0 # via wheezy.http, wheezy.web
wheezy.html==2.0.0 # via wheezy.web
wheezy.http==2.0.0 # via wheezy.web
wheezy.routing==2.0.0 # via wheezy.web
wheezy.security==2.0.0 # via wheezy.web
wheezy.caching==3.0.0 # via wheezy.web
wheezy.core==3.0.0 # via wheezy.http, wheezy.web
wheezy.html==3.0.0 # via wheezy.web
wheezy.http==3.0.0 # via wheezy.web
wheezy.routing==3.0.0 # via wheezy.web
wheezy.security==3.0.0 # via wheezy.web
wheezy.template==3.0.1 # via -r requirements/dev.in
wheezy.validation==2.0.0 # via wheezy.web
wheezy.web==2.0.0 # via -r requirements/dev.in
wheezy.validation==3.0.0 # via wheezy.web
wheezy.web==3.0.0 # via -r requirements/dev.in

# The following packages are considered to be unsafe in a requirements file:
# pip
4 changes: 2 additions & 2 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.3 # via sphinx
sphinxcontrib-serializinghtml==1.1.4 # via sphinx
urllib3==1.26.2 # via requests
wheezy.core==2.0.0 # via wheezy.http
wheezy.http==2.0.0 # via -r requirements/docs.in
wheezy.core==3.0.0 # via wheezy.http
wheezy.http==3.0.0 # via -r requirements/docs.in
wheezy.template==3.0.1 # via -r requirements/docs.in

# The following packages are considered to be unsafe in a requirements file:
Expand Down
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 @@ -39,6 +40,7 @@
setup(
name="wheezy.captcha",
version=VERSION,
python_requires=">=3.6",
description="A lightweight captcha library",
long_description=README,
long_description_content_type="text/markdown",
Expand All @@ -53,16 +55,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
14 changes: 0 additions & 14 deletions src/wheezy/captcha/comp.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
""" ``comp`` module.
"""

import sys

PY3 = sys.version_info[0] >= 3


if PY3: # pragma: nocover
from string import ascii_uppercase

xrange = range
else: # pragma: nocover
from string import uppercase as ascii_uppercase # noqa: F401

xrange = xrange

try: # pragma: nocover
from PIL import Image, ImageFilter
from PIL.ImageColor import getrgb
Expand Down
11 changes: 2 additions & 9 deletions src/wheezy/captcha/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@

import random

from wheezy.captcha.comp import (
Draw,
Image,
ImageFilter,
getrgb,
truetype,
xrange,
)
from wheezy.captcha.comp import Draw, Image, ImageFilter, getrgb, truetype


def captcha(drawings, width=200, height=75):
Expand Down Expand Up @@ -87,7 +80,7 @@ def drawer(image, text):
dy = height / 10
height = height - dy
draw = Draw(image)
for _ in xrange(number):
for _ in range(number):
x = int(random.uniform(dx, width))
y = int(random.uniform(dy, height))
draw.line(((x, y), (x + level, y)), fill=color(), width=level)
Expand Down
8 changes: 2 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
[tox]
envlist = py27,py37,py38,py39,pypy3,lint,docs
envlist = py36,py37,py38,py39,pypy3,lint,docs
skipsdist = True

[testenv]
usedevelop = True
deps =
py27: -r requirements/dev-py2.txt
py37: -r requirements/dev-py3.txt
py38: -r requirements/dev-py3.txt
py39: -r requirements/dev-py3.txt
pypy3: -r requirements/dev-py3.txt
-r requirements/dev.txt
commands =
pytest -q -x --disable-pytest-warnings --doctest-modules \
--cov-report term-missing --cov wheezy.captcha
Expand Down

0 comments on commit a2588a3

Please sign in to comment.