-
Notifications
You must be signed in to change notification settings - Fork 1
Fix read forever loop #15
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
Open
iivanov-qb
wants to merge
8
commits into
master
Choose a base branch
from
fix-read-forever-loop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
07f49b6
Suppress exceptions on read_forever loop
iivanov-qb fbf1f5a
Migrate to uv
iivanov-qb f308bd5
Fix handle_authentication interface mismatch
iivanov-qb 0559672
Restore implicit event loop creation for BaseRPC
iivanov-qb 650ffc7
Drop deprecated ZMQEventLoop usage
iivanov-qb 8f3a996
Fix stale test assertions
iivanov-qb aaa4777
Clean up leftover ipc:// socket files after tests
iivanov-qb 640b7e5
Release 1.0.0+qb.13
iivanov-qb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| python-version: "3.14" | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --locked --group dev | ||
|
|
||
| - name: Run tests | ||
| run: uv run pytest --cov pseud |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,5 @@ | ||
| import zmq.asyncio | ||
|
|
||
| from .auth import * # noqa | ||
| from .client import Client, SyncClient # noqa | ||
| from .heartbeat import * # noqa | ||
| from .predicate import * # noqa | ||
| from .server import Server # noqa | ||
|
|
||
|
|
||
| zmq.asyncio.install() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| [build-system] | ||
| requires = ["uv_build"] | ||
| build-backend = "uv_build" | ||
|
|
||
| [project] | ||
| name = "pseud" | ||
| version = "1.0.0+qb.13" | ||
| description = "Bidirectionnal RPC Api on top of pyzmq" | ||
| readme = "README.rst" | ||
| license = "Apache-2.0" | ||
| authors = [ | ||
| { name = "Nicolas Delaby", email = "ticosax@free.fr" }, | ||
| ] | ||
| requires-python = ">=3.10" | ||
| keywords = ["rpc", "zeromq", "pyzmq", "curve", "bidirectional", "asyncio"] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Developers", | ||
| "Intended Audience :: System Administrators", | ||
| "Operating System :: OS Independent", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Programming Language :: Python :: 3.13", | ||
| "Programming Language :: Python :: 3.14", | ||
| ] | ||
| dependencies = [ | ||
| "pyzmq>=14.4", | ||
| "msgpack>=1.0", | ||
| "zope.component", | ||
| "zope.interface", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/ticosax/pseud" | ||
| Documentation = "https://pseud.readthedocs.io/en/latest/index.html" | ||
|
|
||
| [project.optional-dependencies] | ||
| doc = ["sphinx", "repoze.sphinx.autointerface"] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pytest", | ||
| "pytest-cov", | ||
| "pytest-asyncio", | ||
| ] | ||
|
|
||
| [tool.uv.build-backend] | ||
| module-root = "" | ||
|
|
||
| [[tool.uv.index]] | ||
| name = "pypi" | ||
| url = "https://pypi.org/simple" | ||
| default = true | ||
|
|
||
| [tool.coverage.report] | ||
| exclude_lines = [ | ||
| "pragma: no cover", | ||
| "raise NotImplementedError", | ||
| ] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,41 @@ | ||
| import asyncio | ||
| import os | ||
| import stat | ||
|
|
||
| import pytest | ||
| import pytest_asyncio | ||
| import zmq.asyncio | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def event_loop(): | ||
| loop = zmq.asyncio.ZMQEventLoop() | ||
| asyncio.set_event_loop(loop) | ||
| yield loop | ||
| loop.close() | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def loop(event_loop): | ||
| return event_loop | ||
| @pytest_asyncio.fixture | ||
| async def loop(): | ||
| # pytest-asyncio drives each async test on its own loop and no longer | ||
| # lets a same-named fixture override it, so grab that loop instead of | ||
| # creating a separate one that the test wouldn't actually run on. | ||
| return asyncio.get_running_loop() | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def close_context(): | ||
| yield | ||
| context = zmq.asyncio.Context.instance() | ||
| context.destroy(linger=0) | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def cleanup_ipc_sockets(): | ||
| # ipc:// endpoints bind a real unix socket file on disk, and closing | ||
| # the socket doesn't unlink it. Several tests bind relative, bare | ||
| # names (e.g. 'ipc://here'), which land in the cwd pytest runs from. | ||
| # Remove whatever socket files show up there during the test. | ||
| cwd = os.getcwd() | ||
| before = set(os.listdir(cwd)) | ||
| yield | ||
| after = set(os.listdir(cwd)) | ||
| for name in after - before: | ||
| path = os.path.join(cwd, name) | ||
| try: | ||
| if stat.S_ISSOCK(os.stat(path).st_mode): | ||
| os.unlink(path) | ||
| except OSError: | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, reader is still None...