8000 FreeTypePen: fix missing RTD entry by takaakifuji · Pull Request #2500 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

FreeTypePen: fix missing RTD entry #2500

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 4 commits into from
Jan 13, 2022

Conversation

takaakifuji
Copy link
Contributor

#2494 fails to generate the corresponding RTD entry due to the lack of the dependency:

https://readthedocs.org/api/v2/build/15748934.txt

WARNING: autodoc: failed to import module 'freetypePen' from module 'fontTools.pens'; the following exception was raised:
No module named 'freetype'

This PR solves the issue by raising ImportError in __init__, rather than by adding a line to Doc/docs-requirements.txt.

Importing freetype at import time breaks the Read the Docs build. Solves
the issue by raising an error in __init__ as fontTools.ttLib.woff2 does,
while avoiding adding an extra line to Doc/docs-requirements.txt.
@anthrotype
Copy link
Member

Will the inline documentation get built despite the import error? If not, we should just add freetype-py to the docs requirements

@takaakifuji
Copy link
Contributor Author

#2494 emits an empty page while the check shows green. I thought keeping docs-requirements.txt minimal was important, so I took the same approach to the Brotli binding in fontTools.ttLib.woff2. If it's okay to add dependencies to docs-requirements.txt, I'll do that.

@anthrotype
Copy link
Member
anthrotype commented Jan 13, 2022

thanks. It's preferable if the docs requirements include all the optional deps so all the inline docs gets built.

I took the same approach to the Brotli binding in fontTools.ttLib.woff2

Hm, I guess that mean we get no RTD autodocs for woff2 module, if so we should fix that.

@anthrotype anthrotype merged commit f7653a5 into fonttools:main Jan 13, 2022
@takaakifuji
Copy link
Contributor Author

Thank you for the merge. I don't know much about the rtd/sphinx pipeline, but the woff2 module seems to get the docs successfully without seeing ImportError, probably because the class will never be instantiated during the autodoc phase. Anyway, sorry for messing up things!

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.

2 participants
0