Skip to content

Commit

Permalink
Test for more Python versions (#95)
Browse files Browse the repository at this point in the history
* Test for more Python versions

* Remove Python 3.13

* Install requirements for building

* We have to upgrade setuptools

* Also upgrade setuptools for sdist
  • Loading branch information
martin-majlis authored Feb 23, 2024
1 parent 2cd6699 commit ebdbf40
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 15 deletions.
47 changes: 45 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ on:
- master

jobs:
code-quality-check:
code-quality:
name: Code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install pre-commit
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -U pip
make requirements-dev
Expand All @@ -28,6 +30,47 @@ jobs:
- name: Run pre-commit
run: |
pre-commit run -a
run-tests:
name: Tests on ${{ matrix.os }} and ${{ matrix.python }}
needs: [code-quality]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -U pip
make requirements-dev
make requirements
- name: Code coverage
run: |
make run-tests
code-coverage:
name: Code coverage
needs: [run-tests, code-quality]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -U pip
make requirements-dev
make requirements
- name: Code coverage
run: |
make run-coverage
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [windows-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@v4
Expand All @@ -28,6 +27,7 @@ jobs:
name: Install Python
with:
python-version: ${{ matrix.python }}
cache: "pip"

- name: Install Python 3
if: runner.os == 'Windows'
Expand All @@ -37,17 +37,15 @@ jobs:
if: runner.os == 'Windows'
run: |
choco install visualstudio2019buildtools
# choco install vcredist2015 -f -y
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
make requirements-dev
make requirements
make requirements-build
pip install --upgrade setuptools
- name: Build wheels
run: |
pip wheel -w wheelhouse .
# python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp27-win*
- uses: actions/upload-artifact@v4
Expand All @@ -56,23 +54,33 @@ jobs:
name: wikipedia-api-${{ matrix.os }}-${{ matrix.python }}.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
name: Build source dist on ${{ matrix.os }} and ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python }}

cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make requirements
make requirements-build
pip install --upgrade setuptools
- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v4
with:
path: dist/Wikipedia*.tar.gz
name: wikipedia-api-sdist.tar.gz
name: wikipedia-api-${{ matrix.os }}-${{ matrix.python }}.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: "pip"
- name: Install Tox and any other packages
run: make requirements-dev
- name: Run Tox
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ requirements:
requirements-dev:
pip3 install -r requirements-dev.txt

requirements-build:
pip3 install -r requirements-build.txt

pre-release-check: run-type-check run-flake8 run-coverage pypi-html run-tox
echo "Pre-release check was successful"

Expand Down
2 changes: 2 additions & 0 deletions requirements-build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setuptools==65.5.0
wheel==0.42.0
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Install old pythons
# https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
[tox]
envlist = py34, py35, py36, py37, py38, py39, py310, py311
envlist = py38, py39, py310, py311, py312

[testenv]
deps =
Expand Down

0 comments on commit ebdbf40

Please sign in to comment.