Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove Python2 support #2684

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check
3. The pull request should work for Python 3.3, 3.4 and 3.5, and for PyPy. Check
https://travis-ci.org/kragniz/python-etcd3/pull_requests
and make sure that the tests pass for all supported Python versions.

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ python-etcd3
:target: https://codecov.io/github/kragniz/python-etcd3?branch=master


Python client for the etcd API v3, supported under python 2.7, 3.4 and 3.5.
Python client for the etcd API v3, supported under python 3.4 and 3.5.

**Warning: the API is mostly stable, but may change in the future**

Expand Down
3 changes: 1 addition & 2 deletions etcd3/client.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import functools
import queue
import random
import threading
import time

import grpc
import grpc._channel

from six.moves import queue

import etcd3.etcdrpc as etcdrpc
import etcd3.exceptions as exceptions
import etcd3.leases as leases
Expand Down
6 changes: 2 additions & 4 deletions etcd3/watch.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import logging
import queue
import threading

import grpc

import six
from six.moves import queue

import etcd3.etcdrpc as etcdrpc
import etcd3.events as events
import etcd3.exceptions as exceptions
Expand Down Expand Up @@ -154,7 +152,7 @@ def _run(self):
self._request_queue.put(None)
self._request_queue = queue.Queue(maxsize=10)

for callback in six.itervalues(callbacks):
for callback in callbacks.values():
_safe_callback(callback, callback_err)

def _handle_response(self, rs):
Expand Down
4 changes: 0 additions & 4 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ grpcio==1.38.0
# via -r requirements/base.in
protobuf==3.17.0
# via -r requirements/base.in
six==1.16.0
# via
# grpcio
# protobuf
14 changes: 4 additions & 10 deletions tests/test_etcd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

import pytest

import six
from six.moves.urllib.parse import urlparse
from urllib.parse import urlparse

from tenacity import retry, stop_after_attempt, wait_fixed

Expand All @@ -39,11 +38,6 @@

os.environ['ETCDCTL_API'] = '3'

if six.PY2:
int_types = (int, long)
else:
int_types = (int,)


# Don't set any deadline in Hypothesis
settings.register_profile("default", deadline=None)
Expand Down Expand Up @@ -836,8 +830,8 @@ def test_get_response(self, etcd):
def test_lease_grant(self, etcd):
lease = etcd.lease(1)

assert isinstance(lease.ttl, int_types)
assert isinstance(lease.id, int_types)
assert isinstance(lease.ttl, int)
assert isinstance(lease.id, int)

def test_lease_revoke(self, etcd):
lease = etcd.lease(1)
Expand Down Expand Up @@ -880,7 +874,7 @@ def test_member_list(self, etcd):
assert peer_url.startswith('http://')
for client_url in member.client_urls:
assert client_url.startswith('http://')
assert isinstance(member.id, int_types) is True
assert isinstance(member.id, int) is True

def test_lock_acquire(self, etcd):
lock = etcd.lock('lock-1', ttl=10)
Expand Down