Skip to content

Commit 6486a8b

Browse files
committed
docs: add guidelines for breaking changes
Add guidelines on how breaking changes should be approached. The guidelines take a very pragmatic approach with known downsides, but this seems like the best compromise given the current situation. For prior discussion on this point see: - RDFLib#2395 - RDFLib#2108 - RDFLib#1841
1 parent 7860cd4 commit 6486a8b

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

docs/developers.rst

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ developing RDFLib code.
1616
* You must supply tests for new code.
1717
* RDFLib uses `Poetry <https://python-poetry.org/docs/master/>`_ for dependency management and packaging.
1818

19-
If you add a new cool feature, consider also adding an example in ``./examples``
19+
If you add a new cool feature, consider also adding an example in ``./examples``.
2020

2121
Pull Requests Guidelines
2222
------------------------
@@ -71,6 +71,50 @@ the users of this project.
7171
Please note that while we would like all PRs to follow the guidelines given
7272
here, we will not reject a PR just because it does not.
7373

74+
Guidelines for breaking changes
75+
-------------------------------
76+
77+
Breaking changes to RDFLib's public API should be made incrementally, with small
78+
pull requests to the main branch that change as few things as possible.
79+
80+
Breaking changes should be discussed first in an issue before work is started,
81+
as it is possible that the change is not necessary or that there is a better way
82+
to achieve the same goal, in which case the work on the PR would have been
83+
wasted. This will however not be strictly enforced, and no PR will be rejected
84+
solely on the basis that it was not discussed upfront.
85+
86+
RDFLib follows `semantic versioning <https://semver.org/spec/v2.0.0.html>`_ and `trunk-based development
87+
<https://trunkbaseddevelopment.com/>`_, so if any breaking changes were
88+
introduced into the main branch since the last release, then the next release
89+
will be a major release with an incremented major version.
90+
91+
Releases of RDFLib will not as a rule be conditioned on specific features, so
92+
there may be new major releases that contain very few breaking changes, and
93+
there could be no minor or patch releases between two major releases.
94+
95+
Rationale
96+
~~~~~~~~~
97+
RDFLib has been around for more than a decade, and in this time both Python and
98+
RDF have evolved. RDFLib's public API has also accumulated some problems over
99+
time.
100+
101+
There are more or less two ways to address the shortcomings of RDFLib's public
102+
API:
103+
104+
- Revolutionary: Create a new API from scratch and reimplement it, and when
105+
ready, release a new version of RDFLib with the new API.
106+
- Evolutionary: Incrementally improve the existing API with small changes and
107+
release any breaking changes that were made at regular intervals.
108+
109+
While the revolutionary approach seems appealing, it is also risky and
110+
time-consuming.
111+
112+
The evolutionary approach puts a lot of strain on the users of RDFLib as they
113+
have to adapt to breaking changes more often, but the shortcomings of the RDFLib
114+
public API also put a lot of strain on the users of RDFLib. On the other hand, a
115+
major advantage of the evolutionary approach is that it is simple and achievable
116+
from a maintenance and contributor perspective.
117+
74118
.. _tests:
75119

76120
Tests

docs/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ API reference:
9090
.. * :ref:`genindex`
9191
.. * :ref:`modindex`
9292
93+
Versioning
94+
----------
95+
RDFLib follows `Semantic Versioning 2.0.0 <https://semver.org/spec/v2.0.0.html>`_, which can be summarized as follows:
96+
97+
Given a version number ``MAJOR.MINOR.PATCH``, increment the:
98+
99+
#. ``MAJOR`` version when you make incompatible API changes
100+
#. ``MINOR`` version when you add functionality in a backwards-compatible
101+
manner
102+
#. ``PATCH`` version when you make backwards-compatible bug fixes
93103

94104
For developers
95105
--------------

0 commit comments

Comments
 (0)