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
@@ -33,62 +33,253 @@ The second approach is making your contribution directly in the GitHub website.
33
33
## Forking the repository
34
34
35
35
Independently of the approach you choose, the first step is to fork the Python Packaging Guide repository into your personal GitHub space.
36
+
You can do this by clicking the "Fork" button in the top right corner of the repository page.
37
+
38
+
[Learn more: Fork and Clone GitHub Repos](https://datascienceskills.org/lessons/git-github/git-intro/3-fork-clone/) is a good resource to learn more about forking.
39
+
40
+
To fork a repo,
41
+
42
+
1. Make sure you are logged into GitHub.
43
+
44
+
2. Go to the repo you would like to fork, in this case the [Python Packaging Guide](https://www.github.com/pyopensci/python-package-guide) repo.
45
+
46
+
3. In the top right-hand corner of the page there is a 'Fork' button. Click that button. You will be brought to a new page where you will 'Create a new fork'. Feel free to keep all the default inputs and click 'Create fork'. This will create a copy of the repo at `https://github.com/<username>/python-package-guide`, where `<username>` is your GitHub username.
An image showing how to preview changes in GitHub. The file content is displayed in a text editor. The preview changes tab is highlighted with a red rectangle.
84
+
```
44
85
45
86
### How to commit your changes
46
87
47
-
*__TODO__: This section should show how to commit changes via the GitHub interface.*
88
+
When you are done editing the file, scroll down to the bottom of the page. You will see a section called "Commit changes".
89
+
Here you can write a title and a description for your changes. Make sure to write a clear and concise title that describes the changes you made.
An image showing how to commit changes in GitHub. The commit message is displayed in a text editor. The commit changes section is highlighted with a red rectangle.
98
+
```
99
+
100
+
After writing your commit message, click the "Commit changes" button to save your changes.
48
101
49
102
## Contributing locally on your computer
50
103
51
104
### Clone your forked repository
52
105
53
-
*__TODO__: This section should show how to clone a repository from GitHub into your computer.*
106
+
To clone your forked repository to your computer, you need to copy the URL of your forked repository and run the following command in your terminal:
107
+
108
+
```bash
109
+
git clone <URL>
110
+
```
111
+
Replace `<URL>` with the URL of your forked repository. You can find the URL by clicking the green "Code" button on your forked repository page.
An image showing how to clone a repository in GitHub. The URL of the repository is displayed in a text editor. The code button is highlighted with a red rectangle.
120
+
```
54
121
55
122
### Create a new branch
56
123
57
-
*__TODO__: This section should show how to create a new branch.*
124
+
Before making any changes, you should create a new branch to work on. This will help keep your changes separate from the main branch and make it easier to submit a pull request.
125
+
126
+
To create a new branch, run the following command in your terminal:
127
+
128
+
```bash
129
+
git checkout -b <branch-name>
130
+
```
58
131
59
132
### Create a virtual environment
60
133
61
-
*__TODO__: This section should show how to create a virtual environment using venv.*
134
+
To build the guide locally, you need to create a virtual environment and install the dependencies. You can do this by running the following commands in your terminal:
135
+
136
+
-**On Windows**:
137
+
```bash
138
+
python -m venv .venv
139
+
.venv\Scripts\activate
140
+
```
141
+
142
+
- **On MacOS and Linux**:
143
+
```bash
144
+
python -m venv .venv
145
+
source .venv/bin/activate
146
+
```
62
147
63
148
### Install the development dependencies
64
149
65
-
*__TODO__: This section should show how to install the development dependencies defined in pyproject.toml.*
150
+
To install the development dependencies, run the following commandin your terminal:
151
+
152
+
```bash
153
+
python -m pip install -e .[dev]
154
+
```
66
155
67
156
### Commit your changes
68
157
69
-
*__TODO__: This section should describe how to commit from the command line.*
158
+
After making your changes, you need to commit them to your local repository. To do this, run the following commands in your terminal:
159
+
160
+
- To see the changes you made:
161
+
```bash
162
+
git status
163
+
```
164
+
- To add the changes to the staging area:
165
+
```bash
166
+
git add .
167
+
```
168
+
- To commit the changes:
169
+
```bash
170
+
git commit -m "Your commit message here"
171
+
```
172
+
Replace `"Your commit message here"` with a clear and concise message that describes the changes you made.
70
173
71
174
### How to build the guide locally
72
175
73
-
*__TODO__: This section should describe the different sessions in nox related to building the docs: docs, docs-test, docs-live. It should also show how to see the guide built locally, by opening the right file in the browser or using the live version from docs-live*
176
+
To build the guide locally, you can use the `nox` command. This will run the default `nox` session, which builds the guide and opens it in your browser.
177
+
178
+
To see the different sessions available, you can run the following commandin your terminal:
179
+
180
+
```bash
181
+
nox --list-sessions
182
+
```
183
+
There are different sessions in nox related to building the docs: `docs`, `docs-test`, `docs-live`. You can run them by specifying the session name after the `nox` command.
184
+
185
+
- `docs`: this session builds the guide and opens it in your browser.
186
+
```bash
187
+
nox -e docs
188
+
```
189
+
To see the guide built locally, open the file `_build/html/index.html`in your browser.
190
+
191
+
- `docs-test`: this session runs the tests for the guide.
192
+
```bash
193
+
nox -e docs-test
194
+
```
195
+
If the tests fail, you will see an error message in your terminal. You need to fix the errors before submitting your pull request.
196
+
197
+
- `docs-live`: this session builds the guide and opens it in your browser with live reloading.
198
+
```bash
199
+
nox -e docs-live
200
+
```
201
+
open the local version of the guide in your browser at ``localhost`` shown in the terminal.
74
202
75
203
### Before you submit your pull request
76
204
77
-
*__TODO__: This section should describe what steps a user should follow before submitting the pull request: build the docs, verify your changes look correct, etc.*
205
+
Before submitting your pull request, make sure to run the tests and check the formatting of your code.
206
+
207
+
```bash
208
+
nox -e docs-test
209
+
```
210
+
If the tests fail, you will see an error message in your terminal. You need to fix the errors before submitting your pull request.
211
+
Also make sure to check the formatting of your documentation by building the docs locally and checking that your changes look correct.
212
+
78
213
79
214
## Submitting a pull request with your contribution
80
215
81
216
### How to make a pull request
82
217
83
-
*__TODO__: This section should describe how to make a pull request in GitHub.*
218
+
1. To open a pull request on GitHub, navigate to the main page of your forked repository and click on the "Pull requests" tab.
An image showing the status of the checks in a pull request in GitHub. The checks are displayed in a table with a status icon next to each check. The checks are highlighted with a red rectangle.
258
+
```
259
+
If any of these checks fail, you will see an error message in your pull request. You need to fix the errors before your changes can be merged.
An image showing the status of the checks in a pull request in GitHub. The checks are displayed in a table with a status icon next to each check. The checks that failed and the details link are highlighted with a red rectangle.
268
+
```
269
+
270
+
To get more information about the errors, you can click on the "Details" link next to the failed check.
88
271
89
272
### What to expect from the review process
90
273
91
-
*__TODO__: This section should describe how review happens in GitHub, how see the comments, and how to submit changes (push a new branch)*
274
+
Once you submit a pull request, a maintainer of the repository will review your changes and provide feedback. The review process may involve:
275
+
276
+
- **Comments**: the reviewer may leave comments on your pull request to ask questions or provide feedback.
277
+
- **Suggestions**: the reviewer may suggest changes to your code or documentation.
278
+
- **Approvals**: once the reviewer is satisfied with your changes, they will approve the pull request.
279
+
280
+
You can make changes to your pull request by pushing new commits to the branch. The pull request will be updated automatically with your new changes.
281
+
282
+
Once your pull request is approved, it will be merged into the main branch and your changes will be included in the guide.
0 commit comments