From 7a5b77f85fd667a4c4412c5a5468c97f01a5b0fc Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 19 Sep 2024 08:57:36 -0500 Subject: [PATCH] Support only Python 3.9 and higher Closes #177 --- .github/workflows/build.yml | 65 +++++++++++++++++++---------------- .github/workflows/windows.yml | 2 +- ChangeLog | 1 + setup.py | 8 ++--- src/smartcard/doc/index.rst | 2 +- tox.ini | 7 ++-- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1dddf6c..100f0671 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: GNU/Linux & macOS Build +name: "🧪 Test" # Controls when the action will run. Triggers the workflow on push or # pull request events but only for the master branch @@ -8,38 +8,47 @@ on: pull_request: branches: [ master ] -# 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 "build" - build: - runs-on: ${{ matrix.os }} + test: + name: "${{ matrix.os.name }} (${{ matrix.cpython }})" + runs-on: "${{ matrix.os.runner }}" + defaults: + run: + shell: "bash" strategy: + fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: + - name: "Linux" + runner: "ubuntu-latest" + - name: "macOS" + runner: "macos-latest" + cpython: + - "3.9" + - "3.10" + - "3.11" + - "3.12" - # Steps represent a sequence of tasks that will be executed as part - # of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job - # can access it - uses: actions/checkout@v4 - - name: setup prerequisites - shell: bash + - name: Set up Python ${{ matrix.cpython }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.cpython }} + + - name: setup prerequisites (Linux) + if: matrix.os.name == 'Linux' run: | - if [ "$RUNNER_OS" == "Linux" ]; then - sudo apt install libpcsclite-dev python3-all-dev python3-setuptools swig - elif [ "$RUNNER_OS" == "macOS" ]; then - brew install swig pylint - else - echo "$RUNNER_OS not supported" - exit 1 - fi + sudo apt install libpcsclite-dev python3-all-dev python3-setuptools swig + + - name: setup prerequisites (macOS) + if: matrix.os.name == 'macOS' + run: | + brew install swig pylint - name: build - shell: bash run: | python3 -m venv temp source temp/bin/activate @@ -47,27 +56,23 @@ jobs: make - name: test run - shell: bash run: | source temp/bin/activate make test - name: coverage - shell: bash run: | source temp/bin/activate python3 -m coverage erase - python3 -m coverage run $PYTHON -m pytest + python3 -m coverage run -m pytest python3 -m coverage report - - name: Covealls + - name: Coveralls if: matrix.os == 'ubuntu-latest' uses: AndreMiras/coveralls-python-action@develop with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: pylint - # pylint on Ubuntu 22.04 is too old - if: matrix.os == 'macos-latest' - shell: bash - run: pylint --errors-only smartcard || true + run: | + pylint --errors-only smartcard || true diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e88f34b1..6e3aaa0c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12'] windows-arch: ['x86', 'x64'] steps: diff --git a/ChangeLog b/ChangeLog index ed81f03b..1de26051 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Unreleased changes ================== * Remove Python 2 conditional code * Migrate a `src/` layout. + * Support only Python 3.9 and higher 2.1.1 (September 2024) ====================== diff --git a/setup.py b/setup.py index e9cb3d58..f2d79c65 100644 --- a/setup.py +++ b/setup.py @@ -89,6 +89,7 @@ def run(self): 'url': "https://github.com/LudovicRousseau/pyscard", 'long_description': 'Smartcard package for Python', 'platforms': ['linux', 'win32'], + 'python_requires': '>=3.9', 'packages': ["smartcard", "smartcard.pcsc", "smartcard.pyro", @@ -134,15 +135,10 @@ def run(self): 'Operating System :: Unix', 'Operating System :: Microsoft :: Windows', 'Operating System :: MacOS :: MacOS X', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Security', ] } diff --git a/src/smartcard/doc/index.rst b/src/smartcard/doc/index.rst index cddcedcf..281059b3 100644 --- a/src/smartcard/doc/index.rst +++ b/src/smartcard/doc/index.rst @@ -3,7 +3,7 @@ pyscard - Python for smart cards `pyscard - Python smart card library - `_ is a Python module adding -smart cards support to `Python `_. +smart cards support to `Python `_ 3.9 and higher. Download ******** diff --git a/tox.ini b/tox.ini index 2e92741b..eafa61ea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,11 @@ [tox] envlist = pylint - py311 - py312 + py3.9 + py3.10 + py3.11 + py3.12 +skip_missing_interpreters = True [testenv] deps =