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
+85-10Lines changed: 85 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -44,50 +44,125 @@ You can do this by clicking the "Fork" button in the top right corner of the rep
44
44
The Python Packaging Guide is written in myST, a variant of MarkDown. You can edit the files directly in the GitHub website.
45
45
To do so, navigate to the file you want to edit and click the pencil icon in the top right corner of the file.
46
46
47
-

47
+

48
48
49
49
To preview your changes, click the "Preview changes" tab.
50
50
51
-

51
+

52
52
53
53
### How to commit your changes
54
54
55
55
When you are done editing the file, scroll down to the bottom of the page. You will see a section called "Commit changes".
56
56
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.
57
57
58
-

58
+

59
59
60
60
click on the "propose changes" button to submit your changes and open a pull request. See (How to make a pull request)[#how-to-make-a-pull-request] for more information.
61
61
62
62
## Contributing locally on your computer
63
63
64
64
### Clone your forked repository
65
65
66
-
*__TODO__: This section should show how to clone a repository from GitHub into your computer.*
66
+
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:
67
+
68
+
```bash
69
+
git clone <URL>
70
+
```
71
+
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.
*__TODO__: This section should show how to create a new branch.*
77
+
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.
78
+
79
+
To create a new branch, run the following command in your terminal:
80
+
81
+
```bash
82
+
git checkout -b <branch-name>
83
+
```
71
84
72
85
### Create a virtual environment
73
86
74
-
*__TODO__: This section should show how to create a virtual environment using venv.*
87
+
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:
88
+
89
+
-**On Windows**:
90
+
```bash
91
+
python -m venv .venv
92
+
.venv\Scripts\activate
93
+
```
94
+
95
+
- **On MacOS and Linux**:
96
+
```bash
97
+
python -m venv .venv
98
+
source .venv/bin/activate
99
+
```
75
100
76
101
### Install the development dependencies
77
102
78
-
*__TODO__: This section should show how to install the development dependencies defined in pyproject.toml.*
103
+
To install the development dependencies, run the following commandin your terminal:
104
+
105
+
```bash
106
+
python -m pip install -e .[dev]
107
+
```
79
108
80
109
### Commit your changes
81
110
82
-
*__TODO__: This section should describe how to commit from the command line.*
111
+
After making your changes, you need to commit them to your local repository. To do this, run the following commands in your terminal:
112
+
113
+
- To see the changes you made:
114
+
```bash
115
+
git status
116
+
```
117
+
- To add the changes to the staging area:
118
+
```bash
119
+
git add .
120
+
```
121
+
- To commit the changes:
122
+
```bash
123
+
git commit -m "Your commit message here"
124
+
```
125
+
Replace `"Your commit message here"` with a clear and concise message that describes the changes you made.
83
126
84
127
### How to build the guide locally
85
128
86
-
*__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*
129
+
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.
130
+
131
+
To see the different sessions available, you can run the following commandin your terminal:
132
+
133
+
```bash
134
+
nox --list-sessions
135
+
```
136
+
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.
137
+
138
+
- `docs`: this session builds the guide and opens it in your browser.
139
+
```bash
140
+
nox -e docs
141
+
```
142
+
To see the guide built locally, open the file `_build/html/index.html`in your browser.
143
+
144
+
- `docs-test`: this session runs the tests for the guide.
145
+
```bash
146
+
nox -e docs-test
147
+
```
148
+
If the tests fail, you will see an error message in your terminal. You need to fix the errors before submitting your pull request.
149
+
150
+
- `docs-live`: this session builds the guide and opens it in your browser with live reloading.
151
+
```bash
152
+
nox -e docs-live
153
+
```
154
+
open the local version of the guide in your browser at ``localhost`` shown in the terminal.
87
155
88
156
### Before you submit your pull request
89
157
90
-
*__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.*
158
+
Before submitting your pull request, make sure to run the tests and check the formatting of your code.
159
+
160
+
```bash
161
+
nox -e docs-test
162
+
```
163
+
If the tests fail, you will see an error message in your terminal. You need to fix the errors before submitting your pull request.
164
+
Also make sure to check the formatting of your documentation by building the docs locally and checking that your changes look correct.
165
+
91
166
92
167
## Submitting a pull request with your contribution
0 commit comments