Skip to content

Commit ecfb6d2

Browse files
authored
Merge pull request #173 from slimta/drop-py2
Drop support for Python 2
2 parents 768c349 + 5c349fa commit ecfb6d2

File tree

76 files changed

+209
-1229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+209
-1229
lines changed

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
16+
python-version: ['3.6', '3.7', '3.8', '3.9']
1717

1818
steps:
1919
- uses: actions/checkout@v2
@@ -28,9 +28,9 @@ jobs:
2828
- name: Lint with flake8
2929
run: |
3030
flake8 slimta
31-
- name: Type checking with pytype
31+
- name: Type checking with pyright
3232
run: |
33-
pytype -k
33+
pyright slimta
3434
- name: Test with pytest
3535
run: |
3636
py.test --cov=slimta

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11

22
# Change Log
33

4-
## 4.1 - _Unreleased_
4+
## 5.0 - Change Logs have moved to [Releases][18]
5+
6+
## 4.2 - 2021-02-14
7+
8+
- New `handle_tls2(ssl_socket)` validator on [`SmtpValidators`][16].
9+
- Switch to [`select.poll()`][17] for DNS lookups.
10+
11+
## 4.1 - 2020-10-29
512

613
### Added
714

15+
- [**Extension Consolidation**][15].
816
- New [`create_listeners`][10] function for creating IP sockets on both IPv4
917
and IPv6, if available.
1018
- New `mixin` functions in the [`proxyproto`][12] classes.
@@ -152,6 +160,10 @@
152160
[12]: http://slimta.org/en/latest/api/slimta.util.proxyproto.html
153161
[13]: http://slimta.org/en/latest/api/slimta.relay.smtp.static.html#slimta.relay.smtp.static.StaticLmtpRelay
154162
[14]: http://slimta.org/en/latest/api/slimta.relay.pipe.html
163+
[15]: https://www.slimta.org/blog/2020-10-30.html
164+
[16]: https://www.slimta.org/api/slimta.edge.smtp.html#slimta.edge.smtp.SmtpValidators
165+
[17]: https://docs.python.org/3/library/select.html#select.poll
166+
[18]: https://github.com/slimta/python-slimta/releases
155167
[3.0]: https://github.com/slimta/python-slimta/issues?q=milestone%3A3.0
156168
[3.1]: https://github.com/slimta/python-slimta/issues?q=milestone%3A3.1
157169
[3.2]: https://github.com/slimta/python-slimta/issues?q=milestone%3A3.2

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ can incorporate any protocol or policy, custom or built-in. An MTA built with
1414
Python's great community.
1515

1616
The `python-slimta` project is released under the [MIT License][4]. It is
17-
tested for Python 2.7+ or 3.6+.
17+
tested for Python 3.6+.
1818

1919
[![build](https://github.com/slimta/python-slimta/actions/workflows/python-package.yml/badge.svg)](https://github.com/slimta/python-slimta/actions/workflows/python-package.yml)
2020
[![PyPI](https://img.shields.io/pypi/v/python-slimta.svg)](https://pypi.python.org/pypi/python-slimta)
2121
[![PyPI](https://img.shields.io/pypi/pyversions/python-slimta.svg)](https://pypi.python.org/pypi/python-slimta)
2222
[![PyPI](https://img.shields.io/pypi/l/python-slimta.svg)](https://pypi.python.org/pypi/python-slimta)
23-
[![Flattr](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=icgood&url=https%3A%2F%2Fgithub.com%2Fslimta%2Fpython-slimta&title=python-slimta&language=python&tags=github&category=software)
2423

2524

2625
Getting Started

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pytest >= 4
22
pytest-cov
3-
pytype
4-
mox3
3+
pyright
4+
pymox
55
testfixtures
66
flake8
77
twine

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ filterwarnings =
77
ignore::DeprecationWarning
88
ignore::PendingDeprecationWarning
99

10+
[flake8]
11+
per-file-ignores =
12+
test/*: E501
13+
1014
[coverage:report]
1115
exclude_lines =
1216
declare_namespace

setup.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
license = f.read()
2929

3030
setup(name='python-slimta',
31-
version='4.2.1',
31+
version='5.0.0',
3232
author='Ian Good',
3333
author_email='ian@icgood.net',
3434
description='Lightweight, asynchronous SMTP libraries.',
@@ -40,12 +40,9 @@
4040
packages=find_packages(),
4141
namespace_packages=['slimta'],
4242
install_requires=['gevent >= 1.1rc',
43-
'pysasl >= 0.4.0, < 0.5',
44-
'pycares < 3.0.0; python_version < "3.0"',
45-
'pycares >= 1; python_version >= "3.0"'],
46-
extras_require={'spf': ['pyspf', 'py3dns; python_version >= "3.0"',
47-
'pydns; python_version < "3.0"',
48-
'ipaddr; python_version < "3.0"'],
43+
'pysasl >= 0.5.0',
44+
'pycares >= 1'],
45+
extras_require={'spf': ['pyspf', 'py3dns'],
4946
'redis': ['redis'],
5047
'aws': ['boto'],
5148
'disk': ['pyaio >= 0.4; platform_system == "Linux"']},
@@ -55,7 +52,6 @@
5552
'Intended Audience :: Information Technology',
5653
'License :: OSI Approved :: MIT License',
5754
'Programming Language :: Python',
58-
'Programming Language :: Python :: 2.7',
5955
'Programming Language :: Python :: 3.6',
6056
'Programming Language :: Python :: 3.7',
6157
'Programming Language :: Python :: 3.8',

slimta/cloudstorage/__init__.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
"""Package containing a module for the different cloud service providers along
2323
with any necessary helper modules.
2424
25-
.. _Cloud Files: http://www.rackspace.com/cloud/files/
26-
.. _Cloud Queues: http://www.rackspace.com/cloud/queues/
2725
.. _S3: http://aws.amazon.com/s3/
2826
.. _SQS: http://aws.amazon.com/sqs/
2927
@@ -49,21 +47,18 @@ class CloudStorageError(QueueError):
4947
class CloudStorage(QueueStorage):
5048
"""This class implements a :class:`~slimta.queue.QueueStorage` backend that
5149
uses cloud services to store messages. It coordinates the storage of
52-
messages and metadata (using `Cloud Files`_ or `S3`_) with the optional
53-
message queue mechanisms (using `Cloud Queues`_ or `SQS`_) that can alert
54-
other *slimta* processes that a new message is available in the object
55-
store.
50+
messages and metadata (using `S3`_) with the optional message queue
51+
mechanisms (using `SQS`_) that can alert other *slimta* processes that a
52+
new message is available in the object store.
5653
5754
:param object_store: The object used as the backend for storing message
5855
contents and metadata in the cloud. Currently this can
5956
be an instance of
60-
:class:`~rackspace.RackspaceCloudFiles` or
6157
:class:`~aws.SimpleStorageService`.
6258
:param message_queue: The optional object used
6359
as the backend for alerting other processes that a
6460
new message is in the object store. Currently this
6561
can be an instance of
66-
:class:`~rackspace.RackspaceCloudQueues` or
6762
:class:`~aws.SimpleQueueService`.
6863
6964
"""

slimta/cloudstorage/aws.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262

6363
import uuid
6464
import json
65-
66-
from six.moves import cPickle
65+
import pickle
6766

6867
import gevent
6968
from boto.s3.key import Key
@@ -105,7 +104,7 @@ def _get_key(self, id):
105104
def write_message(self, envelope, timestamp):
106105
key = self.Key(self.bucket)
107106
key.key = self.prefix+str(uuid.uuid4())
108-
envelope_raw = cPickle.dumps(envelope, cPickle.HIGHEST_PROTOCOL)
107+
envelope_raw = pickle.dumps(envelope, pickle.HIGHEST_PROTOCOL)
109108
with gevent.Timeout(self.timeout):
110109
key.set_metadata('timestamp', json.dumps(timestamp))
111110
key.set_metadata('attempts', '')
@@ -137,7 +136,7 @@ def get_message(self, id):
137136
timestamp_raw = key.get_metadata('timestamp')
138137
attempts_raw = key.get_metadata('attempts')
139138
delivered_raw = key.get_metadata('delivered_indexes')
140-
envelope = cPickle.loads(envelope_raw)
139+
envelope = pickle.loads(envelope_raw)
141140
meta = {'timestamp': json.loads(timestamp_raw)}
142141
if attempts_raw:
143142
meta['attempts'] = json.loads(attempts_raw)

0 commit comments

Comments
 (0)