Skip to content

Commit d6589ff

Browse files
committed
Fix: more edits from review
1 parent ae4a4aa commit d6589ff

File tree

6 files changed

+74
-37
lines changed

6 files changed

+74
-37
lines changed

documentation/repository-files/license-files.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To select your license, we suggest that you use GitHub's
4747
[Choose a License tool ](https://choosealicense.com/).
4848

4949
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
5151
in some cases the license that you want is not available through that online
5252
process.
5353

@@ -78,9 +78,9 @@ with the license that you selected for your package.
7878
:::{admonition} An example of how a license determine how code can be reused
7979
:class: note
8080

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

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

8585
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!
8686

@@ -92,7 +92,7 @@ This means that technically, if you copy code from the Stack Overflow website, a
9292

9393
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.
9494

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
9696
9797
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
9898
538 KB
Loading

tutorials/add-license-coc.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,25 @@ In this lesson you will learn:
1616
3. How you can use the Contributors Covenant website to add generic language as a starting place for your `CODE_OF_CONDUCT`.
1717
:::
1818

19-
## Add a LICENSE file to your project directory
19+
## What is a license and why is it important?
2020

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. It is also used in your GitHub repository (see image below).
27+
28+
### What license should you use?
2229

2330
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
2431
license on [choosealicense.com](https://choosealicense.com/).
2532

2633
:::{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)
2835
:::
2936

30-
### Where should the LICENSE file live & how do you add it?
37+
### Where should the LICENSE file live
3138

3239
Your `LICENSE` file should be placed at the root of your package's repository.
3340
When you add the LICENSE at the root, GitHub will automagically discover it and
@@ -43,11 +50,15 @@ the license that SunPy uses. These files are discovered by GitHub because they
4350
are placed in the root of the project directory using standard naming conventions.
4451
:::
4552

46-
There are several ways to add a license file:
53+
54+
## How to add a LICENSE file to your package repository
55+
56+
There are several ways to add a LICENSE file:
4757

4858
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.
4959
2. You can add a license through the GitHub gui following the [<i class="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).
5060
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.
5162

5263
:::{tip}
5364
If you completed the past lessons including
@@ -60,7 +71,7 @@ then you already have a **LICENSE** file containing text for the MIT license in
6071
If you don't yet have a **LICENSE** file in your directory, then continue reading.
6172
:::
6273

63-
### How to add a LICENSE to your existing GitHub repository
74+
### Add a LICENSE to your existing GitHub repository
6475

6576
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
6677

@@ -96,31 +107,32 @@ through the GitHub interface.
96107

97108
:::{figure-md} github-new-repo
98109

99-
<img src="../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+
<img src="../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">
100111

101112
Image showing the GitHub interface that allows you to add a LICENSE and README file when you create a new repository.
102113
:::
103114
::::
104115

105116
::::{tab-item} Add License: Existing GitHub repository
106117

107-
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.
108119

109120
- 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) .
110121
- 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.
111122

112123
:::{figure-md} view-license
113-
<img src="../images/tutorials/view-license-github.png" alt="sdfsdfsd nasdfjsdf" width="500px">
124+
<img src="../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">
114125

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.
116128
:::
117129
::::
118130

119131
:::::
120132
::::::
121133

122134
(add-coc)=
123-
## Add a CODE_OF_CONDUCT file to your repo
135+
## Add a CODE_OF_CONDUCT file to your repository
124136

125137
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,.
126138

tutorials/add-readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ If you are using markdown it should be a header 1 tag which is denoted with a si
6262
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
6363

6464
* Broken documentation and test builds.
65-
* Versions of your package that are on PyPI and Conda.
65+
* Versions of your package that are on PyPI and conda.
6666
* Whether your package has been reviewed and vetted by an organization such as pyOpenSci and/or JOSS.
6767

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

tutorials/intro.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Get to know Hatch <get-to-know-hatch>
3333

3434
:::{toctree}
3535
:hidden:
36-
:caption: Create a Python Package
36+
:caption: Create and publish a Python Package
3737

3838
What is a Python package? <self>
3939
Make your code installable <1-installable-code>
@@ -43,11 +43,11 @@ Publish to conda-forge <publish-conda-forge>
4343

4444
:::{toctree}
4545
:hidden:
46-
:caption: Citation, License & Project metadata
46+
:caption: Project information files & metadata
4747

4848
Add README file <add-readme>
49-
Add a license & COC <add-license-coc>
50-
Update metadata <pyproject-toml>
49+
Add a license & code of conduct <add-license-coc>
50+
Update metadata in pyproject.toml <pyproject-toml>
5151
:::
5252

5353
:::{admonition} Learning Objectives
@@ -98,7 +98,6 @@ to manage and reuse your code across different projects.
9898
Structuring your code as a package is the first step you need to take so you can share the tools in the toolbox you've created and let others build with it.
9999

100100
(package-benefits)=
101-
102101
## Why create a Python package?
103102

104103
You might create a Python package because you want to:
@@ -293,7 +292,7 @@ allows you to access it from any code run with that specific Python environment
293292

294293
:::{figure-md} packages-environment
295294

296-
<img src="../images/tutorials/environment-package-install.png" alt="Diagram showing the steps associated with creating a package and then installing it. The first arrow says your package and the second says pip install package. The second arrow leads to a box that represents a Python environment that already has some packages installed such as pandas and NumPy. Your package will also get installed into that same environment when you pip install it." width="700px">
295+
<img src="../images/tutorials/environment-package-install.png" alt="Diagram showing the steps associated with creating a package and then installing it. The first arrow says your package and the second says pip install package. The second arrow leads to a box that represents a Python environment that already has some packages installed such as Pandas and NumPy. Your package will also get installed into that same environment when you pip install it." width="700px">
297296

298297
You don't have to publish to PyPI to make your code installable.
299298
With the correct file structure and project metadata you can make your code
@@ -320,7 +319,7 @@ Then you can create a conda-forge recipe using the [Grayskull](https://github.co
320319
<img src="../images/tutorials/publish-package-pypi-conda.png" alt="Graphic showing the high level packaging workflow. On the left you see a graphic with code, metadata and tests in it. Those items all go into your package. Documentation and data are below that box because they aren't normally published in your packaging wheel distribution. an arrow to the right takes you to a build distribution files box. that box leads you to either publishing to testPyPI or the real PyPI. From PyPI you can then connect to conda-forge for an automated build that sends distributions from PyPI to conda-forge." width="700px">
321320

322321
In the image above, you can see the steps associated with publishing
323-
your package on PyPI and conda-forge. Note that the distribution files that PyPI requires are the [sdist](#python-source-distribution) and [wheel](#python-wheel) files. Once you are ready to make your code publicly installable, you can publish it on PyPI. Once your code is on PyPI it is straight forward to then publish to conda-forge. You create a recipe using the Grayskull package and then you open a pr in the conda-forge recipe repo. You will learn more about this process in the [conda-forge lesson](#).
322+
your package on PyPI and conda-forge. Note that the distribution files that PyPI requires are the [sdist](#python-source-distribution) and [wheel](#python-wheel) files. Once you are ready to make your code publicly installable, you can publish it on PyPI. Once your code is on PyPI it is straight forward to then publish to conda-forge. You create a recipe using the Grayskull package and then you open a pr in the conda-forge recipe repository. You will learn more about this process in the [conda-forge lesson](#).
324323
:::
325324

326325
## Yay, your package has users! Now what?

0 commit comments

Comments
 (0)