Skip to content

Commit

Permalink
Support only Python 3.9 and higher
Browse files Browse the repository at this point in the history
Closes #177
  • Loading branch information
kurtmckee authored and LudovicRousseau committed Sep 19, 2024
1 parent 9436613 commit ab32896
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 40 deletions.
65 changes: 35 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,66 +8,71 @@ 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
pip install -r dev-requirements.txt
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
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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)
======================
Expand Down
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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',
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/smartcard/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pyscard - Python for smart cards

`pyscard - Python smart card library -
<https://github.com/LudovicRousseau/pyscard>`_ is a Python module adding
smart cards support to `Python <http://www.python.org/>`_.
smart cards support to `Python <http://www.python.org/>`_ 3.9 and higher.

Download
********
Expand Down
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[tox]
envlist =
pylint
py311
py312
py3.9
py3.10
py3.11
py3.12
skip_missing_interpreters = True

[testenv]
deps =
Expand Down

0 comments on commit ab32896

Please sign in to comment.