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
9 changes: 8 additions & 1 deletion .rumdl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ disable = [
"MD076", # Blank line between list items — false-positives inside mixed-indent MyST :::{card}
]

# content/ is MyST (directives, roles); slides/ are Marp (standard Markdown + HTML).
# Marp treats `---` as a slide separator, so each deck is many "documents" glued
# together: repeated/level-jumping per-slide `#` headings, background images with no
# alt text, mixed list markers. Those clash with MD001/MD004/MD024/MD025/MD045, and
# `rumdl fmt` rewrites them (e.g. demoting `#` to `##`) regardless of per-file-ignores,
# which changes how slides render. Exclude the decks entirely instead.
exclude = ["slides"]

# content/ is MyST (directives, roles).
[per-file-flavor]
"content/**/*.md" = "myst"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/other-tools/04_distros-debian_files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/other-tools/04_distros-packit_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/other-tools/04_distros-shipping.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 108 additions & 0 deletions content/other-tools/04_distros.md
Original file line number Diff line number Diff line change
@@ -1 +1,109 @@
---
authors: [Cristian Le]
---

# Shipping to distros

{button}`Slides <https://scikit-build.org/SIMPLE-Py/slides/5_04_distros>`

Is packaging to distros still valuable these days?
Yes, both to the ecosystem in general and your own project.[^1]

[^1]: <https://packaging.lecris.dev/>

## Why get involved?

- You find what is currently used across the ecosystem
- You get reverse-dependency tests
- You get notified early of dependencies breakage
- You get help from the packagers

## Participating as upstream

You do not have to be a packager to help with distro packaging.
Just running the downstream package build in upstream is a huge step towards it.
If your project is not yet packaged, that's fine, you can do it yourself.

The only files you need to manage is a `.spec` file and enable `packit` configuration[^2].
The spec file can be quite minimal and low/no maintenance:

```rpmspec
Name: foo
Version: 0.0.0
Release: %autorelease
Summary: Example package
License: Unlicense
URL: https://example.com
Source: %{pypi_source foo}
BuildRequires: python3-devel

%description
Lorem ipsum

%prep
%autosetup -n foo-%{version}

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files foo

%check
%pytest

%files -f %{pyproject_files}
%license LICENSE
%doc README.md

%changelog
%autochangelog
```

Packit is a service available as a GitHub app and GitLab, but can be extended upon request.
There are some [onboarding steps] to follow, after which you get distro builds in upstream project.

```{image} 04_distros-packit_example.png
:alt: Packit jobs run in upstream
```

[onboarding steps]: https://packit.dev/docs/guide
[^2]: You can handle the building yourself, but why would you?
There are a bunch of edge-case issues you should not be subjected to.

## Shipping to distros

```{image} 04_distros-shipping.jpg
:alt: Packaging is dangerous business
```

Doing the whole packaging process is a daunting process.
It is best to contact your local neighborhood distro packager.
You can find some in [#scitech] or [#python] channels in Fedora matrix who also share your interest.
[#devel] channel is where you find everyone else if you're feeling social.

If you want to do it all yourself, drop a line in [#join] or [#devel] and there will be people guiding you.
Note being a packager is as much a social problem as it is a technical one.

[#scitech]: https://matrix.to/#/#scitech:fedoraproject.org
[#python]: https://matrix.to/#/#python:fedoraproject.org
[#devel]: https://matrix.to/#/#devel:fedoraproject.org
[#join]: https://matrix.to/#/#join:fedoraproject.org

## What about non-Fedora?

Unfortunately equivalent CI tools do not seem to be available for other distros.

```{image} 04_distros-debian_files.png
:alt: Lots more files to manage
```

```{image} 04_distros-debian_control_file.png
:alt: Looks like a lot to maintain
```

But still the same advice applies, get in touch with a local packager and express your interest.
174 changes: 174 additions & 0 deletions slides/5_04_distros.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
---
marp: true
theme: simplepy
paginate: true
_paginate: skip
---

# SIMPLE-Py

## Shipping to distros

---

## Is it still valuable?

- What about `conda`, `spack`, etc.?
* Does not have extensive testing, vulnerability tracking, etc.
- Are traditional packaging dying?
* Not for non-gui apps/libraries
* Still valuable even if you have a flatpak app
- Isn't it a big commitment?
* Not for you, that's the packager's job
* Your only job is be open and communicate

---

## How to get involved

- Run downstream builds/CI in upstream
- Collaborate with a packager

---

# Downstream builds in upstream

All you need is
- `.spec` file: how to build the package
- `packit` app: does the build shows the result

---

# Downstream builds in upstream

<div class="columns">
<div>

## Spec file metadata
- Mostly boilerplate
- `python3-devel` dependency is enough
- That is it, no maintenance needed

</div>
<div>

```rpmspec
Name: foo
Version: 0.0.0
Release: %autorelease
Summary: Example package
License: Unlicense
URL: https://example.com
Source: %{pypi_source foo}
BuildRequires: python3-devel

%description
Lorem ipsum
```

</div>
</div>

---

# Downstream builds in upstream

<div class="columns">
<div>

## Build instructions
- Luckily it's a python project
- You can add any bash commands
- But check with packager if there are not simpler methods

</div>
<div>

```rpmspec
%prep
%autosetup -n foo-%{version}

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files foo

%check
%pytest
```

</div>
</div>

---

# Downstream builds in upstream

<div class="columns">
<div>

## The rest
- What files you package and where
- `%{pyproject_files}` contains all python files
- `%changelog` don't worry about it

</div>
<div>

```rpmspec
%files -f %{pyproject_files}
%license LICENSE
%doc README.md

%changelog
%autochangelog
```

</div>
</div>

---

# Shipping to distros

![](../content/other-tools/04_distros-shipping.jpg)
Comment thread
LecrisUT marked this conversation as resolved.

---

# Shipping to distros

## Find your local neighborhood packager

- #scitech:fedoraproject.org
- (Former?) Scientists involved in distro packaging
- #python:fedoraproject.org
- Python distro packagers hangout
- #devel:fedoraproject.org
- Distro packager's water-cooler
- #join:fedoraproject.org
- Want to become a packager?

---

# What about non-Fedora?

![](../content/other-tools/04_distros-debian_files.png)

---

# What about non-Fedora?

![](../content/other-tools/04_distros-debian_control_file.png)

---

# What about non-Fedora?

## Find your local neighborhood packager

- Where? TBD :)