Skip to content

Commit

Permalink
Merge pull request #1 from frobnitzem/groups
Browse files Browse the repository at this point in the history
Grouped zmq dependencies as optional.
  • Loading branch information
frobnitzem authored Nov 18, 2024
2 parents d727626 + 7282989 commit 998de71
Show file tree
Hide file tree
Showing 6 changed files with 383 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.8", "3.10", "3.12"]

steps:
- uses: ConorMacBride/install-package@v1
Expand All @@ -35,7 +35,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install mypy pytest pytest-asyncio pytest-cov
pip install --no-binary=:all: pyzmq
pip install -e .
pip install -e ".[zmq]"
- name: Lint with mypy
run: |
Expand Down
6 changes: 4 additions & 2 deletions aiowire/poller.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Optional, Dict, Union

try:
import zmq
import zmq.asyncio
import zmq # type: ignore[import-not-found]
import zmq.asyncio # type: ignore[import-not-found]
Socket = Union[zmq.Socket, int]
zmqPOLLIN = zmq.POLLIN
except ImportError:
Expand Down Expand Up @@ -31,6 +31,8 @@ class Poller(Wire):
def __init__(self, socks : Dict[Socket, Wire],
default_flags = zmqPOLLIN,
interval : Optional[int] = 1000):
if zmq is None:
raise ImportError("pyzmq package not installed.")
self.socks : Dict[Socket, Wire] = {}
self.default_flags = default_flags
self.interval = interval
Expand Down
Loading

0 comments on commit 998de71

Please sign in to comment.