Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/pre-commit-3.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-majlis authored Jul 21, 2024
2 parents e64f94b + 0534cfc commit 0841881
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 42 deletions.
49 changes: 46 additions & 3 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,11 +30,52 @@ 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
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
uses: codecov/codecov-action@v4.4.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: martin-majlis/Wikipedia-API
75 changes: 50 additions & 25 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ 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

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

- name: Install Python 3
if: runner.os == 'Windows'
Expand All @@ -37,42 +37,50 @@ 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@v2
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/Wikipedia*.whl
# name: wheel-${{ matrix.os }}-${{ matrix.python }}.whl
path: wheelhouse/Wikipedia*.whl
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@v2
- 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@v2
- uses: actions/upload-artifact@v4
with:
path: dist/Wikipedia*.tar.gz
# name: sdist.tar.gz
name: Wikipedia-api-${{ matrix.os }}-${{ matrix.python }}.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
Expand All @@ -81,14 +89,31 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: pypi
url: https://pypi.org/p/Wikipedia-API
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
pattern: Wikipedia-api-*
path: downloaded
- name: Display structure of downloaded files
run: ls -lR downloaded
- name: Prepare distribution structure
run: |
mkdir -p dist
for f in $( find downloaded -type f ); do \
echo ${f}; \
d=$( dirname ${f} | rev | cut -d'/' -f 1 | rev ); \
echo ${d}; \
cp -v ${f} dist/${d}; \
done
- name: Display structure of dist files
run: ls -lR dist
- uses: pypa/gh-action-pypi-publish@v1.8.14
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/
verbose: true
print-hash: true
5 changes: 3 additions & 2 deletions .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@v2
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
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

0.6.8
-----

* Update dependencies
* Add tests for more platforms

0.6.0
-----

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: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# The short X.Y version.
version = "0.6"
# The full version, including alpha/beta/rc tags.
release = "0.6.0"
release = "0.6.8"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
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==70.0.0
wheel==0.43.0
14 changes: 7 additions & 7 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
black==24.2.0
coverage==7.4.2
black==24.4.2
coverage==7.6.0
flake8==7.0.0
isort==5.13.2
mypy==1.4.1
mypy==1.10.1
pre-commit==3.6.2
pygments==2.17.2
pygments==2.18.0
sphinx==7.0.1
tox==4.13.0
types-requests==2.31.0
types-setuptools==69.1.0.20240223
tox==4.14.2
types-requests==2.32.0.20240712
types-setuptools==69.5.0.20240423
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requests==2.31.0
requests==2.32.2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def fix_doc(txt):

setup(
name="Wikipedia-API",
version="0.6.0",
version="0.6.8",
description="Python Wrapper for Wikipedia",
long_description=README + "\n\n" + CHANGES,
classifiers=[
Expand Down
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
2 changes: 1 addition & 1 deletion wikipediaapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
cases.
"""

__version__ = (0, 6, 0)
__version__ = (0, 6, 8)
from collections import defaultdict
from enum import IntEnum
import logging
Expand Down

0 comments on commit 0841881

Please sign in to comment.