forked from celiagg/celiagg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This should fix recent `pip` source install issues. * `Cython` version is now unbounded. `celiagg` needed to be added to the include directories but that's basically it. * `numpy` is now used instead of `oldest-supported-numpy` * `importlib.resources` is now used in place of `pkg_resources`. Unfortunately this breaks the API of `celiagg.example_font`. * Dropped support for Python 3.7
- Loading branch information
Showing
11 changed files
with
93 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
# | ||
# Authors: Erik Hvatum <[email protected]> | ||
# John Wiggins | ||
import contextlib | ||
import sys | ||
|
||
from . import _celiagg | ||
|
@@ -38,21 +39,26 @@ | |
HAS_TEXT = _celiagg.has_text_rendering() | ||
|
||
|
||
@contextlib.contextmanager | ||
def example_font(): | ||
""" Returns the path to a TTF font which is included with the library for | ||
testing purposes. | ||
""" | ||
import pkg_resources | ||
|
||
# Windows GDI font selection uses names and not file paths. | ||
# Our included font could be added to the system fonts using | ||
# `AddFontResourceEx`, but that's beyond the scope of this function. | ||
if sys.platform in ('win32', 'cygwin'): | ||
return 'Segoe UI' | ||
|
||
return pkg_resources.resource_filename( | ||
'celiagg', 'data/Montserrat-Regular.ttf' | ||
) | ||
try: | ||
# Windows GDI font selection uses names and not file paths. | ||
# Our included font could be added to the system fonts using | ||
# `AddFontResourceEx`, but that's beyond the scope of this function. | ||
if sys.platform in ('win32', 'cygwin'): | ||
yield 'Segoe UI' | ||
else: | ||
import importlib.resources | ||
|
||
with importlib.resources.path( | ||
'celiagg.data', 'Montserrat-Regular.ttf' | ||
) as path: | ||
yield str(path) | ||
finally: | ||
pass | ||
|
||
|
||
# Be explicit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
# | ||
# Authors: Erik Hvatum <[email protected]> | ||
|
||
# cython: language_level=3 | ||
# distutils: language=c++ | ||
from libcpp cimport bool | ||
import cython | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters