Skip to content

Refactor builder setup#736

Open
encukou wants to merge 2 commits into
python:mainfrom
encukou:refactor-setup-i
Open

Refactor builder setup#736
encukou wants to merge 2 commits into
python:mainfrom
encukou:refactor-setup-i

Conversation

@encukou

@encukou encukou commented Jun 11, 2026

Copy link
Copy Markdown
Member

Time for the big one!

Builders were defined as lists of triples, which is somewhat cumbersome (especially when changing the tier/stability, which means moving the definition around).

Instead, add a new dataclass, BuilderDef, which holds the data.

Convert a single definition to the "new" format. Use an adapter for the others, to avoid conflicts while this PR is in flight (and perhaps later -- there's not much need to convert, until a definition needs some new feature).

Turn stability and tier into generic flags, stored in a frozenset. This way, more tags can be added later, when it makes more sense here than on the worker.
Add attributes/helpers to get the stability & tier back from the tags.

Print out a formatted list of builders when the module is run as a tool (python -m custom.builders).

Worker selection is moved to (two lines in) master.cfg; I intend to work on that in the future.

The "new style" uses factories.xxxBuild instead of having to import each factory class individually.


I'm filing PRs with individual changes from @zware's branch, to review/test/fixup/revert the changes one by one. This is based on 5f8ac35.
Unlike that commit, this does not prepare for multiple worker support (and worker selection by tags). I'm not forgetting that, just not doing it here :)

encukou added 2 commits June 11, 2026 15:23
Builders were set up as lists of triples, which is somewhat cumbersome
(especially when changing the tier/stability, which means moving
the definition around).

Instead, add a new dataclass, `BuilderDef`, which holds the data.

Convert a single definition to the "new" format, to avoid conflicts
while this PR is in flight.

Turn `stability` and `tier` into generic flags, stored in a frozenset.
This way, more can be added later, when it makes more sense here than
on the worker.
Add attributes/helpers to get the stability & tier back from the tags.

Print out a formatted list of builders when the module is run as a tool
(`python -m custom.builders`).
@encukou encukou changed the title Refactor setup i Refactor builder setup Jun 11, 2026
Comment thread master/custom/builders.py
),
]

def generate_builderefs(tags, tuples):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: s/builderefs/builderdefs/ ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants