Skip to content

Commit cad367e

Browse files
authored
docs: add guidelines for breaking changes (#2402)
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: - #2395 - #2108 - #1841
1 parent ad56044 commit cad367e

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ def find_version(filename):
266266
# This is here to prevent:
267267
# "WARNING: more than one target found for cross-reference"
268268
"ref.python",
269+
"autosectionlabel.*",
269270
]
270271

271272
sphinx_version = tuple(int(part) for part in sphinx.__version__.split("."))

docs/developers.rst

Lines changed: 82 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,87 @@ 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+
Maintenance Guidelines
75+
----------------------
76+
77+
This section contains guidelines for maintaining RDFLib. RDFLib maintainers
78+
should try to follow these. These guidelines also serve as an indication to
79+
RDFLib users what they can expect.
80+
81+
Breaking changes
82+
~~~~~~~~~~~~~~~~
83+
84+
Breaking changes to RDFLib's public API should be made incrementally, with small
85+
pull requests to the main branch that change as few things as possible.
86+
87+
Breaking changes should be discussed first in an issue before work is started,
88+
as it is possible that the change is not necessary or that there is a better way
89+
to achieve the same goal, in which case the work on the PR would have been
90+
wasted. This will however not be strictly enforced, and no PR will be rejected
91+
solely on the basis that it was not discussed upfront.
92+
93+
RDFLib follows `semantic versioning <https://semver.org/spec/v2.0.0.html>`_ and `trunk-based development
94+
<https://trunkbaseddevelopment.com/>`_, so if any breaking changes were
95+
introduced into the main branch since the last release, then the next release
96+
will be a major release with an incremented major version.
97+
98+
Releases of RDFLib will not as a rule be conditioned on specific features, so
99+
there may be new major releases that contain very few breaking changes, and
100+
there could be no minor or patch releases between two major releases.
101+
102+
.. _breaking_changes_rationale:
103+
104+
Rationale
105+
^^^^^^^^^
106+
107+
RDFLib has been around for more than a decade, and in this time both Python and
108+
RDF have evolved, and RDFLib's API also has to evolve to keep up with these
109+
changes and to make it easier for users to use. This will inevitably require
110+
breaking changes.
111+
112+
There are more or less two ways to introduce breaking changes to RDFLib's public
113+
API:
114+
115+
- Revolutionary: Create a new API from scratch and reimplement it, and when
116+
ready, release a new version of RDFLib with the new API.
117+
- Evolutionary: Incrementally improve the existing API with small changes and
118+
release any breaking changes that were made at regular intervals.
119+
120+
While the revolutionary approach seems appealing, it is also risky and
121+
time-consuming.
122+
123+
The evolutionary approach puts a lot of strain on the users of RDFLib as they
124+
have to adapt to breaking changes more often, but the shortcomings of the RDFLib
125+
public API also put a lot of strain on the users of RDFLib. On the other hand, a
126+
major advantage of the evolutionary approach is that it is simple and achievable
127+
from a maintenance and contributor perspective.
128+
129+
Deprecating functionality
130+
~~~~~~~~~~~~~~~~~~~~~~~~~
131+
132+
To whatever extent possible, classes, functions, variables, or parameters that
133+
will be removed should be marked for deprecation in documentation, and if
134+
possible, should be changed to raise deprecation warnings if used.
135+
136+
There is however no hard requirement that something may only be removed after a
137+
deprecation notice has been added, or only after a release was made with a
138+
deprecation notice.
139+
140+
Consequently, functionality may be removed without it ever being marked as
141+
deprecated.
142+
143+
.. _deprecation_rationale:
144+
145+
Rationale
146+
^^^^^^^^^
147+
148+
Current resource limitations and the backlog of issues make it impractical to
149+
first release or incorporate deprecation notices before making quality of life
150+
changes.
151+
152+
RDFLib uses semantic versioning and provides type hints, and these are the
153+
primary mechanisms for signalling breaking changes to our users.
154+
74155
.. _tests:
75156

76157
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)