Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions 03_building_and_packaging/intro_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ slideOptions:
## Learning goals of chapter

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

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

---

## Why should we package code? 1/2

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

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

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

---

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

- Python is easy to understand and widely used in research software.
- A well established packaging workflow already exists in the Python community.
- 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 ...
- Well established package managers and packaging tools already exist in the Python community.
- Several examples of packaged codes: [NumPy](https://pypi.org/project/numpy/), [SciPy](https://pypi.org/project/scipy/), [PyTorch](https://pypi.org/project/torch/).

---

Expand All @@ -95,4 +96,4 @@ slideOptions:
- Packaging or creating build recipe of a code is a standardized process.
- Many options in packaging / building tools.
- Most of these tools / methods are customized for use cases.
- In this lecture we will concentrate on packaging of Python code.
- In this lecture, we concentrate on packaging of Python code.
8 changes: 0 additions & 8 deletions 03_building_and_packaging/pip_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,3 @@ pip show nutils
```bash
python -m pip install package-name
```

## 4. How to read a PEP

- Have a look at [PEP 8](https://peps.python.org/pep-0008/)

## 5. Understanding a PyPI package webpage

- Having a look at [fenicsprecice](https://pypi.org/project/fenicsprecice/)
Loading