Skip to content

Conversation

Phinart98
Copy link
Collaborator

closes #10

  • Added Contributor Django model mirroring pyosMeta pydantic models for future database migration
  • Created YAML parsing utilities to fetch contributor data from remote GitHub source
  • Updated home view to display 4 most recent contributors with avatars and social links
  • Added comprehensive error handling and graceful fallbacks
  • Included PyYAML dependency for YAML parsing

- Added Contributor Django model mirroring pyosMeta pydantic models for future database migration
- Created YAML parsing utilities to fetch contributor data from remote GitHub source
- Updated home view to display 4 most recent contributors with avatars and social links
- Added comprehensive error handling and graceful fallbacks
- Included PyYAML dependency for YAML parsing
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.

hey @Phinart98 ! Thank you for this pr!

Please note that i haven't reviewed your code yet but I worry a bit about pyyaml as a dependency as it hasn't had a release in a year or so.

in pyosmeta, we use ruemal-yaml which has had releases as recently as this week! can you please consider updating the dependency to one that is maintainers more actively? In generally this is a good skill to develop in open source! there are SO MANY projects on PyPI and often projects become unmaintained. I like to check last commit date, look at the GitHub repository, etc to figure out if a project is maintained actively or not.

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.

I will look at this locally after we clean up the dependencies, and docstrings a bit more!! but overall it looks like a great start at the homepage!

core/utils.py Outdated
# Convert to string if it's not already
date_str = str(date_str).strip()

# Try common date formats
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious about this - are we parsing dates rom the yaml file? If we are, then pyosmeta has already cleaned up the date in that file and it should be consistent (but perhaps you saw something that I missed?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Phinart98 did you have any insight into this?

core/utils.py Outdated
cleaned = {}

# Required field
if 'github_username' not in contributor:
Copy link
Member

Choose a reason for hiding this comment

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

@banesullivan I'm curious what you think about this here. I worry about trying to clean data in multiple places vs handling cleaning when we parse the data over in pyosMeta.

@Phinart98, we have a workflow that generates that YAML file, and it uses helpers in pyosMeta to clean the data. I just think we should do that once - rather than twice UNLESS there is a good reason to do it here.

Phinart98 and others added 2 commits August 22, 2025 16:07
- Updated function docstrings in core/utils.py to use Parameters/Returns sections
- Updated model property docstrings in core/models.py
- Updated view docstring in core/views.py
- Updated template tag docstrings in core/templatetags/image_tags.py
- Updated blog model docstrings in blog/models.py

Follows numpy docstring conventions as requested for pyOpenSci project consistency.
@lwasser
Copy link
Member

lwasser commented Aug 22, 2025

This pr can be merged when

  1. the merge conflicts are resolved @melissawm
  2. the YAML dependency is updated to one that is currently maintained 🚀

Melissa you are Phillip or Carol or Bane can all merge when it's ready!!

Phinart98 and others added 3 commits August 26, 2025 17:10
- Update dependency from PyYAML>=6.0 to ruamel.yaml>=0.18.0
- Replace yaml.safe_load() with YAML(typ='safe').load()
- Update exception handling from yaml.YAMLError to YAMLError
@Phinart98
Copy link
Collaborator Author

Hello @melissawm , I have resolved the merge conflicts and updated the dependency. I believe you can review and hopefully merge now😅

Copy link
Collaborator

@melissawm melissawm left a comment

Choose a reason for hiding this comment

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

Hi @Phinart98 - not a django person so I didn't look too closely at the code, but I left a couple of general comments. Let me know if anything is not clear. Cheers!

core/admin.py Outdated
from django.contrib import admin

from django.contrib import admin
# Register your models here.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this comment supposed to be here? Also, whenever possible, it would be best to add an extra empty line at the end of each file (that will get rid of the red symbols you see here)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those comments are there in the starter files when you install Django. I should have cleared them after I added my code. I will do that in my next commit.

I have always wondered why many files I see in repos online have an extra empty line at the bottom. Thanks for pointing this out to me😅

core/utils.py Outdated
# Convert to string if it's not already
date_str = str(date_str).strip()

# Try common date formats
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Phinart98 did you have any insight into this?

Phinart98 and others added 2 commits August 27, 2025 15:29
- Add comment explaining recent_contributors usage in template
- Remove redundant data cleaning since pyosMeta handles it
- Simplify contributor sorting to match existing approach
- Remove unused imports (datetime, Optional)
- Clean up admin.py by removing default Django comment
@Phinart98
Copy link
Collaborator Author

Hello @melissawm , I have worked on the issues raised and pushed another commit. I'm looking forward to hearing your feedback.😊

Copy link
Collaborator

@melissawm melissawm left a comment

Choose a reason for hiding this comment

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

This looks good to me. If there are any improvements to be made, we can do them in follow-ups.

Thanks @Phinart98 !

@melissawm melissawm merged commit d26306b into pyOpenSci:main Aug 27, 2025
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.

feat: Parse new contributor data to display recent contributors on home page
3 participants