Skip to content

docs: clarify new() docstrings of Alarm, Availability, Available and Todo #6817

docs: clarify new() docstrings of Alarm, Availability, Available and Todo

docs: clarify new() docstrings of Alarm, Availability, Available and Todo #6817

Workflow file for this run

name: tests
on:
push:
branches:
- main
- 7.x
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set matrix
id: set-matrix
env:
EVENT_NAME: ${{ github.event_name }}
GIT_REF: ${{ github.ref }}
REVIEW_STATE: ${{ github.event.review.state }}
run: |
matrix_json="$(python .github/workflows/generate_matrix.py "$GIT_REF" "$REVIEW_STATE" "$EVENT_NAME")"
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
if: ${{ !matrix.skip }}
- name: Install uv and Python ${{ matrix.python_version }}
if: ${{ !matrix.skip }}
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
# zizmor: ignore[cache-poisoning] - run-tests does not produce release artifacts
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@8d6379e14d29928660c4ba802d8e85393440b329 # 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@8d6379e14d29928660c4ba802d8e85393440b329 # v2
with:
parallel-finished: true
format: cobertura
fail-on-error: false
test-distribution:
name: Check built packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install uv and Python
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
enable-cache: false
version: "0.11.6"
- name: Check the release files
run: make test-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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Create GitHub release from tag
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
with:
allowUpdates: true
body: "To view the changes, please see the [Changelog](https://icalendar.readthedocs.io/en/latest/reference/changelog.html). This release can be installed from [PyPI](https://pypi.org/project/icalendar/#history)."
generateReleaseNotes: false