Skip to content

Commit 85c78f8

Browse files
Add TODO comments in the maintainers guides and update the release checklist (#3724)
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
1 parent c44b5a5 commit 85c78f8

File tree

2 files changed

+43
-20
lines changed

2 files changed

+43
-20
lines changed

.github/ISSUE_TEMPLATE/4-release_checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ assignees: ''
2323
core package dependencies (NumPy, pandas, Xarray)
2424
- [ ] Review the ["PyGMT Team" page](https://www.pygmt.org/dev/team.html)
2525
- [ ] Check to ensure that:
26-
- [ ] Deprecations and related tests are removed for this version by running `grep --include="*.py" -r vX.Y.Z` from the base of the repository
26+
- [ ] Deprecated workarounds/codes/tests are removed. Run `grep "# TODO" **/*.py` to find all potential TODOs.
2727
- [ ] All tests pass in the ["GMT Legacy Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_legacy.yaml)
2828
- [ ] All tests pass in the ["GMT Dev Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
2929
- [ ] All tests pass in the ["Doctests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_doctests.yaml)

doc/maintenance.md

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -148,34 +148,35 @@ patch release.
148148

149149
## Backwards Compatibility and Deprecation Policy
150150

151-
PyGMT is still undergoing rapid development. All of the API is subject to change
152-
until the v1.0.0 release. Versioning in PyGMT is based on the
151+
PyGMT is still undergoing rapid development. All of the API is subject to change until
152+
the v1.0.0 release. Versioning in PyGMT is based on the
153153
[semantic versioning specification](https://semver.org/spec/v2.0.0.html)
154-
(i.e., v*MAJOR*.*MINOR*.*PATCH*).
155-
Basic policy for backwards compatibility:
154+
(i.e., v*MAJOR*.*MINOR*.*PATCH*). Basic policy for backwards compatibility:
156155

157156
- Any incompatible changes should go through the deprecation process below.
158-
- Incompatible changes are only allowed in major and minor releases, not in
159-
patch releases.
157+
- Incompatible changes are only allowed in major and minor releases, not in patch releases.
160158
- Incompatible changes should be documented in the release notes.
161159

162160
When making incompatible changes, we should follow the process:
163161

164162
- Discuss whether the incompatible changes are necessary on GitHub.
165-
- Make the changes in a backwards compatible way, and raise a `FutureWarning`
166-
warning for the old usage. At least one test using the old usage should be added.
167-
- The warning message should clearly explain the changes and include the versions
168-
in which the old usage is deprecated and is expected to be removed.
169-
- The `FutureWarning` warning should appear for 2-4 minor versions, depending on
170-
the impact of the changes. It means the deprecation period usually lasts
171-
3-12 months.
163+
- Make the changes in a backwards compatible way, and raise a `FutureWarning` warning
164+
for the old usage. At least one test using the old usage should be added.
165+
- The warning message should clearly explain the changes and include the versions in
166+
which the old usage is deprecated and is expected to be removed.
167+
- The `FutureWarning` warning should appear for 2-4 minor versions, depending on the
168+
impact of the changes. It means the deprecation period usually lasts 3-12 months.
172169
- Remove the old usage and warning when reaching the declared version.
173170

174-
To rename a function parameter, add the `@deprecate_parameter` decorator near
175-
the top after the `@fmt_docstring` decorator but before the `@use_alias`
176-
decorator (if those two exist). Here is an example:
171+
### Deprecating a function parameter
177172

178-
```
173+
To rename a function parameter, add the `@deprecate_parameter` decorator near the top
174+
after the `@fmt_docstring` decorator but before the `@use_alias` decorator (if those two
175+
exist). A `TODO` comment should also be added to indicate the deprecation period (see below).
176+
Here is an example:
177+
178+
```python
179+
# TODO(PyGMT>=0.6.0): Remove the deprecated "columns" parameter.
179180
@fmt_docstring
180181
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
181182
@use_alias(J="projection", R="region", V="verbose", i="incols")
@@ -184,8 +185,30 @@ def plot(self, x=None, y=None, data=None, size=None, direction=None, **kwargs):
184185
pass
185186
```
186187

187-
In this case, the old parameter name `columns` is deprecated since v0.4.0, and
188-
will be fully removed in v0.6.0. The new parameter name is `incols`.
188+
In this case, the old parameter name `columns` is deprecated since v0.4.0, and will be
189+
fully removed in v0.6.0. The new parameter name is `incols`.
190+
191+
### TODO comments
192+
193+
Occasionally, we need to implement temporary code that should be removed in the future.
194+
This can occur in situations such as:
195+
196+
- When a parameter, function, or method is deprecated and scheduled for removal.
197+
- When workarounds are necessary to address issues in older or upcoming versions of GMT
198+
or other dependencies.
199+
200+
To track these temporary codes or workarounds, we use TODO comments. These comments
201+
should adhere to the following format:
202+
203+
```python
204+
# TODO(package>=X.Y.Z): A brief description of the TODO item.
205+
# Additional details if necessary.
206+
```
207+
The TODO comment indicates that we should address the item when *package* version
208+
*X.Y.Z* or later is required.
209+
210+
It's important not to overuse TODO comments for tracking unimplemented features.
211+
Instead, open issues to monitor these features.
189212

190213

191214
## Making a Release

0 commit comments

Comments
 (0)