-
Notifications
You must be signed in to change notification settings - Fork 98
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
List of git repos for font projects #1262
Conversation
Extracting the list into a separate file: fontprojects.py (issue fonttools#1241)
…s, though. And some of these are binary only, so they still need to be inspected individually (issue fonttools#1241)
repos are enabled (not commented out) (issue fonttools#1241)
And annotation dozens of other repos with the issues found in each of them. (issue fonttools#1241)
so that we can generate things like this summary: ===================== Number of font repositories in this file: "TTX": 15 "OK": 41 "UFO": 3 "GH-PAGES": 2 "NOTE": 5 "GFONTS-REPO": 1 "OTF": 12 "?": 35 From the total of 114 repos, 46 are enabled. Enabled means: "OK" or "NOTE" status. (issue fonttools#1241)
Number of font repositories in this file: "TTX": 16 "OK": 47 "UFO": 18 "GH-PAGES": 2 "NOTE": 13 "GFONTS-REPO": 1 "OTF": 16 "404-ERROR": 1 "SOURCE-ONLY": 1 From the total of 115 repos, 60 are enabled. Enabled means: "OK" or "NOTE" status. (issue fonttools#1241)
@m4rc1e what do you think? |
@davelab6 I'll review this. I'm still using our pipeline doc :-) so I need to crosscheck. For now, a hardcoded python file is ok. We may need to improve this in the future. |
A git-versioned python list is the most flexible (and comfortable) solution for me. And it can very easily spit out a CSV file, if needed for other purposes. |
font-family names, based on the foldernames in the google/fonts repo. We'll still have to fill the gaps in this table... Number of font repositories in this file: "TTX": 18 "OK": 46 "UFO": 17 "GH-PAGES": 2 "NOTE": 13 "GFONTS-REPO": 1 "OTF": 15 "404-ERROR": 1 "?": 802 "SOURCE-ONLY": 1 From the total of 916 repos, 59 are enabled. Enabled means: "OK" or "NOTE" status. (issue fonttools#1241)
Now we have 91 repos enabled. ==== Number of font repositories in this file: "TTX": 15 "OK": 76 "UFO": 18 "GH-PAGES": 2 "NOTE": 15 "GFONTS-REPO": 1 "OTF": 15 "404-ERROR": 1 "?": 777 "SOURCE-ONLY": 2 From the total of 922 repos, 91 are enabled. Enabled means: "OK" or "NOTE" status. (issue fonttools#1241)
something is still wrong about the way we schedule and run worker containers and how we decide to give up or try again upon failure.
I've been improving the G Doc but I now agree with @davelab6. This should be a .csv stored in a top level folder such as |
The gdoc is fine for drafting and the CSV URL is therefore good while
drafting is ongoing, and can check that file in from time to time as needed
…On Apr 4, 2017 7:54 AM, "Marc Foley" ***@***.***> wrote:
I've been improving the G Doc but I now agree with @davelab6
<https://github.com/davelab6>. This should be a .csv stored in a top
level folder such as ./data
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1262 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAP9y7bKuF6xAwqiLP1YZrVxuWyccnJbks5rsi-HgaJpZM4MtCn6>
.
|
feed the container with data from a GoogleDocs spreadsheet. But we keep a cache file locally as well just in case (and for versioning purposes) (issue fonttools#1241)
#!/usr/bin/env python | ||
import csv | ||
import urllib | ||
CACHE_CSV = "fontprojects.csv" |
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.
Why not store this in memory using StringIO?
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.
I do store the data on disk on purpose. So that I can keep track of history on the git repo. I'm OK with fetching data from a remote spreadsheet, but I also like the guarantee of having access to the data even if the spreadsheet goes offline.
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.
Overall, a fairly elegant way to get the Google Doc into a .csv, without using gspread. It made me smile.
It would be nice to move this out of the dashboards directory. This functionality is not just related to the dashboard.
@davelab6 Felipe's solution uses the Google Doc without the need for fancy dependencies which require authentication. He's cracked it. |
CACHE_CSV = "fontprojects.csv" | ||
|
||
def get_repos(): | ||
handle = open(CACHE_CSV) |
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.
You're not closing the file in this function.
I'd opt for this:
def get_repos():
with open(CACHE_CSV) as handle:
repos = []
for row in csv.reader(handle):
if not row:
continue
repos.append(row)
return repos
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.
If I'm not mistaken, garbage collection does its work of closing the file upon returning the function call, as there's no remaining reference to the file object.
There are some limitations imposed by the Dockerfile, which does not allow references to parent folders. So we have to keep the code in the container folder. The only way out of this that I can see would be to split out the dashboard as a separate git repo. There are other considerations to make if we go that way, though. |
otherwise it would re-run forever. (issue fonttools#1241)
Using git commit --depth={MAX_NUM_ITERATIONS} (issue fonttools#1241)
we'll later increase this value again, but now, for testing purposes, let's stick to the master of each font-repo. (issue fonttools#1241)
Cormorant SC, Amatica SC, etc... (issue fonttools#1241)
I have merged this because it contains fixes to actual fontbakery checks. Off course, expending is an ongoing effort, so we'll probably open more PRs for that later. |
Thanks |
This pull request addresses the problems described at issue #1241