Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes in version 2.0 and 3.0? #92

Open
tobixen opened this issue May 15, 2020 · 3 comments
Open

API changes in version 2.0 and 3.0? #92

tobixen opened this issue May 15, 2020 · 3 comments
Labels
Milestone

Comments

@tobixen
Copy link
Member

tobixen commented May 15, 2020

Creating a new issue to keep track of changes to be considered for upcoming major-releases. This top entry will be edited to reflect all significant changes planned.

Version 1, 2, 3, ...

Version 1.0 was released mostly because a 1.0-release was "long overdue". Some few things were deprecated, and Python 2 was officially not supported anymore.

Version 2.0 will be released to unsupport python 3.7 (and possibly python 3.8). Some thoughts should be made on weather we'd like to deprecate older parts of the API while doing so. Things that are already deprecated should be gutted away.

I've long had an idea to do a major rewrite of the API, possibly that will be done in 3.0.

Backward compatibility plan

Generally, anything that is not deprecated in major verson (x-1) should still work in version x.

I'm considering a major overhaul of the API, assumed to happen in version 3.0. My suggestion is that the proper usage of 3.0 is to start with something like this:

from caldav import CalDAVClient
client = CalDAVClient(**connection_arguments)
principal = client.get_principal()

and then everything should be doable starting with the objects client or principal. In version 3.0, caldav/caldav/__init__.py will be trimmed to only reveal the CalDAVClient. All operations starting with CalDAVClient will results in objects/classes supporting the 2.0-API. For the classes where the API is changed, we'll create a new class with a class name ending with "NG" (new generation), inheritate the old class, and do the needed changes. In version 4.0 we'll refactor and remove the NG-cruft.

In 3.0, DAVClient will be a class for backward-compatibility with version 2.x. In version 4.0 we should consider to split out DAV-support to a separate davclient-module.

API Changes

  • some_obj.instance is deprecated in v1.0, new methods some_obj.icalendar_instance and some_obj.vobject_instance (as well as some_obj.icalendar_component). Will be dropped in v2.0
  • In v2.0, client side expansion of recurring events/tasks will be the default, with optional server-side expansion in the search method
  • Think through properties vs methods, and be more consistent. Use verbs for all methods? Like principal.get_calendar(), client.get_principal(), etc. Properties should probably never cause any communication towards the calendar server. Access of properties should probably never cause side effects (the current instance and data properties may have side effects).
@tobixen tobixen added this to the v1.0 milestone May 15, 2020
@tobixen tobixen mentioned this issue May 18, 2020
tobixen added a commit that referenced this issue May 20, 2020
Gives a new propery calendar_item.icalendar_instance.

The .instance property will still give a vobject, and icalendar is not
listed as a requirement yet - icalendar module will be imported late,
when needed.  In version 1.0, probably this will be reversed, with
vobject being an optional dependency and icalendar being used
internally.

This commit also changes the way data is stored, the new logic ensures
data is stored authoratively either in _data, _vobject_instance or
_icalendar_instance.  So, mess up .e. with
event.vobject_instance.vevent.due.value and it will be refleted in
event.data.  It wasn't so earlier, but during the save operation, the
instance would be given priority.

Resolves #1 - references #97 #92 #3 and #28
@tobixen tobixen added the roadmap label Feb 6, 2021
tobixen added a commit that referenced this issue Dec 3, 2022
tobixen added a commit that referenced this issue Dec 3, 2022
tobixen added a commit that referenced this issue Jan 5, 2023
@tobixen
Copy link
Member Author

tobixen commented Jan 14, 2023

SEMVER states ...

If your software is being used in production, it should probably already be 1.0.0.
If you have a stable API on which users have come to depend, you should be 1.0.0.
If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.

All three points apply, hence a 1.0-release is way overdue.

New tentative road map:

  • There won't be any 0.12. There will be a 1.0.0.
  • 1.0.0 will be fully backward-compatible with 0.11.
  • Already in 0.11, I've marked up some stuff as DEPRECATED. This stuff will be abandoned as of a future 2.0.0-release (or perhaps 3.0.0 for important things like date_search )
  • We will gradually think of what is sub-optimal with the API while working on the 1.x-series and perhaps make a new and better API available prior to a future 2.0.0-release.
  • I will think out (or check out what others are using) some framework to warn when library users are using some deprecated API.

@cyrilrbt do you have any opinions?

tobixen added a commit that referenced this issue Jan 14, 2023
tobixen added a commit that referenced this issue Jan 14, 2023
@cyrilrbt
Copy link
Member

It's always been my intention to align with semver so let's go for it!
This is a good idea, and it will be useful for future releases, go for it :)

@tobixen tobixen changed the title API changes in version 1.0? API changes in version 2.0? Jan 15, 2023
tobixen added a commit that referenced this issue Jan 15, 2023
tobixen added a commit that referenced this issue Jan 15, 2023
tobixen added a commit that referenced this issue Jan 15, 2023
* ref #92 (comment) I've decided to bump the version number to 1.0 - that's way overdue

* Documentation (including comments and docstrings) reflecting version 1.0-release and deprecation policy

* docstring: TODO-comment marking that an old method should be revised

* mostly docfixes in this commit - but also includes a minor refactoring in test configuration, rewritten basic_examples almost from scratch (and tested it)
@tobixen
Copy link
Member Author

tobixen commented Oct 26, 2024

It may be needed with a 2.0-release relatively soon due to pull request #437.

@tobixen tobixen changed the title API changes in version 2.0? API changes in version 2.0 and 3.0? Oct 26, 2024
@tobixen tobixen modified the milestones: v2.0, v.1.x Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants