Skip to content

Commit

Permalink
Bumping python versions in GitHub workflows and pyproject.toml
Browse files Browse the repository at this point in the history
* Updated the python-version in .github/workflows/disperse.yml
* Updated the python-version in .github/workflows/pythonpackage.yml
* Updated the python-version in .github/workflows/wheels.yaml
* Updated the python-version in .github/workflows/container.yml
* Updated the requires-python field in pyproject.toml to 3.9
  • Loading branch information
jelmer committed Nov 14, 2024
1 parent 55300ab commit be10a73
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 103 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ jobs:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}{% raw %}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}{% raw %}

- name: Build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
context: .
push: true
tags: |
ghcr.io/jelmer/prometheus-xmpp-alerts:latest
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
context: .
push: true
tags: |
ghcr.io/jelmer/prometheus-xmpp-alerts:latest
labels: ${{ steps.meta.outputs.labels }}
7 changes: 3 additions & 4 deletions .github/workflows/disperse.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
name: Disperse configuration

"on":
- push
- push

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: jelmer/action-disperse-validate@v1
- uses: actions/checkout@v4
- uses: jelmer/action-disperse-validate@v1
55 changes: 30 additions & 25 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,38 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
python-version:
- '3.13'
- '3.12'
- '3.11'
- '3.10'
- '3.9'
exclude:
# There is no pyyaml wheel on macos-latest/3.9
- os: macos-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.9"
fail-fast: false

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"
- name: Style checks
run: |
python -m ruff check .
- name: Typing checks
run: |
pip install -U mypy types-pytz types-jinja2 types-PyYAML
python -m mypy --ignore-missing-imports prometheus_xmpp
- name: Test suite run
run: |
python -m pip install ".[testing]"
python -m unittest tests.test_suite
env:
PYTHONHASHSEED: random
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"
- name: Style checks
run: |
python -m ruff check .
- name: Typing checks
run: |
pip install -U mypy types-pytz types-jinja2 types-PyYAML
python -m mypy --ignore-missing-imports prometheus_xmpp
- name: Test suite run
run: |
python -m pip install ".[testing]"
python -m unittest tests.test_suite
env:
PYTHONHASHSEED: random
104 changes: 52 additions & 52 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
schedule:
- cron: "0 6 * * *" # Daily 6AM UTC build
- cron: "0 6 * * *" # Daily 6AM UTC build

jobs:
build-wheels:
Expand All @@ -15,74 +15,74 @@ jobs:
fail-fast: true

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build wheels
run: python -m build --wheel
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
path: ./dist/*.whl
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build wheels
run: python -m build --wheel
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
path: ./dist/*.whl

build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist
run: python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: artifact-source
path: ./dist/*.tar.gz
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist
run: python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: artifact-source
path: ./dist/*.tar.gz

test-sdist:
needs:
- build-sdist
- build-sdist
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: artifact-source
path: dist
- name: Test sdist
run: twine check dist/*
- name: Test installation from sdist
run: pip install dist/*.tar.gz
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: artifact-source
path: dist
- name: Test sdist
run: twine check dist/*
- name: Test installation from sdist
run: pip install dist/*.tar.gz

publish:
runs-on: ubuntu-latest
needs:
- build-wheels
- build-sdist
- build-wheels
- build-sdist
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/prometheus-xmpp-alerts
steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: artifact-*
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Download distributions
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: artifact-*
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
]
requires-python = ">= 3.8"
requires-python = ">=3.9"
dependencies = [
"slixmpp",
"aiohttp",
Expand Down

0 comments on commit be10a73

Please sign in to comment.