Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(contributing) Add guidelines for anchoring and aliasing of pip entries #29037

Merged
merged 4 commits into from
May 6, 2021
Merged
Changes from 2 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
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,24 @@ python3-foobar-pip:
packages: [foobar]
```

In constrast to normal python entries, which are often different for python 2 and 3, pip entries for python 2 and 3 are almost always identical.
MatthijsBurgh marked this conversation as resolved.
Show resolved Hide resolved
Hence no new entry would be needed. Though this would leave us with a mess of `python3-*`, `python-*-pip` and `python3-*-pip` entries.
To prevent this, the `python3-*-pip` entry should be mapped to the legacy `python-*-pip` entry by using yaml anchors and aliases.
(Preferably this was the other way around. So the `python3-*-pip` entry containing the contents and the anchor and the legacy `python-*-pip` entry being aliased to it.
Though the anchor should be defined before the anchor is used and `python3-` entries come after `python-` entries in alphabetical order.)

For example:

```yaml
python-foobar-pip: &migrate_eol_2025_04_30_python3_foobar_pip # Anchor
nuclearsandwich marked this conversation as resolved.
Show resolved Hide resolved
ubuntu:
pip:
packages: [foobar]
python3-foobar-pip: *migrate_eol_2025_04_30_python3_foobar_pip # Alias
```

The anchor/alias should be formatted as `migrate_eol_<YYYY>_<MM>_<DD>_<NEW_KEY_UNDERSCORED>`.

Some existing rules do not have `python-` or `python3-` prefixes, but this is no longer recommended.
If the package ever becomes available in Debian or Ubuntu, the `python3-` prefix ensures that the `pip` key is next to it alphabetically.
The `-pip` key should be removed when the package becomes available on all platforms, and all existing users of the `-pip` key should migrate to the new key.
Expand Down