Skip to content

Commit a1cb8f9

Browse files
authored
Merge branch 'main' into feature/add-reference-guide
2 parents 4a95235 + 325c4d8 commit a1cb8f9

17 files changed

+267
-35
lines changed

.all-contributorsrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,26 @@
739739
"code",
740740
"review"
741741
]
742+
},
743+
{
744+
"login": "Revathyvenugopal162",
745+
"name": "Revathy Venugopal",
746+
"avatar_url": "https://avatars.githubusercontent.com/u/104772255?v=4",
747+
"profile": "https://github.com/Revathyvenugopal162",
748+
"contributions": [
749+
"code",
750+
"review"
751+
]
752+
},
753+
{
754+
"login": "tkoyama010",
755+
"name": "Tetsuo Koyama",
756+
"avatar_url": "https://avatars.githubusercontent.com/u/7513610?v=4",
757+
"profile": "https://github.com/tkoyama010",
758+
"contributions": [
759+
"code",
760+
"review"
761+
]
742762
}
743763
],
744764
"contributorsPerLine": 7,

.gitignore

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1-
_build
2-
.vscode
3-
*/.ipynb_checkpoints/*
1+
# Vscode
2+
.vscode/
3+
4+
# Python
45
tmp/
56
.DS_Store
6-
.nox
7-
__pycache__
87
*notes-from-review.md
98
*.idea*
109
# Grammar / syntax checkers
1110
styles/
1211
# Exclude translation .mo files
1312
locales/*/LC_MESSAGES/*.mo
13+
14+
# Exclude Jupyter Notebook checkpoints
15+
.ipynb_checkpoints/
16+
*/.ipynb_checkpoints/*
17+
18+
# Exclude Python bytecode
19+
__pycache__/
20+
21+
# Exclude build directories
22+
_build/
23+
24+
# Exclude virtual environments
25+
venv/
26+
env/
27+
ENV/
28+
.venv/
29+
.ENV/
30+
*/venv/
31+
.nox
32+
*/.nox/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ repos:
3737
)$
3838
3939
- repo: https://github.com/errata-ai/vale
40-
rev: v3.6.0
40+
rev: v3.7.0
4141
hooks:
4242
- id: vale
4343

CONTRIBUTING.md

Lines changed: 204 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,62 +33,253 @@ The second approach is making your contribution directly in the GitHub website.
3333
## Forking the repository
3434

3535
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.
47+
48+
<img width="395" alt="fork_repo" src="https://github.com/user-attachments/assets/949223fb-b58b-4b6d-85db-003bd117da46">
3649

37-
*__TODO__: This section should show a beginner user how to fork a repository in GitHub.*
3850

3951
## Contributing via the GitHub website
4052

4153
### How to edit a MarkDown file
4254

43-
*__TODO__: This section should show how to use the GitHub interface to edit and previewing a Markdown file.*
55+
The Python Packaging Guide is written in myST, a variant of MarkDown. You can edit the files directly in the GitHub website.
56+
To do so, navigate to the file you want to edit and click the pencil icon in the top right corner of the file.
57+
58+
```{figure} images/contributing/edit-button-pencil.png
59+
---
60+
name: edit-button-pencil in GitHub
61+
width: 80%
62+
alt: Edit button in GitHub
63+
---
64+
An image showing how to edit a file in GitHub. The pencil icon is highlighted with a red rectangle.
65+
66+
```{figure} images/contributing/edit-file.png
67+
---
68+
name: edit-file in GitHub
69+
width: 80%
70+
alt: Edit file in GitHub
71+
---
72+
An image showing when a file is being edited in GitHub. The file content is displayed in a text editor.
73+
```
74+
75+
To preview your changes, click the "Preview changes" tab.
76+
77+
```{figure} images/contributing/preview-changes.png
78+
---
79+
name: preview-changes in GitHub
80+
width: 80%
81+
alt: Preview changes in GitHub
82+
---
83+
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+
```
4485

4586
### How to commit your changes
4687

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.
90+
91+
```{figure} images/contributing/commit-changes.png
92+
---
93+
name: commit-changes in GitHub
94+
width: 80%
95+
alt: Commit changes in GitHub
96+
---
97+
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.
48101

49102
## Contributing locally on your computer
50103

51104
### Clone your forked repository
52105

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.
112+
113+
```{figure} images/contributing/clone-repository.png
114+
---
115+
name: clone-repository in GitHub
116+
width: 80%
117+
alt: Clone repository in GitHub
118+
---
119+
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+
```
54121

55122
### Create a new branch
56123

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+
```
58131

59132
### Create a virtual environment
60133

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+
```
62147

63148
### Install the development dependencies
64149

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 command in your terminal:
151+
152+
```bash
153+
python -m pip install -e .[dev]
154+
```
66155

67156
### Commit your changes
68157

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.
70173

71174
### How to build the guide locally
72175

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 command in 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.
74202

75203
### Before you submit your pull request
76204

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+
78213

79214
## Submitting a pull request with your contribution
80215

81216
### How to make a pull request
82217

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.
219+
220+
```{figure} images/contributing/pull-requests-tab.png
221+
---
222+
name: pull-requests-tab in GitHub
223+
width: 80%
224+
alt: Pull requests tab in GitHub
225+
---
226+
An image showing how to navigate to the pull requests tab in GitHub. The pull requests tab is highlighted with a red rectangle.
227+
```
228+
229+
2. Click on the "New pull request" button.
230+
231+
```{figure} images/contributing/new-pull-request.png
232+
---
233+
name: new-pull-request in GitHub
234+
width: 80%
235+
alt: New pull request button in GitHub
236+
---
237+
An image showing how to create a new pull request in GitHub. The new pull request button is highlighted with a red rectangle.
238+
```
239+
240+
3. Write a clear and concise title and description for your pull request. Make sure to describe the changes you made and why they are necessary.
84241

85242
### What happens when you submit a pull request (CI/CD)
86243

87-
*__TODO__: This section should describe how to see the results of the CD/CI checks and how to get more information about errors*
244+
Once you submit a pull request, a series of checks will be run to ensure that your changes do not introduce any bugs or errors. These checks include:
245+
246+
- **Code formatting and styles**: checks that your code is formatted correctly, by `pre-commit.ci - pr check`.
247+
- **docs build**: checks that the documentation builds correctly, using `circleci`.
248+
249+
You will see the status of these checks in your pull request.
250+
251+
```{figure} images/contributing/pull-requests-checks.png
252+
---
253+
name: pull-requests-checks in GitHub
254+
width: 80%
255+
alt: Pull request checks in GitHub
256+
---
257+
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.
260+
261+
```{figure} images/contributing/pull-requests-checks-fails.png
262+
---
263+
name: pull-requests-checks-fails in GitHub
264+
width: 80%
265+
alt: Pull request checks failed in GitHub
266+
---
267+
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.
88271

89272
### What to expect from the review process
90273

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.
92283

93284
## Additional help
94285

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <img src="https://www.pyopensci.org/images/logo.png" width=100 /> pyOpenSci scientific Python Packaging Guide
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3-
[![All Contributors](https://img.shields.io/badge/all_contributors-72-orange.svg?style=flat-square)](#contributors-)
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-74-orange.svg?style=flat-square)](#contributors-)
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55

66
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pyopensci/python-package-guide?color=purple&display_name=tag&style=plastic)
@@ -167,6 +167,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
167167
<tr>
168168
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/ncclementi/"><img src="https://avatars.githubusercontent.com/u/7526622?v=4?s=100" width="100px;" alt="Naty Clementi"/><br /><sub><b>Naty Clementi</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=ncclementi" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Ancclementi" title="Reviewed Pull Requests">👀</a></td>
169169
<td align="center" valign="top" width="14.28%"><a href="https://github.com/John-Drake"><img src="https://avatars.githubusercontent.com/u/22374979?v=4?s=100" width="100px;" alt="John Drake"/><br /><sub><b>John Drake</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=John-Drake" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3AJohn-Drake" title="Reviewed Pull Requests">👀</a></td>
170+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Revathyvenugopal162"><img src="https://avatars.githubusercontent.com/u/104772255?v=4?s=100" width="100px;" alt="Revathy Venugopal"/><br /><sub><b>Revathy Venugopal</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=Revathyvenugopal162" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3ARevathyvenugopal162" title="Reviewed Pull Requests">👀</a></td>
171+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tkoyama010"><img src="https://avatars.githubusercontent.com/u/7513610?v=4?s=100" width="100px;" alt="Tetsuo Koyama"/><br /><sub><b>Tetsuo Koyama</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=tkoyama010" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Atkoyama010" title="Reviewed Pull Requests">👀</a></td>
170172
</tr>
171173
</tbody>
172174
</table>

TRANSLATING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ LANGUAGES = ["es", "fr"]
6565
```
6666

6767
```{note}
68-
You can find a list of the two-letter ISO language codes [here](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
68+
You can find a list of the two-letter Sphinx language option [here](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language).
6969
```
7070

7171
## Preparing the Translation Files
15 KB
Loading
26.6 KB
Loading
4.65 KB
Loading

images/contributing/edit-file.png

61 KB
Loading

0 commit comments

Comments
 (0)