Skip to content

Commit

Permalink
Move PyInstaller hook tests into sub-directory
Browse files Browse the repository at this point in the history
Move PyInstaller hook test (test_freetype.py and conftest.py)
into tests sub-directory. This prevents the test from using
the local (source) version of `freetype` instead of the installed
one (which contains the shared library); this problem arises with
pytest's default `prepend` import mode due to the project's
structure (i.e., not using the `src/freetype` layout).
  • Loading branch information
rokm committed Dec 3, 2023
1 parent f6da4a8 commit 7b06f58
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ jobs:
run: |
pip install pytest psutil pyinstaller>=4
FREETYPEPY_BUNDLE_FT=yes PYTHON_ARCH=64 pip install .
pytest -v freetype/__pyinstaller
pytest -v freetype/__pyinstaller/tests
6 changes: 3 additions & 3 deletions freetype/__pyinstaller/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from os.path import dirname
import os


HERE = dirname(__file__)
HERE = os.path.dirname(__file__)


def get_hook_dirs():
return [HERE]


def get_test_dirs():
return [HERE]
return [os.path.join(HERE, 'tests')]
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def build_extension(self, ext):
author_email='[email protected]',
url='https://github.com/rougier/freetype-py',
python_requires=">=3.7",
packages=['freetype', 'freetype.ft_enums', 'freetype.__pyinstaller'],
packages=['freetype', 'freetype.ft_enums', 'freetype.__pyinstaller', 'freetype.__pyinstaller.tests'],
ext_modules=ext_modules,
zip_safe=False if ext_modules else True,
cmdclass=cmdclass,
Expand Down

0 comments on commit 7b06f58

Please sign in to comment.