Skip to content

feat: Add a script to update showcased projects' stars #5992

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

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

NSPC911
Copy link
Contributor

@NSPC911 NSPC911 commented Jul 26, 2025

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

Copy link
Member

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

I'd like to suggest an alternative approach that makes this a little easier to maintain.

  • extract PROJECTS in to its own Python file. Call it project_data.py or something like that.

  • Add a new Python file that maps the project name on to the star count. Call it something lke project_stars.py

    STAR_COUNTS =  {
        "dolpie": "3.2K",
        "posting": "6.2K"
    }
  • Implement a script that loads PROJECTS, runs through each project to get the stars, and then spits out project_stars.py

  • Now in project_data.py, you can import project_stars and change the stars to STAR_COUNTS["dolphie"] etc.

Why do I think this is better? It keeps the project data and star counts in one place. Right now the project information is duplicated over two files. It also avoid writing to a complex Python file. Generating code can be brittle, and it is generally best to limit the potential impact of that.

Would you like to tackle this?

@NSPC911
Copy link
Contributor Author

NSPC911 commented Jul 31, 2025

So you want me to extract the PROJECTS list to a seperate file project_data.py, the actual API calling to a seperate file project_updater.py and store the map of the stars as <repo_name>: <stars> pairs in projects_stars.py? How will it then be used by the actual projects.py script? Never mind, I didn't read that part of the comment, I'll see what I can do

@NSPC911 NSPC911 force-pushed the project-list-updater branch from 4c82397 to 738e3a7 Compare July 31, 2025 10:19
@NSPC911 NSPC911 requested a review from willmcgugan July 31, 2025 10:19
@NSPC911 NSPC911 force-pushed the project-list-updater branch from 738e3a7 to ca1b1fd Compare July 31, 2025 10:29
@NSPC911 NSPC911 force-pushed the project-list-updater branch from ca1b1fd to 204936b Compare July 31, 2025 11:04
@NSPC911 NSPC911 requested a review from TomJGooding July 31, 2025 11:04
@NSPC911 NSPC911 force-pushed the project-list-updater branch from 204936b to 87aa6b1 Compare July 31, 2025 13:01
@NSPC911 NSPC911 requested a review from TomJGooding July 31, 2025 13:01
Copy link
Contributor

@TomJGooding TomJGooding left a comment

Choose a reason for hiding this comment

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

Hopefully this runs without crashing now? It would be nice to see the updated star counts to check they match how they are displayed on GitHub?

@willmcgugan
Copy link
Member

Awesome. Thanks @NSPC911 !

And thanks @TomJGooding for the assist.

@willmcgugan willmcgugan merged commit 2a84dc4 into Textualize:main Aug 12, 2025
35 of 41 checks passed
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.

3 participants