You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+86-14Lines changed: 86 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,17 +25,18 @@ Let us know if you have any further questions, and we look forward to your contr
25
25
-[Cloning the Repository](#cloning-the-repository)
26
26
-[Setting Up a Development Environment with Nox (Recommended)](#setting-up-a-development-environment-with-nox-recommended)
27
27
-[Setting Up a Development Environment Manually](#setting-up-a-development-environment-manually)
28
+
-[Configure Git](#configure-git)
28
29
-[Create and activate a fresh environment](#create-and-activate-a-fresh-environment)
29
30
-[Install dependencies](#install-dependencies)
30
-
-[Add the upstream remote](#add-the-upstream-remote)
31
31
-[Installing and Using the Pre-Commit Hooks](#installing-and-using-the-pre-commit-hooks)
32
32
-[Building the Project](#building-the-project)
33
33
-[Build with Nox](#build-with-nox)
34
34
-[Build manually](#build-manually)
35
35
-[Contributing Changes](#contributing-changes)
36
36
-[Decide which branch to use](#decide-which-branch-to-use)
37
37
-[Prepare your topic branch](#prepare-your-topic-branch)
38
-
-[Commit your changes](#commit-your-changes)
38
+
-[Sync the latest Spyder docstrings (optional)](#sync-the-latest-spyder-docstrings-optional)
39
+
-[Make and commit your changes](#make-and-commit-your-changes)
39
40
-[Push your branch](#push-your-branch)
40
41
-[Submit a Pull Request](#submit-a-pull-request)
41
42
-[Standards and Conventions](#standards-and-conventions)
@@ -58,10 +59,10 @@ If referring to a specific line or file, please be sure to provide a snippet of
58
59
## Cloning the Repository
59
60
60
61
First, navigate to the [project repository](https://github.com/spyder-ide/spyder-api-docs) in your web browser and press the ``Fork`` button to make a personal copy of the repository on your own GitHub account.
61
-
Then, click the ``Clone or Download`` button on your repository, copy the link and run the following on the command line to clone the repo:
62
+
Then, click the ``Clone or Download`` button on your repository, copy the link and run the following on the command line to clone the repo (with submodules):
After cloning the repository, navigate to its new directory using the `cd` command:
@@ -119,6 +120,22 @@ For advanced users, if you'd prefer to also have your own local environment with
119
120
**Note**: You may need to substitute ``python3`` for ``python`` in the commands below on some Linux distros where ``python`` isn't mapped to ``python3`` (yet).
120
121
121
122
123
+
### Configure Git
124
+
125
+
Make sure to set the upstream Git remote to the official Spyder-API-Docs repo with:
It's also a good idea to configure Git to automatically pull, checkout and push submodules:
132
+
133
+
```shell
134
+
git config --local submodule.recurse true
135
+
git config --local push.recurseSubmodules check
136
+
```
137
+
138
+
122
139
### Create and activate a fresh environment
123
140
124
141
We highly recommend you create and activate a virtual environment to avoid any conflicts with other packages on your system or causing any other issues.
@@ -128,7 +145,7 @@ Regardless of the tool you use, make sure to remember to always activate your en
128
145
129
146
#### Conda
130
147
131
-
To create an environment with Conda (recommended), simply execute the following:
148
+
To create an environment with Conda (recommended), execute the following:
@@ -177,17 +194,14 @@ Or if using ``pip``, you can grab them with:
177
194
python -m pip install -r requirements.txt
178
195
```
179
196
180
-
181
-
### Add the upstream remote
182
-
183
-
Make sure to set the upstream Git remote to the official Spyder-API-Docs repo with:
197
+
If you plan to generate and build the API reference documentation extracted from Spyder's docstrings, you'll also need to install Spyder in development mode as well as its dev dependencies.
198
+
To do so, you can run the ``install_dev_repos.py`` script in the ``spyder`` submodule:
This repository uses [Pre-Commit](https://pre-commit.com/) to install, configure and update a suite of pre-commit hooks that check for common problems and issues, and fix many of them automatically.
@@ -240,7 +254,13 @@ To build the project using Nox, just run
240
254
nox -s build
241
255
```
242
256
243
-
and can then open the rendered output in your default web browser with
257
+
or, to also extract, generate and build the API reference from Spyder's docstrings (expensive the first time), pass the ``-t autodoc`` argument to any build command:
258
+
259
+
```shell
260
+
nox -s build -- -t autodoc
261
+
```
262
+
263
+
and then open the rendered output in your default web browser with
244
264
245
265
```shell
246
266
nox -s serve
@@ -249,7 +269,7 @@ nox -s serve
249
269
Alternatively, to automatically rebuild the project when changes occur, you can invoke
250
270
251
271
```shell
252
-
nox -s autobuild
272
+
nox -s autorebuild
253
273
```
254
274
255
275
You can also pass your own custom [Sphinx build options](https://www.sphinx-doc.org/en/master/man/sphinx-build.html) after a ``--`` separator, which are added to the default set.
@@ -259,6 +279,12 @@ For example, to rebuild just the install guide and FAQ in verbose mode with the
or to also extract, generate and build the API reference from Spyder's docstrings (requires Spyder and its dependencies to be installed in your environment):
Then, navigate to the ``_build/html`` directory inside the ``spyder-docs`` repository and open ``index.html`` (the main page of the docs) in your preferred browser.
272
304
305
+
When changing build options (particularly autodoc), cleaning the generated files first avoids spurious errors:
*If* your pull request requires the latest docstring changes from the Spyder repo, or there's a reason to manually update them, you can update the submodule to the latest stable branch either with Nox:
340
+
341
+
```shell
342
+
nox -s sync-spyder
343
+
```
344
+
345
+
or manually:
346
+
347
+
```shell
348
+
git submodule update --remote
349
+
```
350
+
351
+
**Note**: If using the manual command and you've checked out the submodule to a topic branch tracking your fork rather than the upstream Spyder repository, you'll need to either check out `6.x` first (setting it to track the main Spyder repo if it isn't already):
352
+
353
+
```shell
354
+
cd spyder
355
+
git switch 6.x
356
+
git --set-upstream-to upstream 6.x # If required
357
+
cd ..
358
+
```
359
+
360
+
Or, to integrate the changes into your own branch (assuming `upstream` is the Spyder repository):
361
+
362
+
```shell
363
+
cd spyder
364
+
git fetch upstream 6.x
365
+
git rebase FETCH_HEAD
366
+
cd ..
367
+
```
368
+
369
+
370
+
### Make and commit your changes
299
371
300
372
Once you've made and tested your changes, add them to the staging area, and then commit them with a descriptive message.
0 commit comments