Conversation
PSF sponsors (Visionary, Sustainability) now appear before infra sponsors, sorted by level then alphabetically. Falls back to color logo when white logo is unavailable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
miketheman
left a comment
There was a problem hiding this comment.
See inline comments, but also address failing test coverage once done with any changes.
Co-authored-by: Mike Fiedler <miketheman@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
https://github.com/pypi/warehouse/actions/runs/24110246717/job/70343004070?pr=19803 |
Add "Infrastructure partners" label divider between PSF and infra sponsor groups. Style infra sponsors with reduced opacity and smaller logos/text to visually distinguish them from paying PSF sponsors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
miketheman
left a comment
There was a problem hiding this comment.
Can you also share a screenshot what looks like with some richer data?
| # Add a request method which will allow to list sponsors | ||
| config.add_request_method(_sponsors, name="sponsors", reify=True) | ||
| config.add_request_method(_footer_sponsors, name="footer_sponsors", reify=True) |
There was a problem hiding this comment.
What if instead of a new request method, request.sponsors performs the query, and returns a well-structured dictionary that is sorted, ordered, etc and can be used in a template?
Maybe a shape like:
sponsors = {
"infrastructure": [...],
"all": [...],
}Then we remain with a single request method request.sponsors that returns the presorted, filtered objects for the templates to iterate?
| sponsor.level_order = sponsor_info["level_order"] | ||
| sponsor.is_active = True | ||
| sponsor.psf_sponsor = True | ||
| sponsor.footer = sponsor_info["level_name"] in {"Visionary", "Sustainability"} |
There was a problem hiding this comment.
This condition is no longer used in the template
| SponsorFactory.create_batch(5) | ||
| expected = SponsorFactory.create_batch(5) | ||
| SponsorFactory.create_batch(3, is_active=False) | ||
|
|
||
| result = sponsors._sponsors(db_request) | ||
| expected = db_request.db.query(Sponsor).filter(Sponsor.is_active == true()).all() | ||
|
|
||
| assert result == expected | ||
| assert len(result) == 5 | ||
| assert set(result) == set(expected) |
To be done with python/pythondotorg#2979.
We are required to display sponsor logos in the PyPI footer per contract obligations. We can continue to display infrastructure/in-kind sponsors below them, though.