Skip to content

Conversation

Phinart98
Copy link
Collaborator

@Phinart98 Phinart98 commented Aug 29, 2025

closes #21

  • Added fetch_packages_yaml() and get_recent_packages() functions in core/utils.py
  • Updated core/views.py to fetch and include recent packages in context
  • Modified home.html template to display actual package data instead of placeholders
  • Added Package model in core/models.py for future database migration

- 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
@lwasser
Copy link
Member

lwasser commented Sep 2, 2025

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 %}
Copy link
Member

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.

Screenshot 2025-09-03 at 1 47 09 PM

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:
Copy link
Member

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

Copy link
Member

@lwasser lwasser left a 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.

@Phinart98
Copy link
Collaborator Author

@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.
Looking at the code, get_recent_packages() doesn't actually sort the data; it simply takes the first three items from whatever order they arrive. I will add some sorting logic that parses the date_accepted field and sorts in descending order before selecting the top 3, and make a commit.

- Sort packages by date_accepted descending to show most recent first
- Update author display logic to prioritize all_current_maintainers over submitting_author
@lwasser
Copy link
Member

lwasser commented Sep 4, 2025

@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!!

Copy link
Member

@lwasser lwasser left a 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!

@lwasser lwasser merged commit a61ece5 into pyOpenSci:main Sep 4, 2025
@lwasser
Copy link
Member

lwasser commented Sep 4, 2025

Ok this one is merged!! you might want to rebase #31 to ensure the tests run with this pr merged into the code base!

@Phinart98
Copy link
Collaborator 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!!

Very well noted! I'll make sure I draw your attention to a commit next time.

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.

Parse package data to display recent packages on home page
2 participants