-
Notifications
You must be signed in to change notification settings - Fork 5
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
Sync GitHub metadata #10
Conversation
I don't see the project being tested with doctest, should I put |
24b1401
to
a9b3d7b
Compare
fa3a726
to
a9b3d7b
Compare
21c2597
to
2daab1b
Compare
It was possible to get empty strings as topics.
Seems like I was incorrect! Please give me some time to review and address regressions. Thanks! |
Ah, I see. That's why I praise typing. |
Hm, I see that I need to change the |
I had an idea to use |
I'm finding problems with the way repository ownership is handled. Maybe we should resolve As for now, I will introduce a simple go-to function for that case and not change the logic at core, since I can see it is leveraged in determining paths for local temp checkouts, no? |
Observation: |
Ready for another run. |
Because |
260259b
to
48cb955
Compare
Let's try again with the checks. |
This PR needs a rework according to jaraco/dotfiles#2. |
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.
Thanks for this! There's a lot going on here and I can't help but feel like maybe this should be broken out into a few different concerns. I have little doubt the different commits apply changes incrementally, but it feels like the changes could be proposed incrementally too, like "implement and use RTD API for detection" and "refactor project detection".
I don't yet understand why this issue emerges with this change. Oh, maybe it's because of non-isolated tests (some test currently invokes git_url_substitutions, whose effect persists beyond the test scope, then the tests for Except, no, that doesn't seem to be the case:
Oh. Maybe that's because my dev environment is configured with those substitutions and the issue is that the tests aren't running in isolation of my local dev environment. I recently ran into this issue in another project. Let me see if I can't apply something like that here and then see if the tests fail (in isolation or not). Edit: Interesting! The warning emitted in that output is in fact indicative of the subprocess call being made without being patched, confirming that the fixture isn't intercepting those calls and the test suite is in fact dependent on my local dev environment. |
Co-authored-by: Jason R. Coombs <[email protected]>
Sure. I'll go ahead and close this and open PRs in a way that applies changes incrementally. |
Please see also #9 and jaraco/dotfiles#2.
Closes jaraco/pytest-perf#10, closes #8.
Overview
The new
sync-github
routine now syncs these data with GitHub repos of all downstream projects:Description and homepage are not overwritten if they are already present. This is to ensure that manual changes to the repository's metadata are honored. If the project's description or homepage are changed, either that change must be applied manually to the repo or the description or homepage must be removed from the repository's metadata entirely before the next periodic synchronization (which is unlikely, since it is faster to apply the change by hand).
GitHub topics can now be set in the project list, after tags, in parentheses, separated by commas. Example:
https://github.com/bswck/dotfiles/blob/0ea5638263a9a98db3cd39001a684184ac9da8a5/projects.txt#L139
Topics won't overwrite topics you add through GitHub itself. You can technically call
Repo.set_topics()
that would replace the repository's topics entirely, butRepo.add_topics()
is the default policy. Topics in the project list can have spaces and they will be implicitly converted to dashes, and whole topics lower-cased, as required by the GitHub API.The
sync-github
routine will try to find an existing RTD documentation, basing on the foregoing assumption that the project RTD slug is identical with the project name (after removing dots and kebabifying).Fetch depth can now be customized in
temp_checkout()
.sync-github
uses the depth of 1.Repo
objects now work well with forks: imagine we're in/pypa/setuptools [fork]
;github.Repo.detect()
will correctly creategithub.Repo(f"{github.username()}/setuptools")
andgithub.Repo.detect(upstream=True)
will creategithub.Repo("pypa/setuptools")
. Note: we build on the assumption that forks belong to the user, not one of their organizations.Important
Known limitation: if there are more than 30 topics, they are consumed. I didn't implement handling the pagination as I assumed there won't be a necessity of having more than 20 topics. Let me know if I should implement that regardless.