Skip to content

Commit

Permalink
Merge branch 'main' into rfc-7529
Browse files Browse the repository at this point in the history
  • Loading branch information
niccokunzmann committed Jul 1, 2024
2 parents 88d72e8 + a7062b9 commit e64a1ad
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 15 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Upload coverage data to coveralls.io
run: coveralls --service=github-actions
run: coveralls --service=github || which coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -60,13 +60,16 @@ jobs:
# 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
container: python:3-slim
steps:
- name: Install dependencies
run: pip3 install --upgrade coveralls
- name: Upload coverage
run: coveralls --service=github-actions --finish
run: coveralls --service=github --finish || which coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ Minor changes:

- Test that all code works with both ``pytz`` and ``zoneinfo``.
- Make coverage report submission optional for pull requests
- Parallelize coverage
- Rename ``master`` branch to ``main``, see `Issue
<https://github.com/collective/icalendar/issues/627>`_
- Update ``docs/usage.rst`` to use zoneinfo instead of pytz.
- Added missing public classes and functions to API documentation.
- Add version badge
- Improved namespace management in the ``icalendar`` directory.
- Add Python version badge and badge for test coverage
- Remove 4.x badge
- Update list of ``tox`` environments

Expand Down Expand Up @@ -63,6 +66,7 @@ New features:
- Allows selecting components with ``walk(select=func)`` where ``func`` takes a
component and returns ``True`` or ``False``.
- Add compatibility to :rfc:`7529`, adding ``vMonth`` and ``vSkip``
- Add `sphinx-autobuild` for `livehtml` Makefile target.

Bug fixes:

Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ files.
:target: https://icalendar.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://coveralls.io/repos/github/collective/icalendar/badge.svg
:target: https://coveralls.io/github/collective/icalendar
:alt: Test Coverage


.. _`icalendar`: https://pypi.org/project/icalendar/
.. _`RFC 5545`: https://www.ietf.org/rfc/rfc5545.txt
.. _`python-dateutil`: https://github.com/dateutil/dateutil/
Expand Down
19 changes: 13 additions & 6 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
LOCALESDIR = _locales
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXAUTOBUILD = sphinx-autobuild
PAPER =
BUILDDIR = _build
LOCALESDIR = _locales

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand All @@ -15,7 +16,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext livehtml

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand Down Expand Up @@ -159,3 +160,9 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

livehtml:
$(SPHINXAUTOBUILD) \
--ignore "*.swp" \
--port 8050 \
-b html . "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
1 change: 1 addition & 0 deletions docs/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ icalendar contributors
- Felix Stupp <felix.stupp@banananet.work>
- Bastian Wegge <wegge@crossbow.de>
- `Steve Piercy <https://github.com/stevepiercy>`_
- Jeffrey Whewhetu <jeffwhewhetu@gmail.com>

Find out who contributed::

Expand Down
12 changes: 6 additions & 6 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ Property parameters are automatically added, depending on the input value. For
example, for date/time related properties, the value type and timezone
identifier (if applicable) are automatically added here::

>>> import pytz
>>> import zoneinfo
>>> event = Event()
>>> event.add('dtstart', datetime(2010, 10, 10, 10, 0, 0,
... tzinfo=pytz.timezone("Europe/Vienna")))
... tzinfo=zoneinfo.ZoneInfo("Europe/Vienna")))

>>> lines = event.to_ical().splitlines()
>>> assert (
Expand Down Expand Up @@ -279,7 +279,7 @@ Init the calendar::

>>> cal = Calendar()
>>> from datetime import datetime
>>> import pytz
>>> import zoneinfo

Some properties are required to be compliant::

Expand All @@ -290,9 +290,9 @@ We need at least one subcomponent for a calendar to be compliant::

>>> event = Event()
>>> event.add('summary', 'Python meeting about calendaring')
>>> event.add('dtstart', datetime(2005,4,4,8,0,0,tzinfo=pytz.utc))
>>> event.add('dtend', datetime(2005,4,4,10,0,0,tzinfo=pytz.utc))
>>> event.add('dtstamp', datetime(2005,4,4,0,10,0,tzinfo=pytz.utc))
>>> event.add('dtstart', datetime(2005,4,4,8,0,0,tzinfo=zoneinfo.ZoneInfo("UTC")))
>>> event.add('dtend', datetime(2005,4,4,10,0,0,tzinfo=zoneinfo.ZoneInfo("UTC")))
>>> event.add('dtstamp', datetime(2005,4,4,0,10,0,tzinfo=zoneinfo.ZoneInfo("UTC")))

A property with parameters. Notice that they are an attribute on the value::

Expand Down
1 change: 1 addition & 0 deletions requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Sphinx>=1.2.3
sphinx_rtd_theme
sphinx-autobuild
.
6 changes: 6 additions & 0 deletions src/icalendar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@

# Switching the timezone provider
from icalendar.timezone import use_pytz, use_zoneinfo


__all__ = ['Calendar', 'Event', 'Todo', 'Journal', 'Timezone', 'TimezoneStandard', 'TimezoneDaylight', 'FreeBusy', 'Alarm',
'ComponentFactory', 'vBinary', 'vBoolean', 'vCalAddress', 'vDatetime', 'vDate', 'vDDDTypes', 'vDuration',
'vFloat', 'vInt', 'vPeriod','vWeekday', 'vFrequency', 'vRecur', 'vText', 'vTime', 'vUri', 'vGeo', 'vUTCOffset',
'vTypesFactory', 'Parameters', 'q_split', 'q_join', 'use_pytz', 'use_zoneinfo']

0 comments on commit e64a1ad

Please sign in to comment.