-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix cairo for Windows #77
base: master
Are you sure you want to change the base?
Conversation
Automatically download GTK3 libs for cairocffi if necessary
Add dependence of tqdm
@@ -17,3 +21,6 @@ def load_default_settings_files(definitions): | |||
|
|||
|
|||
__all__ = ["__version__", "load_default_settings_files"] | |||
|
|||
if not find_library("libcairo-2"): | |||
fix_cairo() |
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.
This kind of thing is better done in setup.py rather than as part of the that gets run on every invocation of mathicsscript.
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'll move the GTK+ installation part to setup.py when I have time. As for set_dll_search_path()
, it should get run on every invocation of mathicsscript unless cairocffi itself is fixed. I've put in a PR to cairocffi and if they approve it, everything can be done in setup.py.
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've put in a PR to cairocffi and if they approve it, everything can be done in setup.py.
Awesome!
setup.py
Outdated
@@ -86,6 +86,7 @@ def read(*rnames): | |||
# "mathics_pygments @ https://github.com/Mathics3/mathics-pygments/archive/master.zip#egg=mathics_pygments", | |||
"mathics_pygments>=1.0.2", | |||
"term-background >= 1.0.1", | |||
'tqdm', |
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.
This is a dependency that is only needed for Windows right now.
Maybe is a silly question but the cairo-2 dependency should not be fixed in Mathics-core? |
I am glad you asked, because it made me look into this deeper... git grep -n 'cairo'
mathicsscript/format.py:46: from cairosvg import svg2png
requirements-full.txt:3:cairosvg # For rendering Plots and Graphs as SVGs via matplotlib And if you look in Mathics-core there is nothing. So this is only needed when we want full dependencies. And it is good that it is not in Mathics-core since ideally we would like to offload dependencies when possible. |
@rocky, thanks for checking this up. In that case, LGTM. |
Forgot to remove tqdm's dependency on system other than Windows before :(
Add fixcairo.py to install GTK+ for Windows Runtime Environment for users if needed. Automatically load GTK+ dlls when mathicsscript starts.
TODO:
Update setup.py to automatically run fix_cairo() for Windows after installation.