@@ -102,26 +102,33 @@ To verify that your development environment is working, you can run the unit tes
102102Creating a branch
103103~~~~~~~~~~~~~~~~~
104104
105+ Before you do any new work or submit a pull request, please open an issue on GitHub to
106+ report the bug or propose the feature you'd like to add.
107+
105108It's best to create a new, separate branch for each piece of work you want to do. E.g.::
106109
107110 git fetch upstream
108111 git checkout -b shiny-new-feature upsteam/master
109112
110- This changes your working directory to the shiny-new-feature branch. Keep any changes in
113+ This changes your working directory to the ' shiny-new-feature' branch. Keep any changes in
111114this branch specific to one bug or feature so it is clear what the branch brings to
112115NumCodecs.
113116
114117To update this branch with latest code from NumCodecs, you can retrieve the changes from
115- the master branch::
118+ the master branch and perform a rebase ::
116119
117120 git fetch upstream
118121 git rebase upstream/master
119122
120123This will replay your commits on top of the latest NumCodecs git master. If this leads to
121124merge conflicts, these need to be resolved before submitting a pull request.
125+ Alternatively, you can merge the changes in from upstream/master instead of rebasing,
126+ which can be simpler::
122127
123- Before you do any new work or submit a pull request, please open an issue on GitHub to
124- report the bug or propose the feature you'd like to add.
128+ git fetch upstream
129+ git merge upstream/master
130+
131+ Again, any conflicts need to be resolved before submitting a pull request.
125132
126133Running the test suite
127134~~~~~~~~~~~~~~~~~~~~~~
@@ -191,3 +198,121 @@ The documentation can be built by running::
191198 $ tox -e docs
192199
193200The resulting built documentation will be available in the ``.tox/docs/tmp/html `` folder.
201+
202+ Development best practices, policies and procedures
203+ ---------------------------------------------------
204+
205+ The following information is mainly for core developers, but may also be of interest to
206+ contributors.
207+
208+ Merging pull requests
209+ ~~~~~~~~~~~~~~~~~~~~~
210+
211+ Pull requests submitted by an external contributor should be reviewed and approved by at least
212+ one core developers before being merged. Ideally, pull requests submitted by a core developer
213+ should be reviewed and approved by at least one other core developers before being merged.
214+
215+ Pull requests should not be merged until all CI checks have passed (Travis, AppVeyor,
216+ Coveralls) against code that has had the latest master merged in.
217+
218+ Compatibility and versioning policies
219+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
220+
221+ Because NumCodecs is a data encoding/decoding library, there are two types of compatibility to
222+ consider: API compatibility and data format compatibility.
223+
224+ API compatibility
225+ """""""""""""""""
226+
227+ All functions, classes and methods that are included in the API
228+ documentation (files under ``docs/api/*.rst ``) are considered as part of the NumCodecs
229+ **public API **, except if they have been documented as an experimental feature, in which case they
230+ are part of the **experimental API **.
231+
232+ Any change to the public API that does **not ** break existing third party
233+ code importing NumCodecs, or cause third party code to behave in a different way, is a
234+ **backwards-compatible API change **. For example, adding a new function, class or method is usually
235+ a backwards-compatible change. However, removing a function, class or method; removing an argument
236+ to a function or method; adding a required argument to a function or method; or changing the
237+ behaviour of a function or method, are examples of **backwards-incompatible API changes **.
238+
239+ If a release contains no changes to the public API (e.g., contains only bug fixes or
240+ other maintenance work), then the micro version number should be incremented (e.g.,
241+ 2.2.0 -> 2.2.1). If a release contains public API changes, but all changes are
242+ backwards-compatible, then the minor version number should be incremented
243+ (e.g., 2.2.1 -> 2.3.0). If a release contains any backwards-incompatible public API changes,
244+ the major version number should be incremented (e.g., 2.3.0 -> 3.0.0).
245+
246+ Backwards-incompatible changes to the experimental API can be included in a minor release,
247+ although this should be minimised if possible. I.e., it would be preferable to save up
248+ backwards-incompatible changes to the experimental API to be included in a major release, and to
249+ stabilise those features at the same time (i.e., move from experimental to public API), rather than
250+ frequently tinkering with the experimental API in minor releases.
251+
252+ Data format compatibility
253+ """""""""""""""""""""""""
254+
255+ Each codec class in NumCodecs exposes a ``codec_id `` attribute, which is an identifier for the
256+ **format of the encoded data ** produced by that codec. Thus it is valid for two or more codec
257+ classes to expose the same value for the ``codec_id `` attribute if the format of the encoded data
258+ is identical. The ``codec_id `` is intended to provide a basis for achieving and managing
259+ interoperability between versions of the NumCodecs package, as well as between NumCodecs and other
260+ software libraries that aim to provide compatible codec implementations. Currently there is no
261+ formal specification of the encoded data format corresponding to each ``codec_id ``, so the codec
262+ classes provided in the NumCodecs package should be taken as the reference implementation for a
263+ given ``codec_id ``.
264+
265+ There must be a one-to-one mapping from ``codec_id `` values to encoded data formats, and that
266+ mapping must not change once the first implementation of a ``codec_id `` has been published within a
267+ NumCodecs release. If a change is proposed to the encoded data format for a particular type of
268+ codec, then this must be implemented in NumCodecs via a new codec class exposing a new ``codec_id ``
269+ value.
270+
271+ Note that the NumCodecs test suite includes a data fixture and tests to try and ensure that
272+ data format compatibility is not accidentally broken. See the
273+ :func: `test_backwards_compatibility ` functions in test modules for each codec for examples.
274+
275+ When to make a release
276+ ~~~~~~~~~~~~~~~~~~~~~~
277+
278+ Ideally, any bug fixes that don't change the public API should be released as soon as
279+ possible. It is fine for a micro release to contain only a single bug fix.
280+
281+ When to make a minor release is at the discretion of the core developers. There are no
282+ hard-and-fast rules, e.g., it is fine to make a minor release to make a single new
283+ feature available; equally, it is fine to make a minor release that includes a number of
284+ changes.
285+
286+ Major releases obviously need to be given careful consideration, and should be done as
287+ infrequently as possible, as they will break existing code and/or affect data
288+ compatibility in some way.
289+
290+ Release procedure
291+ ~~~~~~~~~~~~~~~~~
292+
293+ Checkout and update the master branch::
294+
295+ $ git checkout master
296+ $ git pull
297+
298+ Verify all tests pass on all supported Python versions, and docs build::
299+
300+ $ tox
301+
302+ Tag the version (where "X.X.X" stands for the version number, e.g., "2.2.0")::
303+
304+ $ version=X.X.X
305+ $ git tag -a v$version -m v$version
306+ $ git push --tags
307+
308+ Release source code to PyPI::
309+
310+ $ python setup.py register sdist
311+ $ twine upload dist/numcodecs-${version}.tar.gz
312+
313+ Obtain checksum for release to conda-forge::
314+
315+ $ openssl sha256 dist/numcodecs-${version}.tar.gz
316+
317+ Release to conda-forge by making a pull request against the numcodecs-feedstock conda-forge
318+ repository, incrementing the version number.
0 commit comments