Skip to content

Commit

Permalink
Drop support for Python 2.6 and 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
joguSD committed Jan 10, 2020
1 parent 5e6a6fe commit 3055ede
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 86 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/feature-Python-68860.json
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "Python",
"description": "Dropped support for Python 2.6 and 3.3."
}
6 changes: 0 additions & 6 deletions .travis.yml
Expand Up @@ -2,15 +2,9 @@ language: python

matrix:
include:
- python: 2.6
dist: trusty
sudo: false
- python: 2.7
dist: trusty
sudo: false
- python: 3.3
dist: trusty
sudo: false
- python: 3.4
dist: trusty
sudo: false
Expand Down
3 changes: 0 additions & 3 deletions requirements-test.txt
Expand Up @@ -3,6 +3,3 @@ nose==1.3.3
mock==1.3.0
coverage==4.0.1
wheel==0.24.0
# Note you need at least pip --version of 6.0 or
# higher to be able to pick on these version specifiers.
unittest2==0.5.1; python_version == '2.6'
74 changes: 1 addition & 73 deletions s3transfer/compat.py
Expand Up @@ -98,76 +98,4 @@ def fallocate(fileobj, size):
fileobj.truncate(size)


if sys.version_info[:2] == (2, 6):
# For Python 2.6, the start() method does not accept initializers.
# So we backport the functionality. This is strictly a copy from the
# Python 2.7 version.
import multiprocessing
import multiprocessing.managers
import multiprocessing.connection
import multiprocessing.util


class BaseManager(multiprocessing.managers.BaseManager):
def start(self, initializer=None, initargs=()):
'''
Spawn a server process for this manager object
'''
assert self._state.value == multiprocessing.managers.State.INITIAL

if initializer is not None and not hasattr(initializer,
'__call__'):
raise TypeError('initializer must be a callable')

# pipe over which we will retrieve address of server
reader, writer = multiprocessing.Pipe(duplex=False)

# spawn process which runs a server
self._process = multiprocessing.Process(
target=type(self)._run_server,
args=(self._registry, self._address, self._authkey,
self._serializer, writer, initializer, initargs),
)
ident = ':'.join(str(i) for i in self._process._identity)
self._process.name = type(self).__name__ + '-' + ident
self._process.start()

# get address of server
writer.close()
self._address = reader.recv()
reader.close()

# register a finalizer
self._state.value = multiprocessing.managers.State.STARTED
self.shutdown = multiprocessing.util.Finalize(
self, type(self)._finalize_manager,
args=(self._process, self._address, self._authkey,
self._state, self._Client),
exitpriority=0
)

@classmethod
def _run_server(cls, registry, address, authkey, serializer,
writer,
initializer=None, initargs=()):
'''
Create a server, report its address and run it
'''
if initializer is not None:
initializer(*initargs)

# create server
server = cls._Server(registry, address, authkey, serializer)

# inform parent process of the server's address
writer.send(server.address)
writer.close()

# run the manager
multiprocessing.util.info('manager serving at %r', server.address)

server.serve_forever()


else:
from multiprocessing.managers import BaseManager
from multiprocessing.managers import BaseManager
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -4,4 +4,4 @@ universal = 1
[metadata]
requires-dist =
botocore>=1.12.36,<2.0.0
futures>=2.2.0,<4.0.0; python_version=="2.6" or python_version=="2.7"
futures>=2.2.0,<4.0.0; python_version=="2.7"
4 changes: 1 addition & 3 deletions setup.py
Expand Up @@ -38,7 +38,7 @@ def get_version():
include_package_data=True,
install_requires=requires,
extras_require={
':python_version=="2.6" or python_version=="2.7"': [
':python_version=="2.7"': [
'futures>=2.2.0,<4.0.0']
},
license="Apache License 2.0",
Expand All @@ -48,10 +48,8 @@ def get_version():
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand Down

0 comments on commit 3055ede

Please sign in to comment.