Skip to content

Commit

Permalink
Merge pull request #294 from Pylons/py3-only
Browse files Browse the repository at this point in the history
Remove Python 2 support
  • Loading branch information
digitalresistor committed Aug 17, 2020
2 parents 0c29f02 + 0d0163f commit e2adf08
Show file tree
Hide file tree
Showing 40 changed files with 630 additions and 771 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
strategy:
matrix:
py:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
Expand Down Expand Up @@ -56,19 +55,14 @@ jobs:
name: Validate coverage
steps:
- uses: actions/checkout@v2
- name: Setup python 2.7
uses: actions/setup-python@v2
with:
python-version: 2.7
architecture: x64
- name: Setup python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64

- run: pip install tox
- run: tox -e py38,py27,coverage
- run: tox -e py38,coverage
docs:
runs-on: ubuntu-latest
name: Build the documentation
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.0.0 (unreleased)
------------------

- Drop Python 2.7 support

1.4.4 (2020-06-01)
------------------

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ include .coveragerc .flake8
include tox.ini rtd.txt

exclude TODO.txt
prune docs/_build

recursive-exclude * __pycache__ *.py[cod]
13 changes: 7 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ Waitress
:target: https://webchat.freenode.net/?channels=pyramid
:alt: IRC Freenode

Waitress is meant to be a production-quality pure-Python WSGI server with very
acceptable performance. It has no dependencies except ones which live in the
Python standard library. It runs on CPython on Unix and Windows under Python
2.7+ and Python 3.5+. It is also known to run on PyPy 1.6.0+ on UNIX. It
supports HTTP/1.0 and HTTP/1.1.
Waitress is a production-quality pure-Python WSGI server with very acceptable
performance. It has no dependencies except ones which live in the Python
standard library. It runs on CPython on Unix and Windows under Python 3.5+. It
is also known to run on PyPy (version 3.5 compatible) on UNIX. It supports
HTTP/1.0 and HTTP/1.1.

For more information, see the "docs" directory of the Waitress package or visit https://docs.pylonsproject.org/projects/waitress/en/latest/
For more information, see the "docs" directory of the Waitress package or visit
https://docs.pylonsproject.org/projects/waitress/en/latest/
17 changes: 16 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,25 @@ requires = ["setuptools >= 41"]
build-backend = "setuptools.build_meta"

[tool.black]
py36 = false
target-version = ['py35', 'py36', 'py37', 'py38']
exclude = '''
/(
\.git
| .tox
)/
'''

# This next section only exists for people that have their editors
# automatically call isort, black already sorts entries on its own when run.
[tool.isort]
profile = "black"
multi_line_output = 3
src_paths = ["src", "tests"]
skip_glob = ["docs/*"]
include_trailing_comma = true
force_grid_wrap = false
combine_as_imports = true
line_length = 88
force_sort_within_sections = true
default_section = "THIRDPARTY"
known_first_party = "waitress"
11 changes: 3 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = waitress
version = 1.4.4
version = 2.0.0dev0
description = Waitress WSGI server
long_description = file: README.rst, CHANGES.txt
long_description_content_type = text/x-rst
Expand All @@ -12,8 +12,6 @@ classifiers =
Intended Audience :: Developers
License :: OSI Approved :: Zope Public License
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Expand All @@ -39,7 +37,7 @@ maintainer_email = pylons-discuss@googlegroups.com
package_dir=
=src
packages=find:
python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
python_requires = >=3.5.0

[options.entry_points]
paste.server_runner =
Expand All @@ -61,13 +59,10 @@ docs =
docutils
pylons-sphinx-themes>=1.0.9

[bdist_wheel]
universal = 1

[tool:pytest]
python_files = test_*.py
# For the benefit of test_wasyncore.py
python_classes = Test_*
testpaths =
tests
addopts = -W always --cov
addopts = --cov -W always
3 changes: 2 additions & 1 deletion src/waitress/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from waitress.server import create_server
import logging

from waitress.server import create_server


def serve(app, **kw):
_server = kw.pop("_server", create_server) # test shim
Expand Down
15 changes: 5 additions & 10 deletions src/waitress/adjustments.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@
import socket
import warnings

from .compat import HAS_IPV6, WIN
from .proxy_headers import PROXY_HEADERS
from .compat import (
PY2,
WIN,
string_types,
HAS_IPV6,
)

truthy = frozenset(("t", "true", "y", "yes", "on", "1"))

Expand Down Expand Up @@ -52,7 +47,7 @@ def asoctal(s):


def aslist_cronly(value):
if isinstance(value, string_types):
if isinstance(value, str):
value = filter(None, [x.strip() for x in value.splitlines()])
return list(value)

Expand Down Expand Up @@ -100,11 +95,11 @@ class _int_marker(int):
pass


class _bool_marker(object):
class _bool_marker:
pass


class Adjustments(object):
class Adjustments:
"""This class contains tunable parameters.
"""

Expand Down Expand Up @@ -346,7 +341,7 @@ def __init__(self, **kw):
else:
(host, port) = (i, str(self.port))

if WIN and PY2: # pragma: no cover
if WIN: # pragma: no cover
try:
# Try turning the port into an integer
port = int(port)
Expand Down
4 changes: 2 additions & 2 deletions src/waitress/buffers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
STRBUF_LIMIT = 8192


class FileBasedBuffer(object):
class FileBasedBuffer:

remain = 0

Expand Down Expand Up @@ -187,7 +187,7 @@ def append(self, s):
raise NotImplementedError


class OverflowableBuffer(object):
class OverflowableBuffer:
"""
This buffer implementation has four stages:
- No data
Expand Down

0 comments on commit e2adf08

Please sign in to comment.