Skip to content

Commit

Permalink
Merge pull request #33 from Pylons/drop-py2
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalresistor authored May 16, 2022
2 parents 6f29744 + 0fae4f8 commit d7dbb23
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 105 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build and test

on:
# Only on pushes to master or one of the release branches we build on push
push:
branches:
- master
- "[0-9].[0-9]+-branch"
tags:
# Build pull requests
pull_request:

jobs:
test:
strategy:
matrix:
py:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "pypy-3.7"
os:
- "ubuntu-latest"
# - "windows-latest"
- "macos-latest"
architecture:
- x64
- x86
exclude:
# Linux and macOS don't have x86 python
- os: "ubuntu-latest"
architecture: x86
- os: "macos-latest"
architecture: x86
name: "Python: ${{ matrix.py }}-${{ matrix.architecture }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.architecture }}
- run: pip install tox
- name: Running tox
run: tox -e py
# coverage:
# runs-on: ubuntu-latest
# name: Validate coverage
# steps:
# - uses: actions/checkout@v2
# - name: Setup python 3.10
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# architecture: x64

# - run: pip install tox
# - run: tox -e py310,coverage
docs:
runs-on: ubuntu-latest
name: Build the documentation
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64
- run: pip install tox
- run: tox -e docs
# lint:
# runs-on: ubuntu-latest
# name: Lint the package
# steps:
# - uses: actions/checkout@v2
# - name: Setup python
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# architecture: x64
# - run: pip install tox
# - run: tox -e lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ htmlcov
.eggs
build
dist
env*
tests/fake_packages/FakeApp.egg/EGG-INFO
13 changes: 0 additions & 13 deletions .hgignore

This file was deleted.

25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Paste Deployment News
=====================

unreleased
----------

* Drop support for Python 2, as well as 3.4, 3.5, and 3.6.

2.1.1 (2020-10-12)
------------------

Expand Down
32 changes: 0 additions & 32 deletions paste/deploy/compat.py

This file was deleted.

7 changes: 2 additions & 5 deletions paste/deploy/converters.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
from paste.deploy.compat import basestring


truthy = frozenset(['true', 'yes', 'on', 'y', 't', '1'])
falsy = frozenset(['false', 'no', 'off', 'n', 'f', '0'])


def asbool(obj):
if isinstance(obj, basestring):
if isinstance(obj, str):
obj = obj.strip().lower()
if obj in truthy:
return True
Expand All @@ -27,7 +24,7 @@ def asint(obj):


def aslist(obj, sep=None, strip=True):
if isinstance(obj, basestring):
if isinstance(obj, str):
lst = obj.split(sep)
if strip:
lst = [v.strip() for v in lst]
Expand Down
14 changes: 7 additions & 7 deletions paste/deploy/loadwsgi.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
from __future__ import with_statement
from configparser import ConfigParser
import os
import sys
import pkg_resources
import re
import sys
from urllib.parse import unquote

import pkg_resources

from paste.deploy.compat import ConfigParser, unquote, iteritems, dictkeys
from paste.deploy.util import fix_call, lookup_object

__all__ = ['loadapp', 'loadserver', 'loadfilter', 'appconfig']
Expand Down Expand Up @@ -70,7 +70,7 @@ def defaults(self):
Mainly to support defaults using values such as %(here)s
"""
defaults = ConfigParser.defaults(self).copy()
for key, val in iteritems(defaults):
for key, val in defaults.items():
defaults[key] = self.get('DEFAULT', key) or val
return defaults

Expand Down Expand Up @@ -400,7 +400,7 @@ def __init__(self, filename):
self.parser.read_file(f)

def update_defaults(self, new_defaults, overwrite=True):
for key, value in iteritems(new_defaults):
for key, value in new_defaults.items():
if not overwrite and key in self.parser._defaults:
continue
self.parser._defaults[key] = value
Expand Down Expand Up @@ -660,7 +660,7 @@ def find_egg_entry_point(self, object_type, name=None):
dist.location,
', '.join(_flatten(object_type.egg_protocols)),
', '.join(_flatten([
dictkeys(pkg_resources.get_entry_info(self.spec, prot, name) or {})
list((pkg_resources.get_entry_info(self.spec, prot, name) or {}).keys())
for prot in protocol_options] or '(no entry points)'))))
if len(possible) > 1:
raise LookupError(
Expand Down
10 changes: 4 additions & 6 deletions paste/deploy/paster_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from paste.script.templates import Template

from paste.deploy.compat import print_


class PasteDeploy(Template):

Expand All @@ -30,7 +28,7 @@ def post(self, command, output_dir, vars):
' main = %(package)s.wsgiapp:make_app\n') % vars,
indent=False)
if command.verbose:
print_('*' * 72)
print_('* Run "paster serve docs/devel_config.ini" to run the sample application')
print_('* on http://localhost:8080')
print_('*' * 72)
print('*' * 72)
print('* Run "paster serve docs/devel_config.ini" to run the sample application')
print('* on http://localhost:8080')
print('*' * 72)
4 changes: 1 addition & 3 deletions paste/deploy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import inspect
import sys

from paste.deploy.compat import reraise


def fix_type_error(exc_info, callable, varargs, kwargs):
"""
Expand Down Expand Up @@ -55,7 +53,7 @@ def fix_call(callable, *args, **kw):
val = callable(*args, **kw)
except TypeError:
exc_info = fix_type_error(None, callable, args, kw)
reraise(*exc_info)
raise exc_info[1] from None
return val


Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@

setup(
name="PasteDeploy",
version="2.1.1",
version="3.0.dev0",
description="Load, configure, and compose WSGI applications and servers",
long_description=readme,
classifiers=[
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 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",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
Expand Down
9 changes: 3 additions & 6 deletions tests/test_load_package.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from pprint import pprint
import sys

import pkg_resources

from paste.deploy.compat import print_
import sys


def test_load_package():
print_('Path:')
print('Path:')
pprint(sys.path)
print_(pkg_resources.require('FakeApp'))
print(pkg_resources.require('FakeApp'))
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tox]
envlist = py27, py34, py35, py36, py37, pypy, pypy3,
envlist =
py37,py38,py39,py310,pypy3,
docs

[testenv]
Expand All @@ -12,8 +13,6 @@ commands =
py.test --cov=paste/deploy --cov-report=xml --cov-report=html --cov-report=term-missing {posargs}

[testenv:docs]
# pin to 3.5 to match what RTD uses
basepython = python3.5
whitelist_externals = make
commands =
make -C docs html epub BUILDDIR={envdir} "SPHINXOPTS=-W -E"
Expand Down

0 comments on commit d7dbb23

Please sign in to comment.