diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6860df8..4f07170 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,21 +22,36 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "test" + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + + - uses: actions/setup-python@v5.3.0 + with: + python-version: '3.10' + + - name: Install vermin + run: pip install vermin + + - name: Check minimum Python version (must not exceed 3.10) + run: vermin --target=3.10- --backport enum j1939/ + test: # The type of runner that the job will run on runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4.2.2 + + - uses: actions/setup-python@v5.3.0 with: - python-version: '3.10' - - - uses: actions/checkout@v2 + python-version: ${{ matrix.python-version }} - name: install dependencies run: pip3 install -e .[test] diff --git a/README.rst b/README.rst index f8a0118..6bfcff3 100644 --- a/README.rst +++ b/README.rst @@ -80,6 +80,8 @@ Features Installation ------------ +Requires **Python 3.10 or later** and python-can_ >= 4.2.0. + Install can-j1939 with pip:: $ pip install can-j1939 diff --git a/setup.py b/setup.py index dee15ff..adb30a0 100644 --- a/setup.py +++ b/setup.py @@ -18,10 +18,15 @@ long_description_content_type='text/x-rst', license="MIT", platforms=["any"], + python_requires=">=3.10", classifiers=[ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Intended Audience :: Developers", "Topic :: Scientific/Engineering" ], diff --git a/test/test_ca.py b/test/test_ca.py index d590848..3abb803 100644 --- a/test/test_ca.py +++ b/test/test_ca.py @@ -68,12 +68,12 @@ def test_addr_claim_fixed_reduced_time(feeder): ) new_ca = feeder.ecu.add_ca(name=name, device_address=128) new_ca.start(0.2) - - # wait until all messages are processed asynchronously - # rounded up to account for scheduling delays - time.sleep(0.3) - # assert that the expected message was sent + # wait until the address claim message is processed, with a 2s timeout + deadline = time.monotonic() + 2.0 + while len(feeder.can_messages) > 0 and time.monotonic() < deadline: + time.sleep(0.050) + assert len(feeder.can_messages) == 0