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: tutorials/add-license-coc.md
+31-17Lines changed: 31 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,14 @@ In this lesson you will learn:
16
16
3. How you can use the Contributors Covenant website to add generic language as a starting place for your `CODE_OF_CONDUCT`.
17
17
:::
18
18
19
-
## What is a license and why is it important?
19
+
## What is a license?
20
20
21
21
A license contains legal language about how users can use and reuse your software. To set the LICENSE for your project, you:
22
22
23
23
1. create LICENSE file in your project directory that specifies the license that you choose for your package and
24
24
2. reference that file in your pyproject.toml data where metadata are set.
25
25
26
-
By adding the LICENSE file to your pyproject.toml file, the LICENSE will be included in your package's metadata which is used to populate your package's PyPI landing page. It is also used in your GitHub repository (see image below).
26
+
By adding the LICENSE file to your pyproject.toml file, the LICENSE will be included in your package's metadata which is used to populate your package's PyPI landing page. The LICENSE is also used in your GitHub repository's landing page interface.
27
27
28
28
### What license should you use?
29
29
@@ -51,14 +51,13 @@ are placed in the root of the project directory using standard naming convention
51
51
:::
52
52
53
53
54
-
## How to add a LICENSE file to your package repository
54
+
###How to add a LICENSE file to your package directory
55
55
56
56
There are several ways to add a LICENSE file:
57
57
58
58
1. When you create a new repository on GitHub, it will ask you if you wish to add a `LICENSE` file at that time. If you select yes, it will create the file for you.
59
59
2. You can add a license through the GitHub gui following the [<iclass="fa-brands fa-github"></i> instructions here](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository).
60
60
3. You can add the file manually like we are doing in this lesson.
61
-
4. Or, if you are using a tool such as Hatch, it will add a LICENSE file for you.
62
61
63
62
:::{tip}
64
63
If you completed the past lessons including
@@ -71,11 +70,11 @@ then you already have a **LICENSE** file containing text for the MIT license in
71
70
If you don't yet have a **LICENSE** file in your directory, then continue reading.
72
71
:::
73
72
74
-
### Add a LICENSE to your existing GitHub repository
73
+
### How to add a LICENSE to your package - the manual way
75
74
76
75
If you don't already have a LICENSE file, and you are not yet using a platform such as GitHub or GitLab, then you can create a license file by
77
76
78
-
1. Create a new file called LICENSE. If you are using a shell you can use:
77
+
1. Create a new file called LICENSE. If you are using shell you can type:
79
78
80
79
```
81
80
# Create a license file in your shell
@@ -86,6 +85,7 @@ If you don't already have a LICENSE file, and you are not yet using a platform s
86
85
2. Select permissive license
87
86
3. It will suggest that you use the [MIT license](https://choosealicense.com/licenses/mit/).
88
87
4. Copy the license text that it provides into your LICENSE file that you created above.
88
+
5. Save your file. You're all done!
89
89
90
90
:::{admonition} An overview of LICENSES in the scientific Python ecosystem
91
91
:class: note
@@ -131,29 +131,43 @@ GitHub landing page.
131
131
:::::
132
132
::::::
133
133
134
+
Now you know how to add a LICENSE to your project. Next, you'll learn
135
+
about the `CODE_OF_CONDUCT.md` file and how to add it to your
136
+
package directory.
137
+
134
138
(add-coc)=
135
-
## Add a CODE_OF_CONDUCT file to your repository
139
+
## What is a code of conduct file?
136
140
137
-
Now that you have added a LICENSE to your project, you are ready to add a `CODE_OF_CONDUCT.md` to your package directory. The `CODE_OF_CONDUCT.md` should be placed at the root of your project directory, similar to the LICENSE file,.
141
+
A `CODE_OF_CONDUCT` file is used to establish guidelines for how people in your community interact.
138
142
139
-
A `CODE_OF_CONDUCT` file is critical to supporting your community as it
143
+
This file is critical to supporting your community as it
140
144
grows. The `CODE_OF_CONDUCT`:
141
145
142
146
1. Establishes guidelines for how users and contributors interact with each other and you in your software repository.
143
147
2. Identifies negative behaviors that you don't want in your interactions.
144
148
145
149
You can use your code of conduct as a tool that can be referenced when moderating challenging conversations.
146
150
151
+
### What to put in your code of conduct file
152
+
147
153
If you are unsure of what language to add to your `CODE_OF_CONDUCT`
148
154
file, we suggest that you adopt the [contributor covenant language](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) as a starting place.
The `CODE_OF_CONDUCT.md` should be placed at the root of your project directory, similar to the LICENSE file.
159
+
160
+
### How to add a CODE_OF_CONDUCT file to your package directory
161
+
162
+
- Add a `CODE_OF_CONDUCT.md` file to the root of your repository if it doesn't already exist.
153
163
154
-
- Add a `CODE_OF_CONDUCT.md` file to your repository if it doesn't
155
-
already exist.
156
-
- Visit the [contributor covenant website](https://www.contributor-covenant.org/) and add [the markdown version of their code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/code_of_conduct.md) to your `CODE_OF_CONDUCT.md` file.
164
+
```bash
165
+
> touch CODE_OF_CONDUCT.md
166
+
```
167
+
168
+
- Visit the [contributor covenant website](https://www.contributor-covenant.org/) and add [the markdown version of their code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/code_of_conduct.md) to your `CODE_OF_CONDUCT.md` file. Read the text closely to ensure you both understand it and also agree with its contents!
169
+
170
+
That's it - you've now added a code of conduct to your package directory.
157
171
158
172
:::{admonition} Additional Code of Conduct resources
159
173
:class: note
@@ -173,11 +187,11 @@ In this lesson and the [last lesson](add-readme), you have added a:
173
187
174
188
These are fundamental files needed for every scientific Python package
175
189
repository. These files help users understand how to use your package and
176
-
interact with package maintainers. In the upcoming
177
-
lessons, you will:
190
+
interact with package maintainers.
191
+
192
+
In the upcoming lessons, you will:
178
193
179
-
-[Flesh out your `pyproject.toml` file](pyproject-toml) to support building
180
-
and publishing your package on PyPI.
194
+
-[Add more metadata to your `pyproject.toml` file](pyproject-toml) to support building and publishing your package on PyPI.
181
195
- Publish a new version of your Python package to (Test) PyPI to preview the
Copy file name to clipboardExpand all lines: tutorials/add-readme.md
+35-26Lines changed: 35 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
3
3
In the previous lessons you learned:
4
4
5
-
1. What a Python package is
6
-
2. How to make your code installable
7
-
3. How to publish your package to (test) PyPI
5
+
1.[What a Python package is](intro.md)
6
+
2.[How to make your code installable](1-installable-code)
7
+
3.[How to publish your package to (test) PyPI](publish-pypi.md)
8
+
4.[How to publish your package to conda-forge](publish-conda-forge.md)
8
9
9
10
:::{admonition} Learning objectives
10
11
@@ -26,15 +27,17 @@ a user understand:
26
27
- How to contribute to your package
27
28
- How to cite your package
28
29
29
-
Your **README.md** file is important as it is often the first thing that someone sees before they install your package. The README file also will be used to populate your PyPI landing page.
30
+
Your **README.md** file is important as it is often the first thing that someone sees before they install your package. The README file is also used to populate your PyPI landing page.
30
31
31
-
Note that there is no required format for README files. This page simply outlines sections that we suggest you have in your README file.
32
+
Note that there is no specific content structure for README files.
33
+
However, this tutorial outlines the sections that we suggest that you
34
+
include in your README file.
32
35
33
36
## Create a README.md file for your package
34
37
35
38
It's time to add a `README.md` file to your project directory.
36
39
37
-
### Step 0. Create a README file
40
+
### Step 0: Create a README file
38
41
To get started, if you don't already have a README.md file in your project directory, create one.
39
42
40
43
:::{tip}
@@ -49,27 +52,27 @@ Then you may already have a README.MD file in your project directory.
49
52
<!-- If they use hatch init in the very first lesson -
50
53
the readme will already be there-->
51
54
52
-
### Step 1. Add the name of your package as the README title
55
+
### Step 1: Add the name of your package as the README title
53
56
54
57
At the top of the `README.md` file, add the name of your package.
55
58
56
-
If you are using markdown it should be a header 1 tag which is denoted with a single `#` sign.
59
+
If you are using markdown it should be a header 1 (H1) tag which is denoted with a single `#` sign.
57
60
58
61
`# Package-title-here`
59
62
60
-
### Step 2 - add badges to the top of your README file
63
+
### Step 2: add badges to the top of your README file
61
64
62
-
It's common for maintainers to add badges to the top of their README files. Badges allow you and your package users to track things like
65
+
It's common for maintainers to add badges to the top of their README files. Badges allow you and your package users to track things like:
63
66
64
67
* Broken documentation and test builds.
65
68
* Versions of your package that are on PyPI and conda.
66
69
* Whether your package has been reviewed and vetted by an organization such as pyOpenSci and/or JOSS.
67
70
68
71
If you have already published your package to pypi.org you can use [shields.io to create a package version badge](https://shields.io/badges/py-pi-version). This badge will dynamically update as you release new versions of your package to PyPI.
69
72
70
-
If not, you can leave the top empty for now and add badges to your README at a later point as they make sense for your package.
73
+
If not, you can leave the top empty for now and add badges to your README at a later point as they make sense.
71
74
72
-
### Step 3 - Add a description of what your package does
75
+
### Step 3: Add a description of what your package does
73
76
74
77
Below the badges (if you have them), add a section of text
75
78
that provides an easy-to-understand overview of what your
@@ -81,7 +84,7 @@ package does.
81
84
82
85
Remember that the more people understand what your package does, the more people will use it.
Next, add instructions that tell users how to install your package.
87
90
@@ -96,7 +99,7 @@ If you haven't yet published your package to pypi.org then
96
99
you can skip this section and come back and add these
97
100
instructions later.
98
101
99
-
### Step 5 - Any additional setup
102
+
### Step 5: Any additional setup
100
103
101
104
In some cases, your package users may need to manually
102
105
install other tools in order to use your package. If that
@@ -111,14 +114,14 @@ This might include:
111
114
* additional tool installations, such as GDAL.
112
115
113
116
:::{note}
114
-
Many packages won't need this section in their README. In that case you can always skip this section!
117
+
Many packages won't need an additional setup section in their README.
118
+
In that case you can always skip this section.
115
119
:::
116
120
117
121
118
-
### Step 6 - Add a get started section
122
+
### Step 6: Add a get started section
119
123
120
-
Next add a getting started section that shows how to use your package. This
121
-
section should include a small code snippet that demonstrates importing and using
124
+
Next add a get-started section. Within this section, add a small code example that demonstrates importing and using
122
125
some of the functionality in your package.
123
126
124
127
:::{admonition} Provide a fully functional code snippet if possible
@@ -128,7 +131,7 @@ It is important to try to make the code examples that you provide your users as
128
131
129
132
Be sure to provide a copy/paste code example that will work as-is when pasted into a Jupyter Notebook or .py file if that is possible.
130
133
131
-
If there are tokens and other steps needed to run your package, be sure to be clear about what those steps entail.
134
+
If there are tokens and other steps needed to run your package, be sure to be clear about what those steps are.
132
135
:::
133
136
134
137
For the pyosPackage, a short get started demo might look like this:
@@ -143,22 +146,28 @@ Or it could simply be a link to a getting started tutorial that you have created
143
146
you don't have this yet, you can leave it empty for the time being.
144
147
145
148
This would
146
-
also be a great place to add links to any tutorials that you have created that
149
+
also be a great place to add links to tutorials that
147
150
help users understand how to use your package for common workflows.
148
151
149
152
150
-
### Step 7 - Community section
153
+
### Step 7: Community section
151
154
152
155
The community section of your README file is a place to include information for users who may want to engage with your project. This engagement will likely happen on a platform like GitHub or GitLab.
153
156
154
157
In the community section, you will add links to your contributing guide
155
-
and `CODE_OF_CONDUCT.md`. You will add a [`CODE_OF_CONDUCT.md` file in the next lesson](add-license-coc).
158
+
and `CODE_OF_CONDUCT.md`. You will create a [`CODE_OF_CONDUCT.md` file in the next lesson](add-license-coc).
156
159
157
-
As your package grows you may also have a link to a development guide that contributors and your maintainer team will follow.
160
+
As your package grows you may also have a link to a development guide that contributors and your maintainer team will follow. The development guide
161
+
outlines how to perform maintenance tasks such as:
158
162
163
+
* running tests
164
+
* making package releases
165
+
* building documentation
166
+
* and more.
159
167
160
168
161
-
### Step 8 - Citation information
169
+
170
+
### Step 8: Citation information
162
171
163
172
Finally it is important to let users know how to cite your package.
164
173
You can communicate citation information in a few different ways.
@@ -168,8 +177,8 @@ information for your package if it is hosted on a platform such as
168
177
GitHub. [Check out this short tutorial that covers setting that up.](https://coderefinery.github.io/github-without-command-line/doi/)
169
178
170
179
Alternatively if you send your package through a peer review process such
171
-
as the [one lead by pyOpenSci](https://www.pyopensci.org/about-peer-review/index.html), then you can get a cross-ref DOI through our partnership
172
-
with the Journal of Open Source Software.
180
+
as the [one lead by pyOpenSci](https://www.pyopensci.org/about-peer-review/index.html). After being accepted by pyOpenSci, if your package is in scope, you can be accepted by the Journal of Open Source Software and get a cross-ref DOI through [our partnership with the Journal of Open Source Software.](https://www.pyopensci.org/about-peer-review/index.html)
0 commit comments