-
Notifications
You must be signed in to change notification settings - Fork 3
Parse package data to display recent packages on home page #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add fetch_packages_yaml() and get_recent_packages() functions in core/utils.py - Update core/views.py to fetch and include recent packages in context - Modify home.html template to display actual package data instead of placeholders - Add Package model in core/models.py for future database migration
hi @Phinart98 i am back online and will catch up on your two open prs - most likely tomorrow morning ✨ I look forward to catching up with you tomorrow as well. |
@@ -237,26 +237,36 @@ <h3 class="font-bold mb-2 text-pyos-deep-purple">Blog Post Title {{ forloop.coun | |||
<h2 class="text-3xl font-bold text-center mb-12 text-pyos-deep-purple font-poppins">Recently Accepted Python Packages</h2> | |||
|
|||
<div class="grid md:grid-cols-3 gap-6 mb-8"> | |||
<!-- Placeholder package cards --> | |||
{% for i in "123" %} | |||
{% for package in recent_packages %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is odd here. As it has neonutilities as a recent package.

if you go to the website
https://www.pyopensci.org/python-packages.html
you will see a different set of newest packages. could we be sorting/ filtering using the wrong value?
list of dict | ||
List of recent package dictionaries, sorted by date_accepted descending. | ||
""" | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IS your intent to filter the packages here? To me it looks like his code and the method above grab the package list, but they don't sort it by date accepted?
Notice here in the data we have a data-accepted field. We want to use that to select the 3 packages that were most recently accepted.
https://github.com/pyOpenSci/pyopensci.github.io/blob/main/_data/packages.yml#L28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this is close but we need to add some logic to filter out the packages so the most recent ones render rather than a random? selection? i could be wrong after looking at the code but i don't see where it's actually filtered. It seems like it just collects 3.
@lwasser You're right. I missed something here. I need to add some logic to sort by the date_accepted field to ensure we get the most recently accepted packages. |
- Sort packages by date_accepted descending to show most recent first - Update author display logic to prioritize all_current_maintainers over submitting_author
@Phinart98 awesome. It's always a good idea - when you're working on a pr and are ready for a review again, please leave a message that it's ready! So something like Hey @lwasser, I have made the changes. This is ready for another review, works well!! I will have a look at this next!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this looks good @Phinart98 let's merge as is. it's building well locally!
Ok this one is merged!! you might want to rebase #31 to ensure the tests run with this pr merged into the code base! |
Very well noted! I'll make sure I draw your attention to a commit next time. |
closes #21