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

ci: Update to pypy-3.7 and add Python 3.10 on Ubuntu & MacOS #1143

Merged
merged 4 commits into from
Oct 25, 2021
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
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
experimental: [false]
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy-3.7"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

include:
- python-version: 3.10.0-beta.4 # Newest: https://github.com/actions/python-versions/blob/main/versions-manifest.json
os: ubuntu-latest
experimental: true
# Skipping Py 3.10 on Windows until windows-curses has a cp310 wheel,
# see https://github.com/zephyrproject-rtos/windows-curses/issues/26
- os: ubuntu-latest
experimental: false
python-version: "3.10"
- os: macos-latest
experimental: false
python-version: "3.10"
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand All @@ -41,10 +46,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
5 changes: 4 additions & 1 deletion can/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ def get_message(self, timeout: float = 0.5) -> Optional[Message]:
:return: the Message if there is one, or None if there is not.
"""
try:
return self.buffer.get(block=not self.is_stopped, timeout=timeout)
if self.is_stopped:
return self.buffer.get(block=False)
else:
return self.buffer.get(block=True, timeout=timeout)
except Empty:
return None

Expand Down
10 changes: 9 additions & 1 deletion test/test_message_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
from datetime import timedelta

from hypothesis import given, settings
import hypothesis.errors
import hypothesis.strategies as st

from can import Message

from .message_helper import ComparingMessagesTestCase
from .config import IS_GITHUB_ACTIONS
from .config import IS_GITHUB_ACTIONS, IS_WINDOWS, IS_PYPY

import pytest


class TestMessageClass(unittest.TestCase):
Expand Down Expand Up @@ -42,6 +45,11 @@ class TestMessageClass(unittest.TestCase):
max_examples=2000,
deadline=None if IS_GITHUB_ACTIONS else timedelta(milliseconds=500),
)
@pytest.mark.xfail(
IS_WINDOWS and IS_PYPY,
raises=hypothesis.errors.Flaky,
reason="Hypothesis generates inconistent timestamp floats on Windows+PyPy-3.7",
)
def test_methods(self, **kwargs):
is_valid = not (
(
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ deps =
pytest-cov==2.12.*
coverage==5.5
codecov==2.1.10
hypothesis~=4.56
hypothesis~=6.24.0
pyserial~=3.0
parameterized~=0.8

Expand Down