Skip to content

Commit 69bf2af

Browse files
Merge pull request #38 from pycalendar/feat/extract-jmap-module
feat: extract JMAP module from python-caldav into standalone package
2 parents 58fa72a + dc57eef commit 69bf2af

41 files changed

Lines changed: 7652 additions & 64 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/integration.yml‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,4 @@ jobs:
5555
run: pip install -e ".[dev]"
5656

5757
- name: Run integration tests
58-
run: |
59-
set +e
60-
pytest tests/test_jmap_integration.py
61-
ec=$?
62-
# Exit 5 = no tests collected. Expected until #9 lands the real
63-
# extracted test suite; anything else is a genuine failure.
64-
if [ "$ec" -ne 0 ] && [ "$ec" -ne 5 ]; then
65-
exit "$ec"
66-
fi
58+
run: pytest src/calendaring_jmap/tests/test_jmap_integration.py

‎.github/workflows/tests.yml‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,9 @@ jobs:
9393

9494
- name: Run tests
9595
run: |
96-
set +e
9796
pytest --cov --cov-branch --cov-report=xml \
9897
--junitxml=junit.xml -o junit_family=legacy \
99-
tests/test_jmap_unit.py
100-
ec=$?
101-
# Exit 5 = no tests collected. Expected until #9 lands the real
102-
# extracted test suite; anything else is a genuine failure.
103-
if [ "$ec" -ne 0 ] && [ "$ec" -ne 5 ]; then
104-
exit "$ec"
105-
fi
98+
src/calendaring_jmap/tests/test_jmap_unit.py
10699
107100
- name: Upload coverage to Codecov
108101
if: ${{ !cancelled() }}

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ pre-commit install
1717
Unit tests (no server required):
1818

1919
```bash
20-
pytest tests/test_jmap_unit.py
20+
pytest src/calendaring_jmap/tests/test_jmap_unit.py
2121
```
2222

2323
Integration tests, against Cyrus IMAP via Docker:
2424

2525
```bash
2626
docker-compose -f tests/docker/cyrus/docker-compose.yml up -d
27-
pytest tests/test_jmap_integration.py
27+
pytest src/calendaring_jmap/tests/test_jmap_integration.py
2828
```
2929

3030
## Change log
@@ -37,7 +37,7 @@ touch news/<issue-number>.<type>.rst
3737

3838
Where `<type>` is one of: `breaking`, `removal`, `feature`, `bugfix`, `documentation`, `deps`, `internal`, `chore`, `security`.
3939

40-
Write a short, user-facing description of the change inside the file. Fragments are collected into [CHANGES.rst](CHANGES.rst) at release time — don't edit that file directly.
40+
Write a short, user-facing description of the change inside the file. Fragments are collected into [CHANGES.rst](CHANGES.rst) at release time. Don't edit that file directly.
4141

4242
To preview what the change log will look like:
4343

‎README.md‎

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# calendaring-jmap
55

6-
Calendar operations over JMAP (RFC 8620 + draft-ietf-jmap-calendars), mirroring the public API of [python-caldav](https://github.com/python-caldav/caldav) so user code works against either protocol unmodified.
6+
Calendar operations over JMAP (RFC 8620 + draft-ietf-jmap-calendars).
77

88
[![Tests](https://github.com/pycalendar/calendaring-jmap/actions/workflows/tests.yml/badge.svg)](https://github.com/pycalendar/calendaring-jmap/actions/workflows/tests.yml)
99
[![REUSE status](https://api.reuse.software/badge/github.com/pycalendar/calendaring-jmap)](https://api.reuse.software/info/github.com/pycalendar/calendaring-jmap)
@@ -16,28 +16,34 @@ Calendar operations over JMAP (RFC 8620 + draft-ietf-jmap-calendars), mirroring
1616
pip install calendaring-jmap
1717
```
1818

19-
Not yet published to PyPI — this package is mid-extraction from python-caldav (see [#9](https://github.com/pycalendar/calendaring-jmap/issues/9)).
19+
Not yet published to PyPI.
2020

2121
## Usage
2222

23-
The library is being extracted from python-caldav's `caldav/jmap/` module ([#9](https://github.com/pycalendar/calendaring-jmap/issues/9)) and doesn't have working code here yet. Once that lands, this section will cover listing calendars, creating events, and incremental sync.
23+
```python
24+
from calendaring_jmap import get_jmap_client
25+
26+
with get_jmap_client(
27+
url="https://jmap.example.com/.well-known/jmap",
28+
username="alice",
29+
password="secret",
30+
) as client:
31+
calendars = client.get_calendars()
32+
for cal in calendars:
33+
print(cal.name)
34+
```
2435

25-
In the meantime, see python-caldav's existing JMAP docs: https://caldav.readthedocs.io/v3.0.0/jmap.html
36+
See the [quickstart](https://calendaring-jmap.readthedocs.io/en/latest/usage/quickstart.html) for authentication options, error handling, and configuration from environment variables or a YAML file.
2637

2738
## Documentation
2839

29-
Full documentation: https://calendaring-jmap.readthedocs.io/ (coming with [#8](https://github.com/pycalendar/calendaring-jmap/issues/8))
40+
Full documentation: https://calendaring-jmap.readthedocs.io/
3041

3142
## Specs
3243

33-
- [RFC 8620](https://www.rfc-editor.org/rfc/rfc8620) — JMAP core
34-
- [draft-ietf-jmap-calendars](https://datatracker.ietf.org/doc/draft-ietf-jmap-calendars/) — JMAP Calendars
35-
- [RFC 8984](https://www.rfc-editor.org/rfc/rfc8984) — JSCalendar
36-
37-
## Related
38-
39-
- [python-caldav](https://github.com/python-caldav/caldav) — CalDAV client, source of this package's JMAP module
40-
- [icalendar](https://github.com/collective/icalendar) — iCalendar parsing, used by both
44+
- [RFC 8620](https://www.rfc-editor.org/rfc/rfc8620): JMAP core
45+
- [draft-ietf-jmap-calendars](https://datatracker.ietf.org/doc/draft-ietf-jmap-calendars/): JMAP Calendars
46+
- [RFC 8984](https://www.rfc-editor.org/rfc/rfc8984): JSCalendar
4147

4248
## Contributing
4349

‎docs/api/async_client.rst‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
:mod:`async_client` -- Async JMAP calendar client
55
==================================================
66

7-
.. This module is still an empty stub pending #9. autodoc will warn
8-
until real code lands here — expected, not a doc bug.
9-
107
.. automodule:: calendaring_jmap.async_client
118
:members:

‎docs/api/client.rst‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
:mod:`client` -- JMAP calendar client
55
======================================
66

7-
.. This module is still an empty stub pending #9. autodoc will warn
8-
until real code lands here — expected, not a doc bug.
9-
107
.. automodule:: calendaring_jmap.client
118
:members:

‎docs/api/objects.rst‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
:mod:`objects` -- JMAP data objects
55
====================================
66

7-
.. These modules are still empty stubs pending #9. autodoc will warn
8-
until real code lands here — expected, not a doc bug.
9-
107
.. automodule:: calendaring_jmap.objects.calendar
118
:members:
129

‎docs/conf.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
napoleon_google_docstring = True
6464
napoleon_numpy_docstring = False
6565
napoleon_include_init_with_doc = True
66+
# Render "Attributes:" as :ivar: field-list entries instead of standalone
67+
# attribute directives, which collide with autodoc's own dataclass field
68+
# introspection and produce "duplicate object description" warnings.
69+
napoleon_use_ivar = True
6670

6771
# Autodoc settings
6872
autodoc_default_options = {

‎docs/index.rst‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
calendaring-jmap
66
================
77

8-
Calendar operations over JMAP (:rfc:`8620` + draft-ietf-jmap-calendars), mirroring the
9-
public API of `python-caldav <https://github.com/python-caldav/caldav>`_ so user code
10-
works against either protocol unmodified.
11-
12-
This package is being extracted from python-caldav's ``caldav/jmap/`` module
13-
(`#9 <https://github.com/pycalendar/calendaring-jmap/issues/9>`_) and doesn't have
14-
working code here yet. Usage and API reference docs will be filled in as that lands.
8+
Calendar operations over JMAP (:rfc:`8620` + draft-ietf-jmap-calendars).
159

1610
.. toctree::
1711
:maxdepth: 1

‎docs/installation.rst‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ Installation
99
1010
pip install calendaring-jmap
1111
12-
Not yet published to PyPI — this package is mid-extraction from python-caldav
13-
(see `#9 <https://github.com/pycalendar/calendaring-jmap/issues/9>`_).
12+
Not yet published to PyPI.
1413

1514
From source
1615
===========

0 commit comments

Comments
 (0)