diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index a51b52a..e70fab4 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -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 }} diff --git a/.github/workflows/disperse.yml b/.github/workflows/disperse.yml index c5e2cd7..13b2536 100644 --- a/.github/workflows/disperse.yml +++ b/.github/workflows/disperse.yml @@ -1,8 +1,7 @@ ---- name: Disperse configuration "on": - - push +- push jobs: build: @@ -10,5 +9,5 @@ jobs: 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 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index c95ae77..71879bc 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -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 diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 75f27c2..4976b1d 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -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: @@ -15,62 +15,62 @@ 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 @@ -78,11 +78,11 @@ jobs: 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 diff --git a/pyproject.toml b/pyproject.toml index c29f377..3d2f64a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: Microsoft :: Windows", ] -requires-python = ">= 3.8" +requires-python = ">=3.9" dependencies = [ "slixmpp", "aiohttp",