From 6f94d6b2791bda91bb80a332bd59c66dc11617ad Mon Sep 17 00:00:00 2001 From: Felix Divo <4403130+felixdivo@users.noreply.github.com> Date: Sat, 15 Jan 2022 11:43:15 +0100 Subject: [PATCH 1/5] Update workflow versions, platforms, library and tool versions and README to Python 3.7 --- .github/workflows/build.yml | 16 ++++++---------- .github/workflows/format-code.yml | 2 +- README.rst | 4 ++-- requirements-lint.txt | 6 +++--- setup.py | 5 ++--- tox.ini | 6 +++--- 6 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb4c9a03b..95b295f90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,16 +13,12 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] experimental: [false] - python-version: ["3.6", "3.7", "3.8", "3.9", "pypy-3.7"] + python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"] include: - # Skipping Py 3.10 on Windows until windows-curses has a cp310 wheel, - # see https://github.com/zephyrproject-rtos/windows-curses/issues/26 + # Only test on a single configuration while there are just pre-releases - os: ubuntu-latest - experimental: false - python-version: "3.10" - - os: macos-latest - experimental: false - python-version: "3.10" + experimental: true + python-version: "3.11.0-alpha.3" fail-fast: false steps: - uses: actions/checkout@v2 @@ -38,7 +34,7 @@ jobs: run: | tox -e gh - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2 with: fail_ci_if_error: true @@ -46,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v2 with: python-version: "3.10" diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index 81e8fdf03..c3356e211 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.10 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/README.rst b/README.rst index ac5537f7e..ebfa8431f 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,7 @@ Python developers; providing common abstractions to different hardware devices, and a suite of utilities for sending and receiving messages on a can bus. -The library currently supports Python 3.6+ as well as PyPy 3 and runs +The library currently supports Python 3.7+ as well as PyPy 3 and runs on Mac, Linux and Windows. ============================== =========== @@ -59,7 +59,7 @@ Library Version Python ------------------------------ ----------- 2.x 2.6+, 3.4+ 3.x 2.7+, 3.5+ - 4.x *(currently on develop)* 3.6+ + 4.x *(currently on develop)* 3.7+ ============================== =========== diff --git a/requirements-lint.txt b/requirements-lint.txt index 9aefb7415..55d985d54 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -1,4 +1,4 @@ -pylint==2.11.1 -black==21.10b0 -mypy==0.910 +pylint==2.12.2 +black==21.12b0 +mypy==0.931 mypy-extensions==0.4.3 diff --git a/setup.py b/setup.py index 31318ac06..af47ecd4f 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,6 @@ classifiers=[ # a list of all available ones: https://pypi.org/classifiers/ "Programming Language :: Python", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -73,7 +72,7 @@ version=version, packages=find_packages(exclude=["test*", "doc", "scripts", "examples"]), scripts=list(filter(isfile, (join("scripts/", f) for f in listdir("scripts/")))), - author="Python CAN contributors", + author="python-can contributors", license="LGPL v3", package_data={ "": ["README.rst", "CONTRIBUTORS.txt", "LICENSE.txt", "CHANGELOG.txt"], @@ -82,7 +81,7 @@ }, # Installation # see https://www.python.org/dev/peps/pep-0345/#version-specifiers - python_requires=">=3.6", + python_requires=">=3.7", install_requires=[ "setuptools", "wrapt~=1.10", diff --git a/tox.ini b/tox.ini index 9964fb1e6..6b407dfeb 100644 --- a/tox.ini +++ b/tox.ini @@ -3,11 +3,11 @@ [testenv] deps = pytest==6.2.*,>=6.2.5 - pytest-timeout==2.0.1 + pytest-timeout==2.0.2 pytest-cov==3.0.0 - coverage==6.0.2 + coverage==6.2 codecov==2.1.12 - hypothesis~=6.24.0 + hypothesis~=6.35.0 pyserial~=3.5 parameterized~=0.8 From dd25e4b6feb7300028af4c5ce89a7646f85e684a Mon Sep 17 00:00:00 2001 From: Felix Divo <4403130+felixdivo@users.noreply.github.com> Date: Sat, 15 Jan 2022 11:52:40 +0100 Subject: [PATCH 2/5] Fix code formatting job --- .github/workflows/format-code.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index c3356e211..b86789662 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.10 + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip @@ -22,10 +22,7 @@ jobs: run: | black --verbose . - name: Commit Formated Code - uses: EndBug/add-and-commit@v5 - env: - # This is necessary in order to push a commit to the repo - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: EndBug/add-and-commit@v7 with: message: "Format code with black" # Ref https://git-scm.com/docs/git-add#_examples From 46ad7d46b92b3f1192c1511e67e3739becadf99f Mon Sep 17 00:00:00 2001 From: Felix Divo <4403130+felixdivo@users.noreply.github.com> Date: Sat, 15 Jan 2022 12:00:27 +0100 Subject: [PATCH 3/5] Disable Python 3.11 pre-releases --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95b295f90..be222751c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,11 +14,12 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] experimental: [false] python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"] - include: + # Do not test on Python 3.11 pre-releases since wrapt causes problems: https://github.com/GrahamDumpleton/wrapt/issues/196 + # include: # Only test on a single configuration while there are just pre-releases - - os: ubuntu-latest - experimental: true - python-version: "3.11.0-alpha.3" + # - os: ubuntu-latest + # experimental: true + # python-version: "3.11.0-alpha.3" fail-fast: false steps: - uses: actions/checkout@v2 From 8641f5e02ec084b6754e38a7674aa72808a8de5c Mon Sep 17 00:00:00 2001 From: Felix Divo <4403130+felixdivo@users.noreply.github.com> Date: Sat, 15 Jan 2022 12:01:07 +0100 Subject: [PATCH 4/5] Test that the auto-formatting tool can still commit --- can/ctypesutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/can/ctypesutil.py b/can/ctypesutil.py index 7c1e1f573..ab4cb11b5 100644 --- a/can/ctypesutil.py +++ b/can/ctypesutil.py @@ -14,7 +14,7 @@ try: - _LibBase = ctypes.WinDLL # type: ignore + _LibBase = ctypes.WinDLL # type: ignore _FUNCTION_TYPE = ctypes.WINFUNCTYPE # type: ignore except AttributeError: _LibBase = ctypes.CDLL From 0acabbff21248b5c76039f026d31053711918147 Mon Sep 17 00:00:00 2001 From: felixdivo Date: Sat, 15 Jan 2022 11:01:42 +0000 Subject: [PATCH 5/5] Format code with black --- can/ctypesutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/can/ctypesutil.py b/can/ctypesutil.py index ab4cb11b5..7c1e1f573 100644 --- a/can/ctypesutil.py +++ b/can/ctypesutil.py @@ -14,7 +14,7 @@ try: - _LibBase = ctypes.WinDLL # type: ignore + _LibBase = ctypes.WinDLL # type: ignore _FUNCTION_TYPE = ctypes.WINFUNCTYPE # type: ignore except AttributeError: _LibBase = ctypes.CDLL