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 six dependency #477

Open
wants to merge 5 commits 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
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
CONDA_ENV: [py38, py39, py310]
CONDA_ENV: [py39, py310, py311, py312]
# env:
# STREAMZ_LAUNCH_KAFKA: true

Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:

- name: coveralls
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.CONDA_ENV == 'py38' }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.CONDA_ENV == 'py312' }}
run: coveralls

lint:
Expand Down
18 changes: 4 additions & 14 deletions ci/environment-py38.yml → ci/environment-py311.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,25 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- python=3.11
- pytest
- flake8
- black
- isort
- tornado
- toolz
- zict
- six
- librdkafka=1.5.3
- librdkafka
- dask
- distributed
- pandas
- python-confluent-kafka=1.5.0
- numpydoc
- sphinx
- sphinx_rtd_theme
- python-confluent-kafka
- codecov
- coverage
- networkx
- graphviz
- python-graphviz
- pytest-asyncio
- python-graphviz
- bokeh
- ipython
- ipykernel
- ipywidgets
- flaky
- pytest-cov
- coveralls
- paho-mqtt
- websockets
27 changes: 27 additions & 0 deletions ci/environment-py312.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: test_env
channels:
- conda-forge
- defaults
dependencies:
- python=3.12
- pytest
- flake8
- black
- isort
- tornado
- toolz
- librdkafka
- dask
- distributed
- pandas
- python-confluent-kafka
- codecov
- coverage
- networkx
- graphviz
- pytest-asyncio
- python-graphviz
- bokeh
- ipywidgets
- flaky
- pytest-cov
1 change: 0 additions & 1 deletion ci/environment-py39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- tornado
- toolz
- zict
- six
- librdkafka=1.5.3
- dask
- distributed
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tornado
toolz
zict
six
setuptools
setuptools
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
license='BSD',
keywords='streams',
packages=packages + tests,
python_requires='>=3.8',
python_requires='>=3.9',
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
install_requires=list(open('requirements.txt').read().strip().split('\n')),
Expand Down
9 changes: 4 additions & 5 deletions streamz/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from itertools import chain
import functools
import logging
import six
import sys
import threading
from time import time
from typing import Any, Callable, Hashable, Union
Expand Down Expand Up @@ -1947,8 +1945,8 @@ def f():
if timeout is not None:
future = gen.with_timeout(timedelta(seconds=timeout), future)
result[0] = yield future
except Exception:
error[0] = sys.exc_info()
except Exception as exc:
error[0] = exc
finally:
thread_state.asynchronous = False
e.set()
Expand All @@ -1960,7 +1958,8 @@ def f():
else:
while not e.is_set():
e.wait(10)

if error[0]:
six.reraise(*error[0])
raise error[0]
else:
return result[0]
13 changes: 10 additions & 3 deletions streamz/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ def try_register(cls, entry_point, *modifier):
)


def get_entry_point(eps, group):
if hasattr(eps, "select"): # Python 3.10+ / importlib_metadata >= 3.9.0
return eps.select(group=group)
else:
return eps.get(group, [])

def load_plugins(cls):
eps = importlib.metadata.entry_points()
for entry_point in eps.get("streamz.sources", []):

for entry_point in get_entry_point(eps, "streamz.sources"):
try_register(cls, entry_point, staticmethod)
for entry_point in eps.get("streamz.nodes", []):
for entry_point in get_entry_point(eps, "streamz.nodes"):
try_register(cls, entry_point)
for entry_point in eps.get("streamz.sinks", []):
for entry_point in get_entry_point(eps, "streamz.sinks"):
try_register(cls, entry_point)
4 changes: 2 additions & 2 deletions streamz/utils_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import asyncio
from contextlib import contextmanager
import io
import logging
import os
import six
import shutil
import tempfile
from time import time, sleep
Expand Down Expand Up @@ -85,7 +85,7 @@ def captured_logger(logger, level=logging.INFO, propagate=None):
if propagate is not None:
orig_propagate = logger.propagate
logger.propagate = propagate
sio = six.StringIO()
sio = io.StringIO()
logger.handlers[:] = [logging.StreamHandler(sio)]
logger.setLevel(level)
try:
Expand Down