Skip to content

Use Sponsor Logos#19803

Open
JacobCoffee wants to merge 20 commits intomainfrom
sponsor-footer
Open

Use Sponsor Logos#19803
JacobCoffee wants to merge 20 commits intomainfrom
sponsor-footer

Conversation

@JacobCoffee
Copy link
Copy Markdown
Member

@JacobCoffee JacobCoffee commented Apr 6, 2026

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.

JacobCoffee and others added 3 commits April 6, 2026 13:24
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>
@JacobCoffee JacobCoffee requested a review from a team as a code owner April 6, 2026 20:01
@JacobCoffee JacobCoffee enabled auto-merge (squash) April 7, 2026 18:12
@miketheman miketheman added UX/UI design, user experience, user interface HTML requires change to HTML files labels Apr 7, 2026
Copy link
Copy Markdown
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

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

See inline comments, but also address failing test coverage once done with any changes.

JacobCoffee and others added 3 commits April 7, 2026 18:39
Co-authored-by: Mike Fiedler <miketheman@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JacobCoffee JacobCoffee requested a review from miketheman April 7, 2026 23:48
@JacobCoffee
Copy link
Copy Markdown
Member Author

https://github.com/pypi/warehouse/actions/runs/24110246717/job/70343004070?pr=19803
am confused why we dont fix line length issues on make reformat :\

@JacobCoffee JacobCoffee mentioned this pull request Apr 8, 2026
JacobCoffee and others added 9 commits April 8, 2026 18:16
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>
Copy link
Copy Markdown
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

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

Can you also share a screenshot what looks like with some richer data?

Comment on lines 34 to +36
# 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)
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.

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"}
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.

This condition is no longer used in the template

Comment on lines -50 to +56
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)
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.

Nice refactor

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

Labels

HTML requires change to HTML files UX/UI design, user experience, user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants