Skip to content

Fix Python object links in Component docs #3628

Fix Python object links in Component docs

Fix Python object links in Component docs #3628

Workflow file for this run

name: tests
on:
push:
branches:
- main
tags:
- v*
pull_request:
schedule:
- cron: '14 7 * * 0' # run once a week on Sunday
workflow_dispatch:
pull_request_review:
types: [submitted]
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
# See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/passing-information-between-jobs#example-defining-outputs-for-a-job
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v6
- name: Set matrix
id: set-matrix
run: |
matrix_json="$(python .github/workflows/generate_matrix.py '${{ github.ref }}' '${{ github.event.review.state }}' )"
echo "include=$(echo "$matrix_json" | python -c 'import json,sys; print(json.dumps(json.load(sys.stdin)["include"]))')" >> $GITHUB_OUTPUT
run-tests:
needs: generate-matrix
strategy:
matrix:
include: ${{ fromJSON(needs.generate-matrix.outputs.include) }}
runs-on: ubuntu-latest
name: ${{ matrix.test_name }}
steps:
- name: Skip notice
if: ${{ matrix.skip }}
run: echo "Skipped ${{ matrix.test_name }} (not required for this trigger)"
- uses: actions/checkout@v6
if: ${{ !matrix.skip }}
- name: Install uv and Python ${{ matrix.python_version }}
if: ${{ !matrix.skip }}
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
# Install a specific version of uv.
version: "0.11.6"
python-version: ${{ matrix.python_version }}
- name: Install dependencies
if: ${{ !matrix.skip }}
run: |
make dev PYTHONVERSION=${{ matrix.python_version }}
uv tree
- name: Test
if: ${{ !matrix.skip }}
run: ${{ matrix.test_command }}
- name: Coveralls Parallel
if: ${{ !matrix.skip }}
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{ matrix.test_name }}
parallel: true
file: coverage.xml
allow-empty: true
fail-on-error: false
coverage:
# parallel test coverage upload
# see https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-support
name: Submit test coverage
needs: run-tests
# always finalize coverage aftest tests ran
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
format: cobertura
fail-on-error: false
test-distribution:
name: Check built package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build distribution files
run: python -m build # same as in deploy-tag-to-pypi
- name: Check distribution files
run: twine check dist/*
deploy-tag-to-pypi:
# only deploy on tags, see https://stackoverflow.com/a/58478262/1320237
if: startsWith(github.ref, 'refs/tags/v')
needs:
- run-tests
- test-distribution
runs-on: ubuntu-latest
# This environment stores the TWINE_USERNAME and TWINE_PASSWORD
# see https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
environment:
name: PyPI
url: https://pypi.org/project/icalendar/
# after using the environment, we need to make the secrets available
# see https://docs.github.com/en/actions/security-guides/encrypted-secrets#example-using-bash
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: remove old files
run: rm -rf dist/*
- name: build distribution files
run: python -m build # same as in test-distribution
- name: deploy to pypi
run: |
# You will have to set the variables TWINE_USERNAME and TWINE_PASSWORD
# You can use a token specific to your project by setting the user name to
# __token__ and the password to the token given to you by the PyPI project.
# sources:
# - https://shambu2k.hashnode.dev/gitlab-to-pypi
# - http://blog.octomy.org/2020/11/deploying-python-pacakges-to-pypi-using.html?m=1
if [ -z "$TWINE_USERNAME" ]; then
echo "WARNING: TWINE_USERNAME not set!"
fi
if [ -z "$TWINE_PASSWORD" ]; then
echo "WARNING: TWINE_PASSWORD not set!"
fi
twine check dist/*
twine upload dist/*
deploy-github-release:
# only deploy on tags, see https://stackoverflow.com/a/58478262/1320237
if: startsWith(github.ref, 'refs/tags/v')
needs:
- run-tests
- test-distribution
runs-on: ubuntu-latest
environment:
name: github-release
steps:
- uses: actions/checkout@v6
- name: Create GitHub release from tag
uses: ncipollo/release-action@v1
with:
allowUpdates: true
body: "To view the changes, please see the [Changelog](https://icalendar.readthedocs.io/en/latest/changelog.html). This release can be installed from [PyPI](https://pypi.org/project/icalendar/#history)."
generateReleaseNotes: false