Skip to content

Commit 7bae508

Browse files
committed
Fix: nav for tutorials duplicated
1 parent 7f08998 commit 7bae508

File tree

1 file changed

+24
-36
lines changed

1 file changed

+24
-36
lines changed

tutorials/intro.md

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
# Python packaging 101
2-
*A start to finish beginner-friendly tutorial*
32

4-
:::{toctree}
5-
:hidden:
6-
:caption: Python Packaging 101
7-
8-
What is a Python package? <self>
9-
Make your code installable <1-installable-code>
10-
Publish to PyPI <publish-pypi>
11-
Publish to conda-forge <publish-conda-forge>
12-
:::
3+
_A start to finish beginner-friendly tutorial_
134

145
Welcome to the pyOpenSci Python packaging tutorial series. The lessons
156
on the upcoming pages walk you through the core steps needed to
@@ -29,10 +20,9 @@ that you have not created a Python package before. However, the
2920
content will still be valuable if you are interested in better
3021
understanding the steps involved in creating a Python package.
3122

32-
* In this series you will learn about the core elements that you need to publish your package to the [Python Package Index (PyPI)](https://pypi.org/).
33-
34-
* In the second series, you will learn about infrastructure and documentation needed to support package maintenance.
23+
- In this series you will learn about the core elements that you need to publish your package to the [Python Package Index (PyPI)](https://pypi.org/).
3524

25+
- In the second series, you will learn about infrastructure and documentation needed to support package maintenance.
3626

3727
:::{toctree}
3828
:hidden:
@@ -51,7 +41,6 @@ Publish to PyPI <publish-pypi>
5141
Publish to conda-forge <publish-conda-forge>
5242
:::
5343

54-
5544
:::{toctree}
5645
:hidden:
5746
:caption: Project Metadata
@@ -107,6 +96,7 @@ to manage and reuse your code across different projects.
10796
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.
10897

10998
(package-benefits)=
99+
110100
## Why create a Python package?
111101

112102
You might create a Python package because you want to:
@@ -173,7 +163,7 @@ or GitLab. GitHub and GitLab both
173163
run [git](https://git-scm.com/) for version control. Having your software
174164
under version control is important because it allows you to both track changes over time while also going back in history and undoing changes in the case that a change to the code base unexpectedly breaks something.
175165

176-
By publishing your package on GitHub or GitLab, you are making your code public facing. This means that others can both see your code and also make contributions using a pull request (GitHub) / merge request (GitLab) / code review workflow.
166+
By publishing your package on GitHub or GitLab, you are making your code public facing. This means that others can both see your code and also make contributions using a pull request (GitHub) / merge request (GitLab) / code review workflow.
177167

178168
:::{admonition} GitHub & GitLab vs. Git
179169
:class: tip
@@ -187,20 +177,21 @@ upload (`git push`) and download (`git pull`) files to GitHub and GitLab.
187177

188178
GitHub and GitLab also both offer community features such as issues that allow:
189179

190-
* you to communicate with your maintainers and contributor community
191-
* users to report bugs, ask questions and request new features
192-
* you to publicly keep track of enhancements and features you want to work on for your package.
193-
180+
- you to communicate with your maintainers and contributor community
181+
- users to report bugs, ask questions and request new features
182+
- you to publicly keep track of enhancements and features you want to work on for your package.
194183

195184
### Continuous integration and continuous deployment
196185

197186
GitHub and GitLab also provide continuous integration and continuous deployment (CI/CD). Continuous integration (CI) refers to a platform that automatically runs a specific job when a certain event occurs, whereas continuous deployment (CD) is an extension of CI that refers to not only running or building but also to publishing the final outputs somewhere.
198187

199188
**An example of Continuous integration:**
200-
* When someone submits a change to your code, your tests will run across different operating systems and the code will be checked for format issues.
189+
190+
- When someone submits a change to your code, your tests will run across different operating systems and the code will be checked for format issues.
201191

202192
**An example of Continuous deployment:**
203-
* When you are ready to release your package to PyPI, a continuous deployment operation might be triggered on release to publish your package to PyPI.
193+
194+
- When you are ready to release your package to PyPI, a continuous deployment operation might be triggered on release to publish your package to PyPI.
204195

205196
Integrated CI/CD will help you maintain your software, ensuring that
206197
changes to the code don't break things unexpectedly. They can also
@@ -229,17 +220,16 @@ LINK to pip installable lesson when it's published - it's in review now
229220
:::
230221

231222
2. **Creating a package for the community:** In other cases, you may create some code that you soon realize might also be useful to not just you, but to other people as well.
232-
In that case, you might consider both creating the package, publishing it on GitHub, and because other users may be using it, you may make use of GitHub's infrastructure including CI/CD pipelines and issue trackers. Because you want other people to use your package, you will want to also include LICENSE information, documentation for users and contributors and tests. This type of package is most often published to PyPI.
223+
In that case, you might consider both creating the package, publishing it on GitHub, and because other users may be using it, you may make use of GitHub's infrastructure including CI/CD pipelines and issue trackers. Because you want other people to use your package, you will want to also include LICENSE information, documentation for users and contributors and tests. This type of package is most often published to PyPI.
233224

234225
For example, all of the [pyOpenSci packages](https://www.pyopensci.org/python-packages.html) are public facing with an intended audience beyond just the maintainers.
235226

236-
### Packages that you expect others to use should be well-scoped
227+
### Packages that you expect others to use should be well-scoped
237228

238229
Ideally the code in your Python package is focused on a specific theme or use case. This theme is important as it's a way to scope the content of your package.
239230

240231
It can be tricky to decide when your code becomes something that might be more broadly useful to others. But one question you can ask yourself is - is your code written specifically for a single research project? Or could it have a broader application across multiple projects in your domain?
241232

242-
243233
:::{admonition} How does this relate to code for a research project?
244234
:class: note
245235

@@ -253,22 +243,21 @@ specific set of tasks. These tasks should be applicable to numerous workflows.
253243
As such a Python package is more generalizable than a Research Compendium
254244
which supports a specific project.
255245

256-
* [Read about `Good enough practices in scientific computing`](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005510)
257-
* [Learn more about research compendia (also called repo-packs) in this blog post.](https://lorenabarba.com/blog/how-repro-packs-can-save-your-future-self/)
258-
:::
259-
246+
- [Read about `Good enough practices in scientific computing`](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005510)
247+
- [Learn more about research compendia (also called repo-packs) in this blog post.](https://lorenabarba.com/blog/how-repro-packs-can-save-your-future-self/)
248+
:::
260249

261250
Below are a few examples well scoped pyOpenSci packages:
262251

263-
* [Crowsetta](https://crowsetta.readthedocs.io/en/latest/): is a package designed to work with annotating animal vocalizations and bioacoustics data. This package helps scientists process different types of bioacoustic data rather than focusing on a specific individual research application associated with a user-specific research workflow.
264-
* [Pandera](https://www.union.ai/pandera) is another more broadly used Python package. Pandera supports data testing and thus also has a broader research application.
252+
- [Crowsetta](https://crowsetta.readthedocs.io/en/latest/): is a package designed to work with annotating animal vocalizations and bioacoustics data. This package helps scientists process different types of bioacoustic data rather than focusing on a specific individual research application associated with a user-specific research workflow.
253+
- [Pandera](https://www.union.ai/pandera) is another more broadly used Python package. Pandera supports data testing and thus also has a broader research application.
265254

266255
:::{admonition} Matplotlib as an example
267256

268257
At the larger end of the user spectrum, Matplotlib is a great example.
269258
Matplotlib does one thing really well:
270259

271-
*It creates visual plots of data.*
260+
_It creates visual plots of data._
272261

273262
Thousands of people use Matplotlib for different plotting applications
274263
using different types of data. While few scientific packages will have the same
@@ -325,7 +314,6 @@ Then you can create a conda-forge recipe using the [Grayskull](https://github.co
325314

326315
[You will learn more about the conda-forge publication process here.](publish-conda-forge.md)
327316

328-
329317
:::{figure-md} build-workflow-tutorial
330318
<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">
331319

@@ -339,9 +327,9 @@ As the community using your package grows, you may also find yourself managing u
339327

340328
To support your community, you'll want to add things like:
341329

342-
* [a development guide that documents your maintainer workflow process ](/documentation/repository-files/development-guide.md)
343-
* [a code of conduct to defines community interaction standards and expectations](/documentation/repository-files/code-of-conduct-file.md)
344-
* [a contributing guide that helps users understand expectations associated with making contributions to your project](/documentation/repository-files/contributing-file.md)
330+
- [a development guide that documents your maintainer workflow process ](/documentation/repository-files/development-guide.md)
331+
- [a code of conduct to defines community interaction standards and expectations](/documentation/repository-files/code-of-conduct-file.md)
332+
- [a contributing guide that helps users understand expectations associated with making contributions to your project](/documentation/repository-files/contributing-file.md)
345333

346334
:::{admonition} Support for contributors and maintainers
347335

@@ -350,7 +338,7 @@ If you intend for others to use and contribute to your code, consider who will m
350338
The elements above are also important for future maintenance of your package. In the case that you are no long able to maintain it or simply want extra help, development, and contributing documentation will help you onboard new maintainers.
351339
:::
352340

353-
*****
341+
---
354342

355343
## What's next?
356344

0 commit comments

Comments
 (0)