Skip to content

Commit

Permalink
Merge pull request #280 from Pylons/bestpractices
Browse files Browse the repository at this point in the history
Updates Waitress to best practices surrounding packaging
  • Loading branch information
digitalresistor committed Apr 17, 2020
2 parents fc4a5eb + a2962ae commit 154fa82
Show file tree
Hide file tree
Showing 57 changed files with 255 additions and 225 deletions.
7 changes: 6 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ concurrency =
multiprocessing
source =
waitress

omit =
waitress/tests/fixtureapps/getline.py

[paths]
source =
src/waitress
*/src/waitress
*/site-packages/waitress

[report]
show_missing = true
precision = 2
36 changes: 36 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Recommended flake8 settings while editing, we use Black for the final linting/say in how code is formatted
#
# pip install flake8 flake8-bugbear
#
# This will warn/error on things that black does not fix, on purpose.
#
# Run:
#
# tox -e run-flake8
#
# To have it automatically create and install the appropriate tools, and run
# flake8 across the source code/tests

[flake8]
# max line length is set to 88 in black, here it is set to 80 and we enable bugbear's B950 warning, which is:
#
# B950: Line too long. This is a pragmatic equivalent of pycodestyle’s E501: it
# considers “max-line-length” but only triggers when the value has been
# exceeded by more than 10%. You will no longer be forced to reformat code due
# to the closing parenthesis being one character too far to satisfy the linter.
# At the same time, if you do significantly violate the line length, you will
# receive a message that states what the actual limit is. This is inspired by
# Raymond Hettinger’s “Beyond PEP 8” talk and highway patrol not stopping you
# if you drive < 5mph too fast. Disable E501 to avoid duplicate warnings.
max-line-length = 80
max-complexity = 12
select = E,F,W,C,B,B9
ignore =
# E123 closing bracket does not match indentation of opening bracket’s line
E123
# E203 whitespace before ‘:’ (Not PEP8 compliant, Python Black)
E203
# E501 line too long (82 > 79 characters) (replaced by B950 from flake8-bugbear, https://github.com/PyCQA/flake8-bugbear)
E501
# W503 line break before binary operator (Not PEP8 compliant, Python Black)
W503
18 changes: 15 additions & 3 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: 3.5
python-version: 3.8
architecture: x64
- run: pip install tox
- run: tox -e py35-cover,py27-cover,coverage
- run: tox -e py38,py27,coverage
docs:
runs-on: ubuntu-latest
name: Build the documentation
Expand All @@ -52,7 +52,19 @@ jobs:
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: 3.5
python-version: 3.8
architecture: x64
- run: pip install tox
- run: tox -e docs
lint:
runs-on: ubuntu-latest
name: Lint the package
steps:
- uses: actions/checkout@master
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- run: pip install tox
- run: tox -e lint
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
env*/
.coverage
.coverage.*
.idea/
.tox/
nosetests.xml
waitress/coverage.xml
dist/
keep/
build/
coverage.xml
nosetests*.xml
py*-cover.xml
docs/_themes
docs/_build
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

21 changes: 21 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
graft src/waitress
graft tests
graft docs
graft .github

include README.rst
include CHANGES.txt
include HISTORY.txt
include RELEASING.txt
include LICENSE.txt
include contributing.md
include CONTRIBUTORS.txt
include COPYRIGHT.txt

include pyproject.toml setup.cfg
include .coveragerc .flake8
include tox.ini rtd.txt

exclude TODO.txt

recursive-exclude * __pycache__ *.py[cod]
27 changes: 0 additions & 27 deletions appveyor.yml

This file was deleted.

4 changes: 0 additions & 4 deletions docs/.gitignore

This file was deleted.

12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[build-system]
requires = ["setuptools >= 41"]
build-backend = "setuptools.build_meta"

[tool.black]
py36 = false
exclude = '''
/(
\.git
| .tox
)/
'''
72 changes: 62 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,67 @@
[easy_install]
zip_ok = false
[metadata]
name = waitress
version = 1.4.4a0
description = Waitress WSGI server
long_description = file: README.rst, CHANGES.txt
long_description_content_type = text/x-rst
keywords = waitress wsgi server http
license = ZPL 2.1
classifiers =
Development Status :: 6 - Mature
Environment :: Web Environment
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
Programming Language :: Python :: 3.7
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Operating System :: OS Independent
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: WSGI
url = https://github.com/Pylons/waitress
author = Zope Foundation and Contributors
author_email = zope-dev@zope.org
maintainer = Pylons Project
maintainer_email = pylons-discuss@googlegroups.com

[nosetests]
match=^test
nocapture=1
cover-package=waitress
cover-erase=1
[options]
package_dir=
=src
packages=find:
python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*

[options.entry_points]
paste.server_runner =
main = waitress:serve_paste
console_scripts =
waitress-serve = waitress.runner:run

[options.packages.find]
where=src

[options.extras_require]
testing =
pytest
pytest-cover
coverage>=5.0

docs =
Sphinx>=1.8.1
docutils
pylons-sphinx-themes>=1.0.9

[bdist_wheel]
universal = 1

[aliases]
dev = develop easy_install waitress[testing]
docs = develop easy_install waitress[docs]
[tool:pytest]
python_files = test_*.py
# For the benefit of test_wasyncore.py
python_classes = Test_*
testpaths =
tests
addopts = -W always --cov --cov-report=term-missing
80 changes: 2 additions & 78 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,79 +1,3 @@
##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import os
from setuptools import setup

from setuptools import find_packages, setup

here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, "README.rst")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
except IOError:
README = CHANGES = ""

docs_extras = [
"Sphinx>=1.8.1",
"docutils",
"pylons-sphinx-themes>=1.0.9",
]

testing_extras = [
"nose",
"coverage>=5.0",
]

setup(
name="waitress",
version="1.4.3",
author="Zope Foundation and Contributors",
author_email="zope-dev@zope.org",
maintainer="Pylons Project",
maintainer_email="pylons-discuss@googlegroups.com",
description="Waitress WSGI server",
long_description=README + "\n\n" + CHANGES,
license="ZPL 2.1",
keywords="waitress wsgi server http",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"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",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Natural Language :: English",
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI",
],
url="https://github.com/Pylons/waitress",
packages=find_packages(),
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
extras_require={"testing": testing_extras, "docs": docs_extras},
include_package_data=True,
test_suite="waitress",
zip_safe=False,
entry_points="""
[paste.server_runner]
main = waitress:serve_paste
[console_scripts]
waitress-serve = waitress.runner:run
""",
)
setup()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions waitress/parser.py → src/waitress/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ParsingError(Exception):
class TransferEncodingNotImplemented(Exception):
pass


class HTTPRequestParser(object):
"""A structure that collects the HTTP request.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 154fa82

Please sign in to comment.