Add archlinux packaging to nfpm backend#21299
Conversation
Also, add type hints for some of the field.alias properties because mypy was getting confused.
This is needed for the field_set calculations
A common field that all nfpm packages will share, making it easier to build a common FieldSet base.
Almost all fields are "required" in that, if present, they are used in the generation of the package. Users do not have to supply them, but the fields have to exist on the Nfpm*Package targets.
This reverts commit d41a201.
6d02dbb to
7e9c57f
Compare
| core_fields = ( | ||
| *COMMON_NFPM_PACKAGE_FIELDS, | ||
| *ARCHLINUX_FIELDS, | ||
| NfpmArchlinuxScriptsField, |
There was a problem hiding this comment.
I noticed that the scripts fields are not part of the PACKAGER_FIELDS constants. For my own education, why are they not included there?
There was a problem hiding this comment.
The packager field constants are used to populate the field sets required_fields. Then, the field set's nfpm_config method loops over required_fields to add each field's config. But, the logic for scripts fields is not the same as the logic for the other fields. So, excluding the scripts fields from required_fields lets me used different logic for them.
Admittedly, this is an unorthodox use of field sets, but it was the simplest way I came up with for dealing with the vast number of fields.
There was a problem hiding this comment.
Maybe worth an explanatory comment somewhere? (And one-line comment before the line with the scripts field in these target definitions referring to the explanatory comment.)
) This moves the scripts fields into the `<packager>_FIELDS` constants to satisfy this review suggestions: #21299 (comment) #21310 (comment) It also adds `param.pytest(..., id="...")` to name tests in a sane way.
This adds archlinux packaging to the nfpm backend introduced in #19308.
New target (and related fields):
nfpm_archlinux_package