4
4
Contributing to *XCP-D *
5
5
#######################
6
6
7
- This guide describes the organization and preferred coding style for XCP-D,
7
+ This guide describes the organization and preferred coding style for * XCP-D * ,
8
8
for prospective code contributors.
9
9
10
10
.. important ::
@@ -57,7 +57,7 @@ but the main ones are ``black`` and ``isort``.
57
57
58
58
.. tip ::
59
59
60
- Please run ``isort `` and ``black `` on the `` XCP-D `` codebase before opening a pull request.
60
+ Please run ``isort `` and ``black `` on the * XCP-D * codebase before opening a pull request.
61
61
62
62
Also run ``flake8 `` to check for any additional style issues.
63
63
@@ -129,9 +129,9 @@ Here is an example of a basic workflow, written in the preferred style for *XCP-
129
129
return workflow
130
130
131
131
132
- *************************************************
133
- Contributing to XCP-D without adding dependencies
134
- *************************************************
132
+ ***************************************************
133
+ Contributing to * XCP-D * without adding dependencies
134
+ ***************************************************
135
135
136
136
In the most common case, you will want to modify *XCP-D *'s Python code without adding any
137
137
dependencies (Python or not) to the Docker image.
@@ -144,15 +144,15 @@ image yourself.
144
144
145
145
docker pull pennlinc/xcp_d:unstable
146
146
147
- 2. Fork the XCP-D repository to your GitHub account.
147
+ 2. Fork the * XCP-D * repository to your GitHub account.
148
148
For more information on contributing via the fork-and-branch approach,
149
149
see `GitHub's contributing guide
150
150
<https://docs.github.com/en/get-started/quickstart/contributing-to-projects> `_.
151
151
152
152
3. Clone your forked repository to your local machine.
153
153
154
154
4. Create a branch to work on.
155
- **Make sure your branch is up to date with XCP-D's ``main`` branch before making any
155
+ **Make sure your branch is up to date with * XCP-D* 's ``main`` branch before making any
156
156
changes! **
157
157
158
158
5. Make changes to the codebase that you want to try out.
@@ -175,26 +175,44 @@ image yourself.
175
175
176
176
7. Push your changes to GitHub.
177
177
178
- 8. Open a pull request to PennLINC/XCP-D 's ``main `` branch.
178
+ 8. Open a pull request to `` pennlinc/xcp_d `` 's ``main `` branch.
179
179
Please follow `NiPreps contributing guidelines <https://www.nipreps.org/community/ >`_
180
180
when preparing a pull request.
181
181
182
182
183
- Running tests
184
- =============
183
+ Running tests locally
184
+ =====================
185
185
186
186
While CircleCI will automatically run *XCP-D *'s tests for any open PRs,
187
187
we strongly recommend running at least some tests locally, to make sure your proposed changes work.
188
188
189
189
*XCP-D * has a file, ``xcp_d/tests/run_local_tests.py ``, that builds Docker ``run `` commands to
190
- run selected tests.
190
+ to automatically mount the local clone into ``pennlinc/xcp_d:unstable `` and run tests with
191
+ ``pytest ``.
192
+ The script will also download any required test data from Box.
191
193
Please use that script to run some tests locally before opening your PR.
192
194
195
+ To run the tests, navigate to the tests folder and run ``run_local_tests.py ``::
196
+
197
+ $ cd /path/to/xcp_d/xcp_d/tests
198
+ $ python run_local_tests.py
199
+
200
+ You can select individual tests to run by using the ``-m `` (to select markers) or
201
+ ``-k `` (the select tests by name) flags::
202
+
203
+ $ python run_local_tests.py -m "dsdti_fmap"
204
+ $ python run_local_tests.py -k "test_some_name"
205
+
193
206
If all tests pass, this is a strong indication that your proposed changes do not introduce bugs.
194
207
However, we strongly recommend reviewing the output files- especially the HTML reports-
195
208
from the integration tests to see how your proposed changes affect the primary outputs from
196
209
*XCP-D *.
197
210
211
+ .. warning ::
212
+
213
+ Please note that the integration tests in *XCP-D * are computationally intensive
214
+ and may take a long time to run, so be prepared for that before running them on a laptop.
215
+
198
216
199
217
********************************
200
218
Adding or modifying dependencies
@@ -220,9 +238,9 @@ and rebuild the *XCP-D* Docker image locally to test out your change.
220
238
Once your change is working, you can open a pull request to the *XCP-D * repo.
221
239
222
240
223
- *****************
224
- Maintaining XCP-D
225
- *****************
241
+ *******************
242
+ Maintaining * XCP-D *
243
+ *******************
226
244
227
245
228
246
Making a Release
@@ -239,7 +257,7 @@ To make an *XCP-D* release, complete the following steps:
239
257
(e.g., ``1.0.0 ``).
240
258
#. For pre-releases, select the "This is a pre-release" option.
241
259
#. Select the "Generate release notes" button.
242
- This will create most of the necessary release notes based on XCP-D's config file.
260
+ This will create most of the necessary release notes based on * XCP-D * 's config file.
243
261
#. At the top of the release notes, add some information summarizing the release.
244
262
245
263
3. Once the release notes have been completed, open a new PR with the following changes:
0 commit comments