Skip to content
Merged
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: 0 additions & 2 deletions CI_REQUIREMENTS.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
typing >= 3.6 ; python_version < "3.8"
gevent >= 1.2, <1.3.0 ; platform_python_implementation == "PyPy"
gevent >= 1.2 ; platform_python_implementation != "PyPy"
34 changes: 5 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ threaded

.. image:: https://travis-ci.org/python-useful-helpers/threaded.svg?branch=master
:target: https://travis-ci.org/python-useful-helpers/threaded
.. image:: https://dev.azure.com/python-useful-helpers/threaded/_apis/build/status/python-useful-helpers.threaded?branchName=master
:alt: Azure DevOps builds
:target: https://dev.azure.com/python-useful-helpers/threaded/_build?definitionId=3
.. image:: https://coveralls.io/repos/github/python-useful-helpers/threaded/badge.svg?branch=master
:target: https://coveralls.io/github/python-useful-helpers/threaded?branch=master
.. image:: https://readthedocs.org/projects/threaded/badge/?version=latest
Expand Down Expand Up @@ -58,9 +61,6 @@ Decorators:
* `AsyncIOTask` - wrap in ``asyncio.Task``. Uses the same API, as `ThreadPooled`.
* `asynciotask` is alias for `AsyncIOTask`.

* `GThreadPooled` - wrap function in ``gevent.threadpool.ThreadPool``.
* `gthreadpooled` is alias for `GThreadPooled`.

.. note::

gevent is not in default package requirements.
Expand Down Expand Up @@ -214,32 +214,6 @@ Usage with loop extraction from call arguments:
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait_for(func(loop), timeout))

GThreadPooled
-------------
Post function to ``gevent.threadpool.ThreadPool``.

.. code-block:: python

threaded.GThreadPooled.configure(max_workers=3)

.. note::

By default, if executor is not configured - it configures with default parameters: ``max_workers=CPU_COUNT * 5``

.. note::

Instead of standard ThreadPoolExecutor, gevent pool is not re-created during re-configuration.

Basic usage example:

.. code-block:: python

@threaded.GThreadPooled
def func():
pass

func().wait()

Testing
=======
The main test mechanism for the package `threaded` is using `tox`.
Expand All @@ -253,6 +227,8 @@ For code checking several CI systems is used in parallel:

2. `coveralls: <https://coveralls.io/github/python-useful-helpers/threaded>`_ is used for coverage display.

3. `Azure CI: <https://dev.azure.com/python-useful-helpers/threaded/_build?definitionId=3>`_ is used for functional tests on Windows.

CD system
=========
`Travis CI: <https://travis-ci.org/python-useful-helpers/threaded>`_ is used for package delivery on PyPI.
33 changes: 16 additions & 17 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
python -m pip install --upgrade pip
pip install -U setuptools
pip install -r requirements.txt
pip install -r CI_REQUIREMENTS.txt
displayName: 'Install dependencies'

- script: |
Expand All @@ -35,22 +34,22 @@ jobs:
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_37', python: '3.7', architecture: 'x64', kind: 'native'}

#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_34', python: '3.4', architecture: 'x64', kind: 'cython'}
#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_34', python: '3.4', architecture: 'x86', kind: 'cython'}
#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_35', python: '3.5', architecture: 'x64', kind: 'cython'}
#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_35', python: '3.5', architecture: 'x86', kind: 'cython'}
#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_36', python: '3.6', architecture: 'x64', kind: 'cython'}
#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_36', python: '3.6', architecture: 'x86', kind: 'cython'}
#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_37', python: '3.7', architecture: 'x64', kind: 'cython'}
#- template: .azure_pipelines/run_tests.yml
# parameters: {name: 'Python_37', python: '3.7', architecture: 'x86', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_34', python: '3.4', architecture: 'x64', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_34', python: '3.4', architecture: 'x86', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_35', python: '3.5', architecture: 'x64', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_35', python: '3.5', architecture: 'x86', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_36', python: '3.6', architecture: 'x64', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_36', python: '3.6', architecture: 'x86', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_37', python: '3.7', architecture: 'x64', kind: 'cython'}
- template: .azure_pipelines/run_tests.yml
parameters: {name: 'Python_37', python: '3.7', architecture: 'x86', kind: 'cython'}
#
#- job: 'Build_and_deploy'
# dependsOn:
Expand Down
57 changes: 0 additions & 57 deletions doc/source/gthreadpooled.rst

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Contents:
threadpooled
threaded
asynciotask
gthreadpooled

Indices and tables
==================
Expand Down
10 changes: 3 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
# noinspection PyPackageRequirements
from Cython.Build import cythonize

# noinspection PyPackageRequirements
import gevent
except ImportError:
gevent = cythonize = None
cythonize = None


with open(os.path.join(os.path.dirname(__file__), "threaded", "__init__.py")) as f:
Expand Down Expand Up @@ -63,7 +61,6 @@ def _extension(modpath: str) -> setuptools.Extension:

if "win32" != sys.platform:
requires_optimization.append(_extension("threaded.__init__"))
requires_optimization.append(_extension("threaded._gthreadpooled"))

# noinspection PyCallingNonCallable
ext_modules = (
Expand All @@ -73,7 +70,7 @@ def _extension(modpath: str) -> setuptools.Extension:
always_allow_keywords=True, binding=True, embedsignature=True, overflowcheck=True, language_level=3
),
)
if cythonize is not None and "win32" != sys.platform
if cythonize is not None
else []
)

Expand Down Expand Up @@ -216,7 +213,7 @@ def get_simple_vars_from_src(
"Programming Language :: Python :: Implementation :: PyPy",
]

keywords = ["pooling", "multithreading", "threading", "asyncio", "gevent", "development"]
keywords = ["pooling", "multithreading", "threading", "asyncio", "development"]

setup_args = dict(
name="threaded",
Expand Down Expand Up @@ -245,7 +242,6 @@ def get_simple_vars_from_src(
"setuptools_scm",
],
use_scm_version=True,
extras_require={"gevent": ["gevent >= 1.2.2"]},
install_requires=required,
package_data={"threaded": ["py.typed"]},
)
Expand Down
38 changes: 0 additions & 38 deletions test/async_syntax/test_gevent_threadpooled_async.py

This file was deleted.

76 changes: 0 additions & 76 deletions test/test_gevent_threadpooled.py

This file was deleted.

10 changes: 0 additions & 10 deletions threaded/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
from ._threaded import Threaded, threaded
from ._threadpooled import ThreadPooled, threadpooled


try: # pragma: no cover
from ._gthreadpooled import GThreadPooled, gthreadpooled
except ImportError: # pragma: no cover
GThreadPooled = gthreadpooled = None # type: ignore
# pylint: enable=no-name-in-module

try:
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
Expand All @@ -51,9 +44,6 @@
"asynciotask",
) # type: typing.Tuple[str, ...]

if GThreadPooled is not None: # pragma: no cover
__all__ += ("GThreadPooled", "gthreadpooled")

__author__ = "Alexey Stepanov"
__author_email__ = "penguinolog@gmail.com"
__maintainers__ = {
Expand Down
Loading