Canon Law was revised post-Vatican II, and it is Canon Law that gives the rules about the appointment of bishops (Canons 377 – 378 principally).

The papal representative is also obliged to consult the metropolitan archbishop and the other bishops of the province, the president of the bishops conference, and at least some members of the college of consultors and the cathedral chapter. He may also consult others, whether clergy, diocesan or religious, and "lay persons of outstanding wisdom". (As Canon 377 para 3 puts it.) But this must remain secret.

Of course, the diocese itself is free to organise consultations.

Thereafter, of course, there is the very influential way that the Pope can instruct the Nuncio on which qualities to prioritise. For Paul VI it was to be pastorally minded ...  For JPII and BXVI it was clearly something entirely different.