Skip to content

Commit 9b47a9d

Browse files
committed
remove Python 2.7, 3.5, 3.6 support
1 parent 4fb6db9 commit 9b47a9d

23 files changed

+195
-324
lines changed

Diff for: .travis.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ os: linux
22
dist: xenial
33
language: python
44
python:
5-
- 2.7
6-
- 3.5
7-
- 3.6
85
- 3.7
96
- 3.8
107
- 3.9
11-
- pypy2.7-6.0
12-
- pypy3.5-6.0
8+
- pypy3.7-7.3.9
9+
- pypy3.8-7.3.9
1310
install:
1411
- pip install -r tests/requirements.txt
1512
- pip install coveralls

Diff for: CHANGELOG.rst

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
Changelog
22
---------
33

4+
X.X.X (XXXX-XX-XX)
5+
++++++++++++++++++
6+
7+
**Deprecations**:
8+
9+
- Removed Python 2.7, 3.5, 3.6 support as it's not supported by Requests anymore
10+
411
2.3.0 (2020-05-21)
512
++++++++++++++++++
613

14+
**Deprecations**:
15+
16+
- Requests version required >= 2.23.0
17+
- Removed Python 3.4 support as it's not supported by Requests anymore
18+
719
**Improvements**:
820

921
- Support custom filename in ``redmine.upload()``
@@ -20,11 +32,6 @@ Changelog
2032
and speed up the create/update/delete operation in case response body isn't needed (see
2133
`docs <https://python-redmine.com/advanced/request_engines.html#session>`__ for details)
2234

23-
**Changes**:
24-
25-
- *Backwards Incompatible:* Requests version required >= 2.23.0
26-
- *Backwards Incompatible:* Removed Python 3.4 support as it's not supported by Requests anymore
27-
2835
**Bugfixes**:
2936

3037
- User's ``send_information`` field wasn't sent correctly to Redmine so account information emails were
@@ -52,17 +59,17 @@ Changelog
5259
2.2.0 (2019-01-13)
5360
++++++++++++++++++
5461

62+
**Deprecations**:
63+
64+
- Removed vendored Requests package and make it an external dependency as Requests did
65+
the same with it's own dependencies
66+
- Removed Python 2.6 and 3.3 support as they're not supported by Requests anymore
67+
5568
**Improvements**:
5669

5770
- ``PerformanceWarning`` will be issued when Python-Redmine does some unnecessary work under the hood to fix the
5871
clients code problems
5972

60-
**Changes**:
61-
62-
- *Backwards Incompatible:* Removed vendored Requests package and make it an external dependency as Requests did
63-
the same with it's own dependencies
64-
- *Backwards Incompatible:* Removed Python 2.6 and 3.3 support as they're not supported by Requests anymore
65-
6673
**Bugfixes**:
6774

6875
- ``Redmine.upload()`` fails under certain circumstances when used with a file-like object and it contains unicode

Diff for: MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
recursive-include tests *.py
2-
include .coveragerc README.rst CHANGELOG.rst LICENSE NOTICE
2+
include .coveragerc README.rst CHANGELOG.rst LICENSE

Diff for: NOTICE

-24
This file was deleted.

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Features
5454

5555
* Supports 100% of Redmine API
5656
* Supports external Redmine plugins API
57-
* Supports Python 2.7, 3.5 - 3.9, PyPy and PyPy3
57+
* Supports Python 3.7 - 3.9 and PyPy3
5858
* Supports different request engines
5959
* Extendable via custom resources and custom request engines
6060
* Extensively documented

Diff for: docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Features
5454

5555
* Supports 100% of Redmine API
5656
* Supports external Redmine plugins API
57-
* Supports Python 2.7, 3.5 - 3.9, PyPy and PyPy3
57+
* Supports Python 3.7 - 3.9 and PyPy3
5858
* Supports different request engines
5959
* Extendable via custom resources and custom request engines
6060
* Extensively documented

Diff for: redminelib/__init__.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import os
66
import io
7-
import sys
87
import inspect
98
import warnings
109
import contextlib
@@ -15,7 +14,7 @@
1514
from .version import __version__
1615

1716

18-
class Redmine(object):
17+
class Redmine:
1918
"""
2019
Entry point for all requests.
2120
"""
@@ -97,7 +96,7 @@ def upload(self, f, filename=None):
9796
if self.ver is not None and LooseVersion(str(self.ver)) < LooseVersion('1.4.0'):
9897
raise exceptions.VersionMismatchError('File uploading')
9998

100-
url = '{0}/uploads.json'.format(self.url)
99+
url = f'{self.url}/uploads.json'
101100
headers = {'Content-Type': 'application/octet-stream'}
102101
params = {'filename': filename or ''}
103102

@@ -114,7 +113,7 @@ def upload(self, f, filename=None):
114113

115114
# We need to send bytes over the socket, so in case a file-like object contains a unicode
116115
# object underneath, we need to convert it to bytes, otherwise we'll get an exception
117-
if isinstance(c, str if sys.version_info[0] >= 3 else unicode):
116+
if isinstance(c, str):
118117
warnings.warn("File-like object contains unicode, hence an additional step is performed to convert "
119118
"it's content to bytes, please consider switching to bytes to eliminate this warning",
120119
exceptions.PerformanceWarning)
@@ -154,10 +153,7 @@ def download(self, url, savepath=None, filename=None, params=None):
154153
if savepath is None:
155154
return response
156155

157-
try:
158-
from urlparse import urlsplit
159-
except ImportError:
160-
from urllib.parse import urlsplit
156+
from urllib.parse import urlsplit
161157

162158
if filename is None:
163159
filename = urlsplit(url)[2].split('/')[-1]
@@ -205,7 +201,7 @@ def search(self, query, **options):
205201

206202
manager_map[container] = getattr(self, name)
207203

208-
raw_resources, _ = self.engine.bulk_request('get', '{0}/search.json'.format(self.url), 'results', **options)
204+
raw_resources, _ = self.engine.bulk_request('get', f'{self.url}/search.json', 'results', **options)
209205

210206
for resource in raw_resources:
211207
if resource['type'] in container_map:

Diff for: redminelib/engines/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .. import exceptions
88

99

10-
class BaseEngine(object):
10+
class BaseEngine:
1111
chunk = 100
1212

1313
def __init__(self, **options):

0 commit comments

Comments
 (0)