Skip to content

Commit de96242

Browse files
authored
Rework packaging intro and Python packaging (#243)
* Rework Introduction to Packaging slides * Restructuring Python packaging lecture and adding an entry to the timetable of this semester * Further reworking of slides and slimming down the demo * Adjusting Python packaging slides according to slide mode on HedgeDoc * Formatting * Fix formatting
1 parent b39a048 commit de96242

File tree

4 files changed

+220
-323
lines changed

4 files changed

+220
-323
lines changed

03_building_and_packaging/intro_slides.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ slideOptions:
3030
## Learning goals of chapter
3131

3232
- Explain why software is packaged.
33-
- Create Python packages, publish on PyPI, and install with pip.
33+
- Create a distributable package of a Python code, publish on PyPI, and install with pip.
3434
- Understand the difference between static and dynamic libraries and common ways of installation on Linux.
3535
- Build C++ software and handle dependencies with Make and CMake.
3636
- Package C++ software with CPack and create Debian packages.
@@ -42,17 +42,17 @@ slideOptions:
4242

4343
- Bare code is often hard to understand for everyone except the developer(s).
4444
- Packaging is a workflow to convert a code into a standardized distributable software.
45-
- A code can be standardized in various ways. Some examples are
46-
- creating a compact form by following a standardization.
47-
- providing an installation recipe, for example, using CMake / make.
48-
- bundling code into an app or software with some UI.
49-
- We discuss **creating a compact form by following a standardization**.
45+
- A code can be standardized in various ways. For example, by ...
46+
- ... providing an installation recipe, for example, using CMake / make.
47+
- ... bundling it into an app or software with a user interface.
48+
- ... packaging it according to an existing standard.
49+
- We discuss **packaging a code according to an existing standard**.
5050

5151
---
5252

5353
## Why should we package code? 1/2
5454

55-
- A bare code with many files typically has difficulties like
55+
- A code with many files typically has difficulties like
5656
- multiple dependencies and requirements of specific versions of dependencies.
5757
- intricate compilation / installation steps which are hard to get right.
5858
- missing or limited starting information / documentation, which means a high entry barrier.
@@ -62,7 +62,7 @@ slideOptions:
6262
## Why should we package code? 2/2
6363

6464
- Create a package to
65-
- benefit from a package index or package manager which is familiar for a broad audience.
65+
- benefit from a package index or package manager which is familiar to a broad audience.
6666
- benefit from automated handling of dependencies of package managers.
6767
- have ease of distribution and maintenance due to standardization.
6868
- increase overall usability and sustainability of your code.
@@ -73,20 +73,21 @@ slideOptions:
7373

7474
- First step is finding the right standard for your code.
7575
- There are several options:
76-
- One of the many Linux package managers: apt, dpkg, yum, RPM and many more ...
77-
- [CMake](https://cmake.org/) <span>: building / installation / packaging tool mostly for C, C++ projects<!-- .element: class="fragment" data-fragment-index="1" --></span>
78-
- [Spack](https://spack.io/) <span>: a package management tool mostly for supercomputing centers<!-- .element: class="fragment" data-fragment-index="1" --></span>
79-
- [Conan](https://conan.io/) <span>: open-source package manager for C and C++ development<!-- .element: class="fragment" data-fragment-index="1" --></span>
80-
- [PyPI](https://pypi.org/) and [pip](https://pypi.org/project/pip/)
76+
- Linux package managers: apt, dpkg, yum, RPM, etc.
77+
- [CMake](https://cmake.org/)
78+
- [Spack](https://spack.io/)
79+
- [Conan](https://conan.io/)
80+
- [pip](https://pypi.org/project/pip/)
8181
- [Conda](https://docs.conda.io/en/latest/)
82+
- and many more ...
8283

8384
---
8485

8586
## Why do we look at packaging a Python code?
8687

8788
- Python is easy to understand and widely used in research software.
88-
- A well established packaging workflow already exists in the Python community.
89-
- Various examples of packaged codes already exist: [NumPy](https://pypi.org/project/numpy/), [SciPy](https://pypi.org/project/scipy/), [PyTorch](https://pypi.org/project/torch/) and more ...
89+
- Well established package managers and packaging tools already exist in the Python community.
90+
- Several examples of packaged codes: [NumPy](https://pypi.org/project/numpy/), [SciPy](https://pypi.org/project/scipy/), [PyTorch](https://pypi.org/project/torch/).
9091

9192
---
9293

@@ -95,4 +96,4 @@ slideOptions:
9596
- Packaging or creating build recipe of a code is a standardized process.
9697
- Many options in packaging / building tools.
9798
- Most of these tools / methods are customized for use cases.
98-
- In this lecture we will concentrate on packaging of Python code.
99+
- In this lecture, we concentrate on packaging of Python code.

03_building_and_packaging/pip_demo.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,3 @@ pip show nutils
7373
```bash
7474
python -m pip install package-name
7575
```
76-
77-
## 4. How to read a PEP
78-
79-
- Have a look at [PEP 8](https://peps.python.org/pep-0008/)
80-
81-
## 5. Understanding a PyPI package webpage
82-
83-
- Having a look at [fenicsprecice](https://pypi.org/project/fenicsprecice/)

0 commit comments

Comments
 (0)