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: documentation/repository-files/license-files.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ To select your license, we suggest that you use GitHub's
47
47
[Choose a License tool ](https://choosealicense.com/).
48
48
49
49
If you choose your license when creating a new GitHub repository, you can also
50
-
automatically get a text copy of the license file to add to your repo. However
50
+
automatically get a text copy of the license file to add to your repository. However
51
51
in some cases the license that you want is not available through that online
52
52
process.
53
53
@@ -78,9 +78,9 @@ with the license that you selected for your package.
78
78
:::{admonition} An example of how a license determine how code can be reused
79
79
:class: note
80
80
81
-
Let's use stackOverflow as an example that highlights how a license determines how code can or can not be used.
81
+
Let's use StackOverflow as an example that highlights how a license determines how code can or can not be used.
82
82
83
-
[Stack overflow uses a Creative Commons Share Alike license.](https://stackoverflow.com/help/licensing). The sharealike license requires you to use the same sharealike license when you reuse any code from stackoverflow.
83
+
[Stack overflow uses a Creative Commons Share Alike license.](https://stackoverflow.com/help/licensing). The sharealike license requires you to use the same sharealike license when you reuse any code from StackOverflow.
84
84
85
85
This means that technically, if you copy code from the Stack Overflow website, and use it in your package. And your packages uses a different license such as a MIT license, you are violating Stack Overflow's license requirements!
86
86
@@ -92,7 +92,7 @@ This means that technically, if you copy code from the Stack Overflow website, a
92
92
93
93
While many permissive licenses do not require citation we STRONG encourage that you cite all software that you use in papers, blogs and other publications. You tell your users how to cite your package by using a [citation.cff file](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files). We will cover this topic when we talk about creating DOI's for your package using zenodo.
94
94
95
-
<!-- TODO: add link when lesson is created - but also we don't yet know how citation.cff files work with zenodo (do they work??) will the citation info update with a new zenodo link
95
+
<!-- TODO: add link when lesson is created - but also we don't yet know how citation.cff files work with Zenodo (do they work??) will the citation info update with a new Zenodo link
96
96
97
97
These files - we need to understand if that date releases auto populates or forces zenodo to modify it's citation. if it's not dynamic it could be problematic
Copy file name to clipboardExpand all lines: tutorials/add-license-coc.md
+48-22Lines changed: 48 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -16,18 +16,25 @@ 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
-
## Add a LICENSE file to your project directory
19
+
## What is a license?
20
20
21
-
A license contains legal language about how users can use and reuse your software. You should include a LICENSE file in your project directory that specifies the license that you choose for your package.
21
+
A license contains legal language about how users can use and reuse your software. To set the LICENSE for your project, you:
22
+
23
+
1. create LICENSE file in your project directory that specifies the license that you choose for your package and
24
+
2. reference that file in your pyproject.toml data where metadata are set.
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. The LICENSE is also used in your GitHub repository's landing page interface.
27
+
28
+
### What license should you use?
22
29
23
30
We suggest that you use a permissive license that accommodates the other most commonly used licenses in the scientific Python ecosystem (MIT[^mit] and BSD-3[^bsd3]). If you are unsure, use MIT given it's the generally recommended
24
31
license on [choosealicense.com](https://choosealicense.com/).
25
32
26
33
:::{admonition} Licenses for the scientific Python ecosystem
27
-
[We discuss licenses for the scientific Python ecosystem in more detail here in our guidebook.](permissive-license)
34
+
[We discuss licenses for the scientific Python ecosystem in more detail here in our guidebook.](../documentation/repository-files/license-files)
28
35
:::
29
36
30
-
### Where should the LICENSE file live & how do you add it?
37
+
### Where should the LICENSE file live
31
38
32
39
Your `LICENSE` file should be placed at the root of your package's repository.
33
40
When you add the LICENSE at the root, GitHub will automagically discover it and
@@ -43,7 +50,10 @@ the license that SunPy uses. These files are discovered by GitHub because they
43
50
are placed in the root of the project directory using standard naming conventions.
44
51
:::
45
52
46
-
There are several ways to add a license file:
53
+
54
+
### How to add a LICENSE file to your package directory
55
+
56
+
There are several ways to add a LICENSE file:
47
57
48
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.
49
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,11 +70,11 @@ then you already have a **LICENSE** file containing text for the MIT license in
60
70
If you don't yet have a **LICENSE** file in your directory, then continue reading.
61
71
:::
62
72
63
-
### How to add a LICENSE to your existing GitHub repository
73
+
### How to add a LICENSE to your package - the manual way
64
74
65
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
66
76
67
-
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:
68
78
69
79
```
70
80
# Create a license file in your shell
@@ -75,6 +85,7 @@ If you don't already have a LICENSE file, and you are not yet using a platform s
75
85
2. Select permissive license
76
86
3. It will suggest that you use the [MIT license](https://choosealicense.com/licenses/mit/).
77
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!
78
89
79
90
:::{admonition} An overview of LICENSES in the scientific Python ecosystem
80
91
:class: note
@@ -96,52 +107,67 @@ through the GitHub interface.
96
107
97
108
:::{figure-md} github-new-repo
98
109
99
-
<imgsrc="../images/tutorials/github-new-repo.png"alt="Screenshot of the create new repository interface that GitHub provides. The elements of this are the owner and repository name for the new repo. Below that you can add a description of the repo. Below that you can set it to be public or private. At the bottom of the interface there is an Add a README checkbox where it will add a blank readme file for you. At the very bottom there is a line to add a .gitignore file and another to choose a license."width="500px">
110
+
<imgsrc="../images/tutorials/github-new-repo.png"alt="Screenshot of the create new repository interface that GitHub provides. The elements of this are the owner and repository name for the new repo. Below that you can add a description of the repository. Below that you can set it to be public or private. At the bottom of the interface there is an Add a README checkbox where it will add a blank readme file for you. At the very bottom there is a line to add a .gitignore file and another to choose a license."width="500px">
100
111
101
112
Image showing the GitHub interface that allows you to add a LICENSE and README file when you create a new repository.
If you already have a GitHub repository for your package, then you can add a LICENSE using the GitHub interface by adding a new file to the repo.
118
+
If you already have a GitHub repository for your package, then you can add a LICENSE using the GitHub interface by adding a new file to the repository.
108
119
109
120
- Follow the instructions to select and add a license to your repository on the [GitHub LICENSE page](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository) .
110
121
- Once you have added your LICENSE file, be sure to sync your git local repository with the repository on GitHub.com. This means running `git pull` to update your local branch.
<imgsrc="../images/tutorials/view-license-github.png"alt="Image showing what the LICENSE file looks like in the GItHub interface. At the top you can see the actual license which in this image is BSD 3-clause New or revised license. Then there is some text describing both what the license is and the associated permissions for that specific license. At the bottom of the image, the actual text for the license is shown in the LICENSE file."width="500px">
114
125
115
-
You can also view a summary of the license on its GitHub landing page.```
126
+
You can view a summary of the LICENSE chosen on your project's
127
+
GitHub landing page.
116
128
:::
117
129
::::
118
130
119
131
:::::
120
132
::::::
121
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
+
122
138
(add-coc)=
123
-
## Add a CODE_OF_CONDUCT file to your repo
139
+
## What is a code of conduct file?
124
140
125
-
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.
126
142
127
-
A `CODE_OF_CONDUCT` file is critical to supporting your community as it
143
+
This file is critical to supporting your community as it
128
144
grows. The `CODE_OF_CONDUCT`:
129
145
130
146
1. Establishes guidelines for how users and contributors interact with each other and you in your software repository.
131
147
2. Identifies negative behaviors that you don't want in your interactions.
132
148
133
149
You can use your code of conduct as a tool that can be referenced when moderating challenging conversations.
134
150
151
+
### What to put in your code of conduct file
152
+
135
153
If you are unsure of what language to add to your `CODE_OF_CONDUCT`
136
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.
141
159
142
-
- Add a `CODE_OF_CONDUCT.md` file to your repository if it doesn't
143
-
already exist.
144
-
- 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.
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.
163
+
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.
145
171
146
172
:::{admonition} Additional Code of Conduct resources
147
173
:class: note
@@ -161,11 +187,11 @@ In this lesson and the [last lesson](add-readme), you have added a:
161
187
162
188
These are fundamental files needed for every scientific Python package
163
189
repository. These files help users understand how to use your package and
164
-
interact with package maintainers. In the upcoming
165
-
lessons, you will:
190
+
interact with package maintainers.
191
+
192
+
In the upcoming lessons, you will:
166
193
167
-
-[Flesh out your `pyproject.toml` file](pyproject-toml) to support building
168
-
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.
169
195
- Publish a new version of your Python package to (Test) PyPI to preview the
0 commit comments