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? #92

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

API changes in version 2.0? #92

tobixen opened this issue May 15, 2020 · 2 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 an upcoming 1.0-release. This top entry will be edited to reflect all significant changes planned.

Backward compatibility plan

I would like users to be able to upgrade to 1.0 without changing anything, if possible (though, hacks to support usage patterns from 0.5 and earlier may be dropped in 1.0). When version 2.0 comes, all hacks to support backward-compatibility with 1.x will be removed. My suggestion is that the proper usage of 1.0 is to start with something 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 2.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 1.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 2.0 we'll refactor and remove the NG-cruft.

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

API Changes

  • some_obj.instance is deprecated, new methods some_obj.icalendar_instance and some_obj.vobject_instance (as well as some_obj.icalendar_component)
  • Drop python2 support #228
  • 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)
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